Learn R Programming

MRIaggr (version 1.1.5)

allocTable: Allocate volumic information

Description

Allocate volumic information to a MRIaggr object.

Usage

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

Arguments

object
an object of class MRIaggr. REQUIRED.
value
the volumic information. data.frame. REQUIRED.
type
the type of volumic information. Can be "lesion" "reperfusion" "hypoperfusion". REQUIRED.
overwrite
if tables are already stored in object@normalization, can they be overwritten ? logical.
verbose
should the execution of the function be traced ? logical.

Value

None.

Details

ARGUMENTS : The validity of the value object is not checked. A valid format should match the result of the calcTableHypoReperf and calcTableLesion functions.

See Also

calcTableHypoReperf to compute the hypoperfusion and reperfusion tables. calcTableLesion to compute the lesion table. selectTable to extract the tables. plotTableLesion to display the lesion volume by slice.

Examples

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

#### 1- lesion ####
## manual allocation
maskN <- c("MASK_DWI_t0","MASK_T2_FLAIR_t2")
resTable <- calcTableLesion(MRIaggr.Pat1_red, maskN = maskN, numeric2logical = TRUE)
allocTable(MRIaggr.Pat1_red, type = "lesion", overwrite = TRUE) <- resTable

## automatic allocation
resTable <- calcTableLesion(MRIaggr.Pat1_red, maskN = maskN,
     numeric2logical = TRUE, update.object = TRUE, overwrite = TRUE)

## display
selectTable(MRIaggr.Pat1_red, type = "lesion")

#### 2- hypoperfusion and reperfusion ####
## manual allocation
resTable <- calcTableHypoReperf(MRIaggr.Pat1_red, param = c("TTP","MTT"), timepoint=c("t0","t1"))
allocTable(MRIaggr.Pat1_red, type = "hypoperfusion", overwrite = TRUE) <- resTable$volume_hypo
allocTable(MRIaggr.Pat1_red, type = "reperfusion", overwrite = TRUE) <- resTable$volume_reperf

## automatic allocation
resTable <- calcTableHypoReperf(MRIaggr.Pat1_red, param = c("TTP","MTT"), 
      timepoint = c("t0","t1"), update.object = TRUE, overwrite = TRUE)

## display
selectTable(MRIaggr.Pat1_red, type = "reperfusion")

Run the code above in your browser using DataLab