MRIaggr-constReduceMRIaggr: Reduce a MRIaggr

Description Usage Arguments Value See Also Examples

Description

Construct a MRIaggr object restricted to a subset of observations.

Usage

1
2
## S4 method for signature 'MRIaggr'
constReduceMRIaggr(object, mask, numeric2logical = FALSE, keep.index = TRUE)

Arguments

object

an object of class MRIaggr. REQUIRED.

mask

the binary contrast parameter or a vector indicating the observations to be kept. character or logical vector with length equal to the number of observations in object. REQUIRED.

numeric2logical

should mask be converted to logical ? logical.

keep.index

should the previous index parameter be saved in the ls_descStats slot ? logical.

Value

a MRIaggr object.

See Also

calcBrainMask to compute an indicator of the brain observations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## load NIFTI files and convert them to MRIaggr
path.Pat1 <- system.file(file.path("nifti"), package = "MRIaggr")
ls.array <- list(readMRI(file.path(path.Pat1, "T2_GRE_t0"), format = "nifti"))
MRIaggr.Pat1 <- constMRIaggr(ls.array, identifier = "Pat1", param = "T2_GRE_t0")

## create the cerebral mask

## Not run: 
res <- calcBrainMask(MRIaggr.Pat1, param = "T2_GRE_t0", type = "kmeans",
                     kmeans.n_groups = 2:4,
                     update.object = TRUE, overwrite = TRUE)

res <- calcSmoothMask(MRIaggr.Pat1, update.object = TRUE, overwrite = TRUE)

## End(Not run)
## display
multiplot(MRIaggr.Pat1, param = "mask", legend = FALSE)					  

## construct the reduced object
MRIaggr.Pat1_red <- constReduceMRIaggr(MRIaggr.Pat1, mask = "mask")

## display
par(mfrow = c(2,4), mar = rep(1.75, 4), mgp = c(2,0.75,0))
multiplot(MRIaggr.Pat1, param = "T2_GRE_t0",
             window = NULL,breaks = seq(0, 300, 1), legend = FALSE)
multiplot(MRIaggr.Pat1_red, param = "T2_GRE_t0",
             window = NULL, breaks = seq(0, 300, 1), legend = FALSE)

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