Learn R Programming

MRIaggr (version 1.1.5)

calcContralateral: Compute contraleral normalization values

Description

Associate each voxel to an hemisphere and compute the difference between the voxel values and their contralateral correspondent.

Usage

## S3 method for class 'MRIaggr':
calcContralateral(object, param, num = NULL, type = "mean", 
     param.ref = NULL, distband = 1, lambda = 1, 
	 verbose = optionsMRIaggr("verbose"), update.object = FALSE, overwrite = FALSE)

Arguments

object
an object of class MRIaggr. REQUIRED.
param
the contrast parameters to normalize. character vector. REQUIRED.
num
the slices to extract. numeric vector or NULL.
type
the method used to compute the contralateral correspondent of each voxel. Can be "mean", "median" or "1NN_penalised".
param.ref
the parameter to use as a reference for the identification of the contralateral voxel. character or NULL if no reference parameter available.
distband
the distance within which the contralateral values are considered. postive numeric.
lambda
the importance of the penalization. numeric.
verbose
should the execution of the function be traced ? logical.
update.object
should the resulting contralateral parameters be stored in object ? logical.
overwrite
if contrast parameters with the same names are already stored in object@data, can they be overwritten ? logical.

Value

  • An list containing :
    • [[data]]: adata.framecontaining the coordinates and the parameters normalized by the contralateral values.
    • [[index_plot]]: two lists containing the observations used to compute the contralateral values, one for each hemisphere.

concept

calc.

Details

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

FUNCTION: To compute the contralateral correspondent of each voxel, the mean or median value of the contralateral observations present in the distband can be used. Otherwise, considering a reference parameter, the contralateral voxel that minimised the difference in contrast (denoted I) with the voxel of interest (denoted x) penalized by the distance is retained : $$voxel_{contro} = argmin_{y} \frac{|I(x) - I(y)|}{\sigma} + \lambda * dist(x,y) where \sigma=sd(I)$$ The param.ref and lambda are active only if type is "1NN_penalized". In this case lambda equal 0 means no penalization.

See Also

calcHemisphere to identify the hemispheres. selectContrast to select the contralateral normalized parameters or the hemisphere parameter.

Examples

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

## associate each voxel to its contralateral correspondant 
## according T1 parameter and compute the normalized parameters
res <- calcContralateral(MRIaggr.Pat1_red, param = c("DWI_t0","T2_FLAIR_t2"), num = NULL,
         type = "mean", param.ref = "T1_t0", distband = 1, lambda = 1, verbose = TRUE)

## display
multiplot(res$data[,c("i","j","k"),drop = FALSE],
             contrast = res$data$DWI_t0_contro
)

multiplot(res$data[,c("i","j","k"), drop = FALSE],
             contrast = res$data$DWI_t0_contro,
             index1 = res$data[res$index_plot$index.plot_lesionR,c("i","j","k"), drop = FALSE],
             index2 = res$data[res$index_plot$index.plot_lesionL,c("i","j","k"), drop = FALSE]
)

Run the code above in your browser using DataLab