Last data update: 2014.03.03

R: Set or Query Default Values for MRIaggr
optionsMRIaggrR Documentation

Set or Query Default Values for MRIaggr

Description

optionsMRIaggr works in the same way as options : it can be used to set or query the default values used by the functions of the MRIaggr package.

Usage

optionsMRIaggr(..., reinit.options = FALSE)

Arguments

...

arguments in tag = value form, or a list of tagged values. character or list.

reinit.options

should the default values be reinitialized. logical

Value

If not argument is provided, a list containing all the graphical parameters is returned.
If one argument is provided with no value, the value of the corresponding graphical parameter.
If several arguments are provided, a list containing the corresponding graphical parameters is returned.
If one argument is provided with a value, nothing is returned.

optionsMRIaggr elements

The individual optionsMRIaggr elements are:

asp the aspect ratio y/x. numeric.
axes should the axes be plotted ? logical.
bg the color used for the background. character.
breaks the break points or the number of breakpoints to use to generate the color intervals . numeric vector or postive integer. Active in multiplot only if argument col is NULL.
cex the expansion factor used to plot the observations. positive numeric.
cex.index the expansion factor used to plot each additionnal points to display. integer vector of size 3.
cex.legend the expansion factor of the legend. positive numeric.
cex.main the expansion factor for the main title. numeric.
checkArguments should the validity of thes argments be checked ? logical.
col.index the color used to plot each additionnal points to display. integer vector of size 3.
col.midplane the color used to display the midsagittal plan. character.
col.NA the color to use to plot the NAs. character.
digit.legend the number of decimal places to use when displaying graphics. integer.
digit.result the number of decimal places to use when displaying results. integer.
digit.epsilon the number of decimal places to use when displaying convergence criteria. integer.
digit.percentage the number of decimal places to use when displaying percentage. integer.
filter.index the filter used to define the edge of a spatial group. Any of "2D_N4", "2D_N8", "3D_N4", "3D_N6", "3D_N8", "3D_N10", "3D_N18", "3D_N26".
height the height of the device used to export the plot. postive numeric.
hemisphere the hemisphere to display. character.
legend how should the legend be displayed ? logical, NULL or "only".
main an overall title for the plot. character.
main.legend a main title for the legend. character.
mar the number of margin lines to be specified on the four sides of the plot. positive numeric vector of size 4.
mar.legend the number of margin lines to be specified on the four sides of the legend. numeric vector of size 4.
mfrow the division of the device in plot region. numeric vector of size 2 or NULL leading automatic adjustment.
mgp the margin line for the axis title, axis labels and axis line. positive numeric vector of size 3.
norm_mu the type of centering to apply on the parameter values. character.
norm_sigma the type of scaling to apply on the parameter values. character.
num.main should the slice number be written over each plot. logical.
numeric2logical if a parameter is specified for the index arguments, should it be converted to logical ? logical.
outline.index should all the additionnal points be displayed or only those on the boundary. logical.
palette the colors or the palette to use when associating colors to observation intensities. character vector or character. Active in multiplot only if argument col is NULL.
path the directory where the plot file will be created. character. If path is set to NULL, the image file is exported in the current working directory.
pch.index the label used to plot each additionnal points to display. integer vector of size 3.
pch.NA the label to use to plot the NAs. postive integer.
pty the type of plot region to be used. Can be "s" or "m".
quantiles.legend should the quantiles of the data be displayed on the legend ? logical.
res the nominal resolution in ppi which will be recorded in the bitmap file. positive integer.
slice_var the type of view to use. "i" for sagittal view, "j" for coronal view and "k" for transverse view. character.
type.breaks should the break points be equally space according the range of data values ("range"), centered ("range_center") or correspond to the quantile values ("quantile") ?
unit the units in which height and width are given. Can be any of "px", "in", "cm" or "mm"..
verbose should the execution of the methods related to MRIaggr objects be traced ? logical.
xlab a title for the x axis. character.
ylab a title for the y axis. character.
width the width of the device used to export the plot. postive numeric.
window the type of device on which the plot will be displayed. logical, NULL or character.

Details

ARGUMENTS:
palette must have be a charater vector of length length(breaks)-1 containing colors or a single character corresponding to a palette name : "rainbow", "grey.colors", "heat.colors", "terrain.colors", "topo.colors" or "cm.colors".

Possible values for legend are:

  • TRUE : the legend is displayed in the current device.

  • NULL : the legend is displayed it in a new device.

  • FALSE : the legend is not displayed.

  • "only" : the legend is displayed but not the slices.

Possible values for windows are:

  • NULL : the plot is displayed on the current device with no reshape.

  • FALSE : the plot is displayed on the current device with the appropriate reshape.

  • TRUE : a new graphical device is open.

  • "eps" : the plot is displayed in an image file using postscript.

  • "svg" : the plot is displayed in an image file using svg.

  • "png" : the plot is displayed in an image file using png.

  • "pdf" : the plot is displayed in an image file using pdf.

Arguments filename, width, height, path, unit and res correspond to those of postscript, svg and png.

Arguments mfrow, mar, mar.legend, mgp pty, asp and bg acorrespond to those of par.

See the details section of selectContrast for more details about the hemisphere, norm_mu and norm_mu arguments.

See the initNeighborhood function for details about filter.index possible values.

ARGUMENTS:
The MRIaggr environment store an object called .ls_optionsMRIaggr that contains the list of default values. This object can be modified using the optionsMRIaggr function. The original default values can be restored using optionsMRIaggr(reinit.options=TRUE).

Examples

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

# display 3 slices 
multiplot(MRIaggr.Pat1_red, param = "DWI_t0",              
          num = 1:3, axes = FALSE, bg = "white", legend = FALSE)

##
# arguments :
# axes = FALSE, bg = "white", legend = FALSE 
# can become the default argument of multiplot using :
##

optionsMRIaggr(axes = FALSE, bg = "white", legend = FALSE)

multiplot(MRIaggr.Pat1_red, param = "DWI_t0")

# now axes can be restored using either
multiplot(MRIaggr.Pat1_red, param = "DWI_t0", axes = TRUE)
# or
optionsMRIaggr(axes = TRUE)
multiplot(MRIaggr.Pat1_red, param = "DWI_t0")

## to get default arguments of multiplot
optionsMRIaggr()
optionsMRIaggr()$bg
optionsMRIaggr("bg")

## to restore the original defaut values
optionsMRIaggr(reinit.options = TRUE)

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/options-optionsMRIaggr.Rd_%03d_medium.png", width=480, height=480)
> ### Name: optionsMRIaggr
> ### Title: Set or Query Default Values for MRIaggr
> ### Aliases: optionsMRIaggr
> ### Keywords: functions
> 
> ### ** Examples
> 
> ## load a MRIaggr object
> data(MRIaggr.Pat1_red, package = "MRIaggr")
> 
> # display 3 slices 
> multiplot(MRIaggr.Pat1_red, param = "DWI_t0",              
+           num = 1:3, axes = FALSE, bg = "white", legend = FALSE)
> 
> ##
> # arguments :
> # axes = FALSE, bg = "white", legend = FALSE 
> # can become the default argument of multiplot using :
> ##
> 
> optionsMRIaggr(axes = FALSE, bg = "white", legend = FALSE)
> 
> multiplot(MRIaggr.Pat1_red, param = "DWI_t0")
> 
> # now axes can be restored using either
> multiplot(MRIaggr.Pat1_red, param = "DWI_t0", axes = TRUE)
> # or
> optionsMRIaggr(axes = TRUE)
> multiplot(MRIaggr.Pat1_red, param = "DWI_t0")
> 
> ## to get default arguments of multiplot
> optionsMRIaggr()
$asp
[1] 1

$axes
[1] TRUE

$bg
[1] "white"

$breaks
[1] 50

$cex
[1] 1

$cex.index
[1] 1 1 1

$cex.legend
[1] 1.5

$cex.main
[1] 1.5

$checkArguments
[1] TRUE

$col.index
[1] "red"    "purple" "green" 

$col.midplane
[1] "red"

$col.NA
[1] "lightyellow"

$digit.legend
[1] 2

$digit.result
[1] 2

$digit.epsilon
[1] 5

$digit.percentage
[1] 3

$filter.index
[1] "2D_N4"

$height
[1] 500

$hemisphere
[1] "both"

$legend
[1] FALSE

$main
NULL

$main.legend
NULL

$mar
[1] 1.5 1.5 1.5 1.5

$mar.legend
[1] 2 7 2 2

$mfrow
NULL

$mgp
[1] 2.0 0.5 0.0

$norm_mu
[1] FALSE

$norm_sigma
[1] FALSE

$num.main
[1] TRUE

$numeric2logical
[1] FALSE

$outline.index
[1] FALSE

$palette
[1] "terrain.colors"

$path
NULL

$pch.index
[1] 20 21 22

$pch.NA
[1] 8

$pty
NULL

$quantiles.legend
[1] TRUE

$res
[1] NA

$slice_var
[1] "k"

$type.breaks
[1] "range"

$unit
[1] "px"

$verbose
[1] TRUE

$xlab
[1] ""

$ylab
[1] ""

$width
[1] 1000

$window
[1] FALSE

> optionsMRIaggr()$bg
[1] "white"
> optionsMRIaggr("bg")
[1] "white"
> 
> ## to restore the original defaut values
> optionsMRIaggr(reinit.options = TRUE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>