MRIaggr
object.
"allocContrast"(object, param = NULL, default_value = NULL, overwrite = FALSE, verbose = optionsMRIaggr("verbose")) <- value
MRIaggr
. REQUIRED.NULL
leading to use the name of the value
argument.param
argument.object@data
, can they be overwritten ? logical.param
argument is not specified then the names of the value
argument will be used to define the parameter names.If the default_value
argument is NULL
then default values "undefined"
are attributed to each parameter.
If a parameter named "mask"
is intended to be allocated it must be done alone and it must be of type logical.
Parameter names "index"
, "i"
, "j"
and "k"
are reserved and cannot be modified.
Nevertheless if value
contains parameters "i"
, "j"
and "k"
, the correspondance between these coordinates and the object coordinates is tested.
calcContralateral
, calcRegionalContrast
, calcFilter
and calcTissueType
to compute, modify and allocate cartography.
selectContrast
to select contrast parameters in the MRIaggr
object.
## load NIFTI files and convert them to MRIaggr
path.Pat1 <- system.file(file.path("nifti"), package = "MRIaggr")
ls.array <- list()
ls.array[[1]] <- readMRI(file.path(path.Pat1, "DWI_t0"),format = "nifti")
ls.array[[2]] <- readMRI(file.path(path.Pat1, "MASK_DWI_t0"),format = "nifti")
MRIaggr.Pat1 <- constMRIaggr(ls.array, identifier = "Pat1", param = c("DWI_t0", "MASK_DWI_t0"))
## allocate a new contrast parameters
allocContrast(MRIaggr.Pat1, param = "noise", overwrite = TRUE) <- rnorm(selectN(MRIaggr.Pat1))
## perform operations on a contrast parameters and store the results
myCarto <- selectContrast(MRIaggr.Pat1 , param = "DWI_t0")
myCarto <- myCarto * 2 + 1
allocContrast(MRIaggr.Pat1, param = "myCarto", overwrite = TRUE) <- myCarto
## import a contrast parameters in an already existing MRIaggr object
nifti.MTT_t0 <- readMRI(file.path(path.Pat1, "MTT_t0"), format = "nifti")
df.MTT_t0 <- array2df(nifti.MTT_t0, name_newparam = "MTT_t0")$MTT_t0
allocContrast(MRIaggr.Pat1, param = "MTT_t0", overwrite = TRUE) <- df.MTT_t0
## some calc methods automatically save results in the @data slot
calcFilter(MRIaggr.Pat1, param = "MTT_t0", filter = "2D_G3",
update.object = TRUE, overwrite = TRUE)
res <- selectContrast(MRIaggr.Pat1, param = "MTT_t0_2D_G3")
Run the code above in your browser using DataLab