Learn R Programming

MRIaggr (version 1.1.5)

allocHemisphere: Allocate the position of the mid-saggital plan

Description

Allocate information about the position of the mid-saggital plan to a MRIaggr object.

Usage

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

Arguments

object
an object of class MRIaggr. REQUIRED.
value
a list of data.frame. Names must be among "midplane", "hemispheres" "data". See the Details section. REQUIRED.
overwrite
if the characteristics of a mid-saggital plan are already stored in object, can they be overwritten ? logical.
verbose
should the execution of the function be traced ? logical.

Value

None.

Details

ARGUMENTS: The "midplane" element indicates the position of the observations of the mid-saggital plan. It has to be a two columns data.frame with the coordinates ("i","j") in columns and the observations in rows.

The "data" element must contains the position of each voxel with respect to the mid-sagittal plan (column "i_hemisphere" and "j_hemisphere") the hemisphere ("left", "right" or "undefined") to which the voxel belongs (column "hemisphere").

The "hemispheres" element indicates in which hemisphere is the lesion (denoted by "lesion"). The others hemispheries are denoted by "contralateral". It has to be a one line two columns data.frame with names "left" "right".

See Also

calcHemisphere to obtain the position of the mid-saggital plan and the position of the lesion in the hemispheres. selectParameter to extract the previous elements.

Examples

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

## automatic allocation
resHemi <- calcHemisphere(MRIaggr.Pat1_red, param = "T2_GRE_t0", gridSearch = FALSE, num = 1,
                          update.object = TRUE, overwrite = TRUE)

## manual allocation
allocHemisphere(MRIaggr.Pat1_red, overwrite = TRUE) <- list(midplane = resHemi$midplane,
                                                            data = resHemi$data)

## display
index1 <- data.frame(selectMidplane(MRIaggr.Pat1_red), 15)
names(index1) <- c("i","j","k")
multiplot(MRIaggr.Pat1_red, param = "T2_GRE_t0", num = 1, midplane = TRUE, window = FALSE,
             index1 = list(coords = index1, pch = 20, cex = 2, col = "purple")
             
)

selectMidplane(MRIaggr.Pat1_red)
selectHemispheres(MRIaggr.Pat1_red)

Run the code above in your browser using DataLab