Learn R Programming

MRIaggr (version 1.1.5)

Carto3D2MRIaggr: Carto3D to MRIaggr converter

Description

Construct a MRIaggr object by aggregating Carto3D objects.

Usage

Carto3D2MRIaggr(ls.Carto3D, rm.Carto3D = FALSE, tol = 10^{-10}, num = NULL, verbose = optionsMRIaggr("verbose"))

Arguments

ls.Carto3D
a list of Carto3D objects. REQUIRED.
rm.Carto3D
should the object on which the ls.Carto3D argument points be removed form the global environment ? logical.
tol
numeric precision for the consistency check. positive numeric.
num
the slices to extract. numeric vector or NULL.
verbose
should the execution of the function be traced ? logical.

Value

a MRIaggr object.

Details

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

Examples

Run this code
## load NIFTI files 
path.Pat1 <- system.file(file.path("nifti"), package = "MRIaggr")

Pat1.TTP.t0.nifti <- readMRI(file.path(path.Pat1, "TTP_t0"), format = "nifti")
Pat1.DWI.t0.nifti <- readMRI(file.path(path.Pat1, "DWI_t0"), format = "nifti")
Pat1.MASK_DWI.t0.nifti <- readMRI(file.path(path.Pat1, "MASK_DWI_t0"), format = "nifti")
Pat1.MASK_T2_FLAIR.t2.nifti <- readMRI(file.path(path.Pat1, "MASK_T2_FLAIR_t2"),
                                       format = "nifti")

## convert them to Carto3D
Pat1.TTP.t0.Carto3D <- constCarto3D(Pat1.TTP.t0.nifti,
             identifier = "Pat1", param = "TTP_t0", default_value = NA)
Pat1.DWI.t0.Carto3D <- constCarto3D(Pat1.DWI.t0.nifti,
             identifier = "Pat1", param = "DWI_t0", default_value = NA)
Pat1.MASK_DWI.t0.Carto3D <- constCarto3D(Pat1.MASK_DWI.t0.nifti,
             identifier = "Pat1", param = "MASK_DWI_t0", default_value = NA)
Pat1.MASK_T2_FLAIR.t2.Carto3D <- constCarto3D(Pat1.MASK_T2_FLAIR.t2.nifti,
             identifier = "Pat1", param = "MASK_T2_t2", default_value = NA)

## convert Carto3D to MRIaggr								 
MRIaggr.Pat1 <- Carto3D2MRIaggr(list(Pat1.TTP.t0.Carto3D,
                                     Pat1.DWI.t0.Carto3D,
                                     Pat1.MASK_DWI.t0.Carto3D,
                                     Pat1.MASK_T2_FLAIR.t2.Carto3D)
)

Run the code above in your browser using DataLab