Learn R Programming

MRIaggr (version 1.1.5)

constCompressMRIaggr: Compress a MRIaggr object

Description

Generate from an existing MRIaggr object a new one with lower spatial resolution.

Usage

"constCompressMRIaggr"(object, compression.factor, param = NULL, mask = NULL, threshold = 0.49, verbose = optionsMRIaggr("verbose"))

Arguments

object
an object of class MRIaggr. REQUIRED.
compression.factor
the compression factor. postive integer. REQUIRED.
param
the contrast parameters to load in the new MRIaggr object. character vector or NULL.
mask
the binary contrast parameter(s). character vector.
threshold
the value above which the local mean of the binary parameters is assigned to 1 (and otherwise to 0). numeric between 0 and 1.
verbose
should the execution of the function be traced ? logical.

Value

a MRIaggr object.

Details

ARGUMENTS: Information about the param argument can be found in the details section of initParameter.

FUNCTION: The fonction uses a local mean to compress the initial parameters maps to a lower resolution.

Examples

Run this code
## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")
 
## compress the MRIaggr object
MRIaggr.compressed <- constCompressMRIaggr(MRIaggr.Pat1_red, compression.factor = 2,
                                           param = c("DWI_t0","T2_FLAIR_t2","MASK_T2_FLAIR_t2"),
                                           mask = "MASK_T2_FLAIR_t2") 

## display
par(mfrow = c(2,4), mar = rep(1.75,4), mgp = c(2,0.75,0))
multiplot(MRIaggr.Pat1_red, param = "DWI_t0", window = NULL, breaks = seq(0,350,1),
             midplane = TRUE, main = "before - slice ")
multiplot(MRIaggr.compressed, param = "DWI_t0", window = NULL, breaks = seq(0,350,1),
             midplane = TRUE, main = "after - slice ")

multiplot(MRIaggr.Pat1_red, param = "MASK_T2_FLAIR_t2", main = "before - slice ")
multiplot(MRIaggr.compressed, param = "MASK_T2_FLAIR_t2", main = "after - slice ")

Run the code above in your browser using DataLab