Last data update: 2014.03.03

R: Compute regional contrast parameters
calcRegionalContrastR Documentation

Compute regional contrast parameters

Description

Compute the regional contrast parameters.

Usage

## S4 method for signature 'MRIaggr'
calcRegionalContrast(object,param, bandwidth, power = 2, diagonal = FALSE,
         W = "ifany", W.range, W.spatial_res = c(1,1,1), num = NULL, hemisphere = "both",
         name_newparam = paste(param,"regional", sep = "_"),
         verbose = optionsMRIaggr("verbose"), update.object = FALSE, overwrite = FALSE)

Arguments

object

an object of class MRIaggr. REQUIRED.

param

the contrast parameter(s) from which the regional parameter(s) will be computed. character vector. REQUIRED.

bandwidth

the bandwidth of the kernel. postive numeric. REQUIRED.

power

the power of the kernel. postive numeric.

diagonal

should the diagonal be added to the neighbourhood matrix ? logical.

W

the neighbourhood matrix. dgCMatrix or "ifany" leading to use the neighbourhood matrix stored in the object if possible, else to compute this matrix.

W.range

the neighbourhood range. postive numeric. Required only if W have to be computed.

W.spatial_res

a dilatation factor for the coordinates. positive numeric vector of size 3.

num

the slices to use. numeric vector or NULL.

hemisphere

the hemisphere to use. character.

verbose

should the execution of the function be traced ? logical.

name_newparam

the name of the new parameters. character vector.

update.object

should the resulting regional parameters be stored in object ? logical.

overwrite

if contrast parameters with the same names are already stored in object can they be overwritten ? logical.

Details

This function requires to have installed the Matrix and the spam package to work.

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

Information about the hemisphere arguments can be found in the details section of selectContrast.

Information about bandwidth and power arguments can be found in the details section of EDK.

Value

A data.frame containing in columns the regional parameters.

See Also

selectContrast to select the regional parameter(s).
calcW to compute the neighboring matrix.

Examples

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

## compute regional values
res  <- calcRegionalContrast(MRIaggr.Pat1_red, param = c("T2_FLAIR_t2","T1_t0"), bandwidth = 1.875,
                        W.spatial_res = c(1.875,1.875,6), W.range = 6,
                        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,
             window = NULL, main = "raw - slice ")
multiplot(MRIaggr.Pat1_red, param = "T2_FLAIR_t2_regional", num = 1:3,
             window = NULL, main = "regional - slice ")

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-calcRegionaContrast.Rd_%03d_medium.png", width=480, height=480)
> ### Name: calcRegionalContrast
> ### Title: Compute regional contrast parameters
> ### Aliases: calcRegionalContrast calcRegionalContrast,MRIaggr-method
> ### Keywords: methods
> 
> ### ** Examples
> 
> ## load a MRIaggr object
> data("MRIaggr.Pat1_red", package = "MRIaggr")
> 
> ## compute regional values
> res  <- calcRegionalContrast(MRIaggr.Pat1_red, param = c("T2_FLAIR_t2","T1_t0"), bandwidth = 1.875,
+                         W.spatial_res = c(1.875,1.875,6), W.range = 6,
+                         update.object = TRUE, overwrite = TRUE)
 computing W ... W ready 
 param : T2_FLAIR_t2 T1_t0 
allocContrast[MRIaggr] : Cartographies "T2_FLAIR_t2_regional" "T1_t0_regional" 
                         have been allocated 
> 
> ## 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,
+              window = NULL, main = "raw - slice ")
> multiplot(MRIaggr.Pat1_red, param = "T2_FLAIR_t2_regional", num = 1:3,
+              window = NULL, main = "regional - slice ")
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>