MRIaggr-calcSmoothMask: Spatial regularization

Description Usage Arguments Details Value See Also Examples

Description

Perform a spatial regularization of a binary mask.

Usage

1
2
3
4
5
6
7
## S4 method for signature 'MRIaggr'
calcSmoothMask(object, mask = "mask", numeric2logical = FALSE,
         size_2Dgroup = 50, Neighborhood_2D = "3D_N8", rm.2Dhole = FALSE,
         size_3Dgroup = "unique", Neighborhood_3D = "3D_N10", rm.3Dhole = TRUE,
         erosion.th = 0.75, Vmask_min = 0.25, Vbackground_max = 0.75,
         Neighborhood_V = "3D_N10", verbose = optionsMRIaggr("verbose"), 
		 update.object = FALSE, overwrite = FALSE)

Arguments

object

an object of class MRIaggr. REQUIRED.

mask

the binary contrast parameter that should be smoothed. character.

numeric2logical

should mask be convert to logical ? logical.

size_2Dgroup

the minimum size of the 2D groups. positive integer or "unique".

Neighborhood_2D

the type of 2D neighbourhood. character.

rm.2Dhole

should the 2D wholes inside the mask be removed ? logical.

size_3Dgroup

the minimum size of the 3D groups. positive integer or "unique".

Neighborhood_3D

the type of 3D neighbourhood. character.

rm.3Dhole

should the 3D wholes inside the mask be removed ? logical.

erosion.th

the threshold below which the observations will be removed by the erosion. numeric between 0 and 1.

Vmask_min

mask observations with a proportion of neighbors belonging to the mask lower than Vmask_min are attributed to the background. numeric between 0 and 1.

Vbackground_max

background observations with a proportion of neighbors belonging to the mask higher than Vbackground_max are attributed to the mask. numeric between 0 and 1.

Neighborhood_V

the type of neighbourhood to use for the spatial regularization. character.

verbose

should the execution of the function be traced ? logical.

update.object

should the resulting regularized mask be stored in object ? logical.

overwrite

if a mask is already stored in object@data, can it be overwritten ? logical.

Details

ARGUMENTS:
the Neighborhood_2D or Neighborhood_3D arguments can be a matrix or an array defining directly the neighbourhood to use (i.e the weight of each neighbor) or a name indicating which type of neighbourhood should be used (see the details section of initNeighborhood).

FUNCTION:
This function applies 6 smoothing steps :

Value

An data.frame containing the mask and the coordinates in columns.

See Also

selectContrast to select the smoothed mask. 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
## load data and build 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
res <- calcBrainMask(MRIaggr.Pat1, param = "T2_GRE_t0", type = "kmeans",
                     kmeans.n_groups = 2:4,
                     update.object = TRUE, overwrite = TRUE)

## smooth the cerebral mask
res <- calcSmoothMask(MRIaggr.Pat1, update.object = TRUE, overwrite = TRUE)

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

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