Learn R Programming

MRIaggr (version 1.1.5)

allocDescStats: Allocate non standard elements

Description

Allocate non standard elements to a MRIaggr object.

Usage

"allocDescStats"(object, name, overwrite = FALSE, verbose = optionsMRIaggr("verbose")) <- value

Arguments

object
an object of class MRIaggr. REQUIRED.
value
any R object. REQUIRED.
name
the name of the element storing value. character. REQUIRED.
overwrite
if an element with the same name is already stored in object@ls_descStats, can it be overwritten ? logical.
verbose
should the execution of the function be traced ? logical.

Value

None.

Details

FUNCTION: Contrary to all other alloc. methods that impose restrictions on the objects that can be allocated, this function enable to allocate freely a R element. However these elements will have no interaction with the methods of this package.

See Also

selectDescStats to extract non standard elements.

Examples

Run this code
## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")

## allocate a vector
allocDescStats(MRIaggr.Pat1_red,name = "spatial_res") <- c(1.875,1.875,6)

## select the corresponding element
selectDescStats(MRIaggr.Pat1_red, "spatial_res")

## some calc methods automatically save results in the ls_descStats slot
# find spatial groups 
calcGroupsMask(MRIaggr.Pat1_red,mask = c("MASK_DWI_t0","MASK_T2_FLAIR_t2"),
               W.range = 6, W.spatial_res = selectDescStats(MRIaggr.Pat1_red,"spatial_res"),
               update.object = TRUE, overwrite = TRUE)

# extract spatial groups
selectDescStats(MRIaggr.Pat1_red, "GroupsLesion")

Run the code above in your browser using DataLab