the contrast parameters to normalize. character vector. REQUIRED.
mu_type
the type of centering. Can be "mean" or "median".
sigma_type
the type of scaling. Can be "sd" or "mad".
rm.CSF
should the cerebral spinal fluid observations be excluded ? logical.
rm.GM
should the grey matter observations be excluded ? logical.
rm.WM
should the white matter observations be excluded ? logical.
verbose
should the execution of the function be traced ? logical.
update.object
should the resulting normalization values be stored in object ? logical.
overwrite
if normalization values are already stored in object@normalization, can they be overwritten ? logical.
Details
FUNCTION:
If any of the rm.CSF, rm.WM or rm.GM is set to true, then the values of the parameters remaining to FALSE (among CSF, WM and GM) are summed. Voxels with value under 0.5 are discarded.
Note that rm.CSF, rm.GM and rm.WM cannot be set simultaneously to TRUE.
Value
An list containing the normalization values, one element for each type of normalization.
See Also
selectNormalization to select the normalization values. calcTissueType to compute a probabilistic classification of the brain observations in WM/GM/CSF.
Examples
## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")
## compute normalization values
res <- calcNormalization(MRIaggr.Pat1_red, param = c("DWI_t0","T2_FLAIR_t2"),
update.object = TRUE, overwrite = TRUE)
## display
par(mfrow = c(2,4), mar = rep(1.5,4), mgp = c(2,0.5,0))
multiplot(MRIaggr.Pat1_red, param = "T2_FLAIR_t2", num = 1:3,
legend = TRUE, window = NULL, main = "raw - slice ")
multiplot(MRIaggr.Pat1_red, param = "T2_FLAIR_t2", num = 1:3,
norm_mu="contralateral", norm_sigma="contralateral",
legend = TRUE, window = NULL, main = "normalized - slice ")
## extract normalization
selectNormalization(MRIaggr.Pat1_red, type = "global", mu = TRUE, sigma = FALSE)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MRIaggr)
Loading required package: Rcpp
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MRIaggr/MRIaggr-calcNormalization.Rd_%03d_medium.png", width=480, height=480)
> ### Name: calcNormalization
> ### Title: Compute normalization values
> ### Aliases: calcNormalization calcNormalization,MRIaggr-method
> ### Keywords: methods
>
> ### ** Examples
>
> ## load a MRIaggr object
> data("MRIaggr.Pat1_red", package = "MRIaggr")
>
> ## compute normalization values
> res <- calcNormalization(MRIaggr.Pat1_red, param = c("DWI_t0","T2_FLAIR_t2"),
+ update.object = TRUE, overwrite = TRUE)
global
slice : 1 2 3
allocNormalization[MRIaggr] : @normalization has been updated
>
> ## display
> par(mfrow = c(2,4), mar = rep(1.5,4), mgp = c(2,0.5,0))
> multiplot(MRIaggr.Pat1_red, param = "T2_FLAIR_t2", num = 1:3,
+ legend = TRUE, window = NULL, main = "raw - slice ")
> multiplot(MRIaggr.Pat1_red, param = "T2_FLAIR_t2", num = 1:3,
+ norm_mu="contralateral", norm_sigma="contralateral",
+ legend = TRUE, window = NULL, main = "normalized - slice ")
>
> ## extract normalization
> selectNormalization(MRIaggr.Pat1_red, type = "global", mu = TRUE, sigma = FALSE)
DWI_t0 T2_FLAIR_t2
mu_both 83.4481 203.9049
>
>
>
>
>
>
> dev.off()
null device
1
>