MRIaggr-selectW: Extract a neighbourhood matrix

Description Usage Arguments Details See Also Examples

Description

Extract elements in the W slot of a MRIaggr object.

Usage

1
2
3
## S4 method for signature 'MRIaggr'
selectW(object, type = "Wmatrix", subset_W = NULL, 
         hemisphere = "both", num = NULL, slice_var = "k", upper = NULL)

Arguments

object

an object of class MRIaggr. REQUIRED.

type

the type of the element to select. Can be "Wmatrix", "Wblocks" or "upper".

subset_W

the subset of observations to select. integer vector or NULL leading to select all the observations.

hemisphere

the hemisphere to use. character.

num

the slices to use. numeric vector or NULL.

slice_var

the type of slice to extract. "i" for sagittal, "j" for coronal and "k" for transverse. character.

upper

the format of the matrix to extract. Can be the full matrix (upper=NULL) or upper- or lower-triangular matrix (upper=TRUE or upper=FALSE).

Details

This function requires to have installed the Matrix and the spam package to work when argument name is set to "W_euclidean".

ARGUMENTS:
Information about the num argument can be found in the details section of initNum.

Information about the hemisphere argument can be found in the details section of selectContrast.

FUNCTION:
If subset_W is not NULL then arguments hemisphere and num are ignored.
Each of the num, hemisphere and subset argument define a subset of the total set of observations. It is the intersection of all these three subsets is extracted.

See Also

calcW to compute the neighboring matrix.
calcBlockW to decompose the neighboring matrix in independant blocks.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")

## compute and allocate a neighbourhood matrix
calcW(object=MRIaggr.Pat1_red, range = sqrt(2), update.object = TRUE)

## select the neighbourhood matrix
selectW(MRIaggr.Pat1_red)[1:10,1:10]
selectW(MRIaggr.Pat1_red, upper = TRUE)[1:10,1:10]
# selectW(MRIaggr.Pat1_red, upper = FALSE)[1:10,1:10] # will not work

bozenne/MRIaggr documentation built on May 13, 2019, 1:39 a.m.