show3d-methods: Methods for Function 'show3d' in Package 'dti'

Description Usage Arguments Value Methods Author(s) See Also Examples

Description

The function provides 3D visualization of "dtiData", "dtiTensor", "dwiQball" and "dtiIndices" objects using the "rgl"-package. Functionality of the rgl-package allows to rotate and zoom the displayed object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## S4 method for signature 'dtiData'
show3d(obj, xind=NULL, yind=NULL, zind=NULL, quant=.8, 
         scale=.4,
         bgcolor="black", add=FALSE, maxobjects=729, what=c("adc","data"), 
         minalpha=1, nn=1, normalize=FALSE, box=FALSE, title=FALSE, ...)
## S4 method for signature 'dtiTensor'
show3d(obj, xind=NULL, yind=NULL, zind=NULL, method=1,
         minfa=.3, mask=NULL, fibers=FALSE, 
         maxangle = 30,level=0, quant=.8, scale=.4, bgcolor="black", add=FALSE, 
         subdivide=2, maxobjects=729, what=c("tensor","adc","odf"), odfscale = 1, 
         minalpha=.25, normalize=NULL, box=FALSE, title=FALSE,...)
## S4 method for signature 'dkiTensor'
show3d(obj, xind=NULL, yind=NULL, zind=NULL, method=1, 
         minfa=.3, mask=NULL, level=0, quant=.8, scale=.4, bgcolor="black", 
         add=FALSE, subdivide=2, maxobjects=729, what=c("KT", "DT"),  
         minalpha=.25, normalize=NULL, box=FALSE, title=FALSE,...)
## S4 method for signature 'dtiIndices'
show3d(obj, index=c("fa","ga"), xind=NULL, yind=NULL, 
         zind=NULL, method=1, 
         minfa=0, bgcolor="black", add=FALSE, lwd=1, box=FALSE, 
         title=FALSE, ...)
## S4 method for signature 'dwiMixtensor'
show3d(obj, xind=NULL, yind=NULL, zind=NULL, minfa=.3, 
         minorder = 1, mineo=1, fibers=FALSE, maxangle=30, level=0,           
         quant=.8, scale=.4, bgcolor="black", add=FALSE, 
         subdivide=3, maxobjects=729, what=c("odf","axis","both"), odfscale=1, 
         minalpha=1, lwd=3, box=FALSE, title=FALSE, ...) 
## S4 method for signature 'dwiQball'
show3d(obj, xind=NULL, yind=NULL, zind=NULL, level=0, 
         quant=.8, scale=0.4, odfscale=1, bgcolor="black", add=FALSE, 
         subdivide=3, maxobjects=729, minalpha=1, box=FALSE, 
         title=FALSE, ...)
## S4 method for signature 'dwiFiber'
show3d(obj, add=FALSE, bgcolor="black", box=FALSE, 
         title=FALSE, lwd=1, ...)

Arguments

obj

An object of class dtiData, dtiTensor, dtiIndices,dwiMixTensor or dwiQball

xind

vector of x-coordinates, defaults to whole range.

yind

vector of y-coordinates, defaults to whole range.

zind

vector of z-coordinates, defaults to whole range.

quant

Quantile of maximal radii of objects used for scaling.

scale

Scale factor for the size of objects

bgcolor

Backgroundcolor for rgl-display

add

If true information is added to the current device, otherwise a new device is opened.

maxobjects

Maximal size of data cube (in voxel) to display

minalpha

Minimum value for transparency.

nn

Number of nearest neighbors used for interpolation onto a regular polyeder.

normalize

If TRUE normalize values (project to interval (0,1) within each voxel). For tensor objects normalize=NULL specifies a default depending on the content of argument what

(normalize <- switch(what,"tensor"=FALSE,"adc"=TRUE)).

box

Logical, add a bounding box.

title

Either a character string specifying a title or a logical. If title==TRUE a default title characterizing the type of plot is generated.

method

method==1 and method==2 specify two different color schemes for directional FA-maps.

minfa

Minimal FA value for dtiTensor objects and for dwiMixtensor objects.

mask

additional mask for dtiTensor objects.

minorder

Minimal order for dwiMixtensor objects.

mineo

Minimal effective order for dwiMixtensor objects.

fibers

If TRUE show fibers starting in voxel with fa>=minfa, order>=minorder and eorder>=mineo, the last two effective for dwiMixtensor objects only.

maxangle

argument for fibertracking

level

Radius of sphere used as support for ODF visualisation

subdivide

Level of subdivisions for meshing, level 0:4 correspond to use of c(12,42,162,642,2562) vertices per tensor, respectively.

what

For dtiTensor-objects either "tensor" for visualization using ellipsoids, "adc" for Apparent Diffusion Coefficients or "odf" for the Orientation Density Function. For dwiMixtensor-objects possible specifications are "odf", "axis" and "both", with the latter superposing the estimated main directions on the estimated ODF. For "axis"(and "both") the length of the axis corresponds to the mixture weights. For dtiData-objects choices are either "data" or "adc".

odfscale

Determines visualisation of the Orientation density function (ODF). For odfscale=3 the ODF values are rescaled such that the volume of the displayes objects is constant. odfscale=1 uses the values of the ODF as radii in the corrsponding vertice direction of the specified polyhedron. This can lead to extremely large volumes in case of one mixture component with high excentricity. values of odfscale inbetween 1 and 3 are possible and allow to balance between volume based visualization and emphazising highly structured ODF's.

lwd

Linewidth for visualization of dtiIndices objects.

index

Eiter "FA" for fractional anisotropy index or "GA" for geodesic anisotropy index.

...

Additional parameters passed to function rgl.par from the rgl-package.

Value

The function returns the number of the current rgl-device.

Methods

obj = "ANY"

Returns a warning

obj = "dtiData"

Empirical ADC's are visualized at the voxel centers. Color is determined by gradient directions, ADC values are reflected by both radial extend and transparancy. The value of maxobjects limits the size of datacube and may be increased on hardware with suitable graphics capabilities.

obj = "dtiIndices"

Objects are visualized as a collection of line segments with location given by the voxel center, orientation and color determined by the main direction of inisotropy and length corresponding to either fractional or geodesic anisotropy as specified in index.

Displayed objects are restricted to voxel with an fractional (geodesic) anisotropy larger than level.

obj = "dtiTensor"

Ellipsoids/ADC's are visualized at the voxel centers. Orientation and size correspond to the tensor values, color is determined by the main direction of anisotropy using the colorsceme specified with method. The fractional anisotropy value is coded as transparency. The value of maxobjects limits the size of datacube and may be increased on hardware with suitable graphics capabilities.

obj = "dkiTensor"

Prelimenary show3d method for diffusion kurtosis tensors.

obj = "dwiQball"

Estimated ODF/ADC's are visualized at the voxel centers. Color is determined by directions, ODF/ADC values are reflected by both radial extend and transparancy. The value of maxobjects limits the size of datacube and may be increased on hardware with suitable graphics capabilities.

obj = "dwiFiber"

Display and combine fibres generated by function tracking.

Displays can be closed using function rgl.close

Author(s)

Karsten Tabelow [email protected]
J\"org Polzehl [email protected]

See Also

dtiIndices-methods, dti.smooth, dtiTensor, dtiIndices

Examples

1
  ## Not run: demo(dti_art)

Example output

Loading required package: awsMethods

Use the function setCores() to change the number of CPU cores.

Loading required package: adimpro
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Reading RAW images requires to install dcraw, see 

    http://cybercom.net/~dcoffin/dcraw/ for LINUX and http://www.insflug.org/raw/ 
    for MAC OS and Windows 

Loading required package: rgl
Warning messages:
1: In fun(libname, pkgname) : could not determine path to Imagemagick 

    please set the correct path manually using 

    'Sys.setenv(ImageMagick='path2imagemagick')'
2: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
3: 'rgl_init' failed, running with rgl.useNULL = TRUE 
4: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

dti documentation built on May 29, 2017, 3:50 p.m.