Learn R Programming

MRIaggr (version 1.1.5)

constCarto3D: Array constructor for Carto3D objects

Description

Creates a Carto3D object from an array.

Usage

constCarto3D(array, identifier, param, default_value = NULL, pos_default_value = c(1,1,1), voxelDim = NULL, rm.array = FALSE)

Arguments

array
the values of the contrast parameter. array. REQUIRED.
identifier
the identifier of the patient from which the data originated. character. REQUIRED.
param
the contrast parameter. character. REQUIRED.
default_value
the reference values of the contrast parameters (e.g. the background value). character or NULL leading to search the reference value in array[pos_default_value].
pos_default_value
the coordinates of the observation that contains the reference value. numeric vector with length the number of dimension of array.
voxelDim
the voxel size with its unit of measure. A four columns data.frame with names "i", "j", "k" and "unit".
rm.array
should the object on which array argument points be removed form the global environment ? logical.

Value

An object of class Carto3D.

Details

ARGUMENTS: pos_default_value is active only if default_value is set to NULL.

Examples

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

## convert them to Carto3D
Carto3D.Pat1_TTP_t0 <- constCarto3D(nifti.Pat1_TTP_t0, identifier = "Pat1", param = "TTP_t0")
class(Carto3D.Pat1_TTP_t0)

Run the code above in your browser using DataLab