Title: | Analysis of Diffusion Weighted Imaging (DWI) Data |
---|---|
Description: | Diffusion Weighted Imaging (DWI) is a Magnetic Resonance Imaging modality, that measures diffusion of water in tissues like the human brain. The package contains R-functions to process diffusion-weighted data. The functionality includes diffusion tensor imaging (DTI), diffusion kurtosis imaging (DKI), modeling for high angular resolution diffusion weighted imaging (HARDI) using Q-ball-reconstruction and tensor mixture models, several methods for structural adaptive smoothing including POAS and msPOAS, and a streamline fiber tracking for tensor and tensor mixture models. The package provides functionality to manipulate and visualize results in 2D and 3D. |
Authors: | Karsten Tabelow [aut, cre], Joerg Polzehl [aut], Felix Anker [ctb] |
Maintainer: | Karsten Tabelow <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.5.4.3 |
Built: | 2024-11-26 06:48:34 UTC |
Source: | CRAN |
Diffusion Weighted Imaging (DWI) is a Magnetic Resonance Imaging modality, that measures diffusion of water in tissues like the human brain. The package contains R-functions to process diffusion-weighted data. The functionality includes diffusion tensor imaging (DTI), diffusion kurtosis imaging (DKI), modeling for high angular resolution diffusion weighted imaging (HARDI) using Q-ball-reconstruction and tensor mixture models, several methods for structural adaptive smoothing including POAS and msPOAS, and a streamline fiber tracking for tensor and tensor mixture models. The package provides functionality to manipulate and visualize results in 2D and 3D.
The DESCRIPTION file:
Package: | dti |
Version: | 1.5.4.3 |
Date: | 2024-09-26 |
Title: | Analysis of Diffusion Weighted Imaging (DWI) Data |
Authors@R: | c(person("Karsten", "Tabelow", role = c("aut", "cre"), email = "[email protected]"), person("Joerg", "Polzehl", role = c("aut"), email = "[email protected]"), person("Felix", "Anker", role = c("ctb"))) |
Author: | Karsten Tabelow [aut, cre], Joerg Polzehl [aut], Felix Anker [ctb] |
Maintainer: | Karsten Tabelow <[email protected]> |
Depends: | R (>= 3.5.0), awsMethods (>= 1.1-1) |
SystemRequirements: | gsl |
Imports: | methods, parallel, adimpro (>= 0.9), aws (>= 2.4.1), rgl, oro.nifti (>= 0.3.9), oro.dicom, gsl, quadprog |
LazyData: | TRUE |
Description: | Diffusion Weighted Imaging (DWI) is a Magnetic Resonance Imaging modality, that measures diffusion of water in tissues like the human brain. The package contains R-functions to process diffusion-weighted data. The functionality includes diffusion tensor imaging (DTI), diffusion kurtosis imaging (DKI), modeling for high angular resolution diffusion weighted imaging (HARDI) using Q-ball-reconstruction and tensor mixture models, several methods for structural adaptive smoothing including POAS and msPOAS, and a streamline fiber tracking for tensor and tensor mixture models. The package provides functionality to manipulate and visualize results in 2D and 3D. |
License: | GPL (>= 2) |
Copyright: | This package is Copyright (C) 2005-2020 Weierstrass Institute for Applied Analysis and Stochastics. |
URL: | https://www.wias-berlin.de/research/ats/imaging/ |
Suggests: | covr |
RoxygenNote: | 6.1.0 |
NeedsCompilation: | yes |
Packaged: | 2024-09-26 10:09:05 UTC; tabelow |
Repository: | CRAN |
Date/Publication: | 2024-09-26 12:10:03 UTC |
Config/pak/sysreqs: | dcraw libfreetype6-dev libglu1-mesa-dev make libgsl0-dev libmagick++-dev gsfonts libpng-dev libgl1-mesa-dev zlib1g-dev |
Index of help topics:
AdjacencyMatrix Create an adjacency matrix from fiber tracking results awssigmc Estimate noise variance for multicoil MR systems colqFA FA map color scheme combineDWIdata Combine two objects of class "dtiData") dkiTensor-methods Diffusion Kurtosis Imaging (DKI) dti-package Analysis of Diffusion Weighted Imaging (DWI) Data dti.options Set and manipulate image orientations for plots. dti.smooth-methods Methods for Function 'dti.smooth' in Package 'dti' dtiIndices-methods Methods for Function 'dtiIndices' in Package 'dti' dtiTensor-methods Methods for Function 'dtiTensor' in Package 'dti' dwi-class Class "dwi" dwi.smooth-methods Smooth DWI data dwiMD Methods for Mean Diffusivity in Package 'dti' dwiMixtensor-methods Methods for Function 'dwiMixtensor' in Package 'dti' dwiQball-methods Methods for Function 'dwiQball' in Package 'dti' dwiRiceBias-methods Correction for Rician Bias dwiSqrtODF-methods Methods for positive definite EAP and ODF estimation in Package 'dti' extract-methods Methods for Function 'extract' and '[' in Package 'dti' getmask-methods Methods for Function 'getmask' in Package 'dti' getsdofsb-methods Estimate the noise standard deviation medinria Read/Write Diffusion Tensor Data from/to NIFTI File optgrad Optimal gradient directions optgradients Optimal gradient directions for number of gradients between 6 and 162 plot-methods Methods for Function 'plot' in Package 'dti' polyeder Polyeders derived from the Icosahedron (icosa0) by sequential triangulation of surface triangles print-methods Methods for Function 'print' in Package 'dti' readDWIdata Read Diffusion Weighted Data sdpar-methods Methods for Function 'sdpar' in Package 'dti' setmask-methods Methods for Function 'setmask' in Package 'dti' show-methods Methods for Function 'show' in Package 'dti' show3d-methods Methods for Function 'show3d' in Package 'dti' showFAColorScale Writes an image with the colqFA colorscale to disk. subsetg Create an objects of class "dtiData" containing only a subset of gradient directions. summary-methods Methods for Function 'summary' in Package 'dti' tracking-methods Methods for Function 'tracking' in Package 'dti'
Karsten Tabelow [aut, cre], Joerg Polzehl [aut], Felix Anker [ctb]
Maintainer: Karsten Tabelow <[email protected]>
J. Polzehl, K. Tabelow (2019). Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R. Springer, Use R! series. Doi:10.1007/978-3-030-29184-6.
S. Mohammadi, K. Tabelow, L. Ruthotto, Th. Feiweier, J. Polzehl, and N. Weiskopf, High-resolution diffusion kurtosis imaging at 3T enabled by advanced post-processing, 8 (2015), 427.
S. Becker, K. Tabelow, S. Mohammadi, N. Weiskopf, and J. Polzehl, Adaptive smoothing of multi-shell diffusion weighted magnetic resonance data by msPOAS, NeuroImage 95 (2014), pp. 90-105.
S. Becker, K. Tabelow, H.U. Voss, A. Anwander, R.M. Heidemann and J. Polzehl, Position-orientation adaptive smoothing of diffusion weighted magnetic resonance data (POAS), Medical Image Analysis, 16 (2012), pp. 1142-1155.
J. Polzehl and K. Tabelow, Beyond the diffusion tensor model: The package dti, Journal of Statistical Software, 44 no. 12 (2011) pp. 1-26.
K. Tabelow, H.U. Voss and J. Polzehl, Modeling the orientation distribution function by mixtures of angular central Gaussian distributions, Journal of Neuroscience Methods, 203 (2012), pp. 200-211.
J. Polzehl and K. Tabelow, Structural adaptive smoothing in diffusion tensor imaging: The R package dti, Journal of Statistical Software, 31 (2009) pp. 1–24.
K. Tabelow, J. Polzehl, V. Spokoiny and H.U. Voss. Diffusion Tensor Imaging: Structural adaptive smoothing, NeuroImage 39(4), 1763-1773 (2008).
## Not run: demo(dti_art) ## Not run: demo(mixtens_art)
## Not run: demo(dti_art) ## Not run: demo(mixtens_art)
The function takes two objects, fiberobj
with class 'dwiFiber' containing
fiber tracking results and an array or nifti-object containing atlas information.
For each combination of regions defined in the atlas the number of fibers connecting these
regions is calculated, resulting in a matrix of fiber counts. As default this matrix
is standardized and the diagonal elements are set to zero.
AdjacencyMatrix(fiberobj, atlas, labels = NULL, method = c("standardize", "counts"), diagelements = FALSE, symmetric=TRUE, verbose = FALSE)
AdjacencyMatrix(fiberobj, atlas, labels = NULL, method = c("standardize", "counts"), diagelements = FALSE, symmetric=TRUE, verbose = FALSE)
fiberobj |
an object of class 'dwiFiber' |
atlas |
an object of class 'array' or 'nifti' containing region indices as
intensities. The atlas needs to be registered to DWI (subject) space,
with array dimension corresponding to |
labels |
optional labels for the regions. Will be used as dimnames of the resulting matrix. |
method |
either |
diagelements |
logical, if |
symmetric |
logical, with |
verbose |
logical, if |
A matrix with dimensions equal to the number of regions defined in the atlas
and dimnames given by labels
or by the region number. The matrix contains
fiber counts or values standardized with the number of fibers ni, nj
originating/ending from the pair of regions. Depending on symmetric
standardization
is with 1/sqrt(ni*nj)
or with 1/ni
.
Joerg Polzehl [email protected]
The distribution of image intensity values divided by the noise standard deviation in
-space
in dMRI experiments is assumed
to follow a non-central chi-distribution with
degrees of freedom and noncentrality parameter
, where
refers to the number of receiver
coils in the system and
is the signal of interest. This is an idealization in the sense that
each coil is assumed to have the same contribution at each location. For realistic modeling
should
be a locally smooth function in voxel space that reflects the varying local influence of the receiver coils in the
the reconstruction algorithm used.
The functions assume to be known and estimate either a local
(function
awslsigmc
) or global ( function awssigmc
)
employing an assumption of local homogeneity for
the noncentrality parameter
.
Function afsigmc
implements estimates from Aja-Fernandez (2009).
Function aflsigmc
implements the estimate from Aja-Fernandez (2013).
awssigmc(y, steps, mask = NULL, ncoils = 1, vext = c(1, 1), lambda = 20, h0 = 2, verbose = FALSE, sequence = FALSE, hadj = 1, q = 0.25, qni = .8, method=c("VAR","MAD")) awslsigmc(y, steps, mask = NULL, ncoils = 1, vext = c(1, 1), lambda = 5, minni = 2, hsig = 5, sigma = NULL, family = c("NCchi"), verbose = FALSE, trace=FALSE, u=NULL) afsigmc(y, level = NULL, mask = NULL, ncoils = 1, vext = c( 1, 1), h = 2, verbose = FALSE, hadj = 1, method = c("modevn","modem1chi","bkm2chi","bkm1chi")) aflsigmc(y, ncoils, level = NULL, mask = NULL, h=2, hadj=1, vext = c( 1, 1))
awssigmc(y, steps, mask = NULL, ncoils = 1, vext = c(1, 1), lambda = 20, h0 = 2, verbose = FALSE, sequence = FALSE, hadj = 1, q = 0.25, qni = .8, method=c("VAR","MAD")) awslsigmc(y, steps, mask = NULL, ncoils = 1, vext = c(1, 1), lambda = 5, minni = 2, hsig = 5, sigma = NULL, family = c("NCchi"), verbose = FALSE, trace=FALSE, u=NULL) afsigmc(y, level = NULL, mask = NULL, ncoils = 1, vext = c( 1, 1), h = 2, verbose = FALSE, hadj = 1, method = c("modevn","modem1chi","bkm2chi","bkm1chi")) aflsigmc(y, ncoils, level = NULL, mask = NULL, h=2, hadj=1, vext = c( 1, 1))
y |
3D array, usually obtained from an object of class |
steps |
number of steps in adapive weights smoothing, used to reveal the unerlying mean structure. |
mask |
restrict computations to voxel in mask, if |
ncoils |
number of coils, or equivalently number of effective degrees of freedom of non-central chi distribution divided by 2. |
vext |
voxel extentions |
lambda |
scale parameter in adaptive weights smoothing |
h0 |
initial bandwidth |
verbose |
if |
trace |
if |
sequence |
if |
hadj |
adjustment factor for bandwidth (chosen by |
q |
quantile to be used for interquantile-differences. |
qni |
quantile of distribution of actual sum of weights |
method |
in case of function |
level |
threshold for background separation. Used if |
h |
bandwidth for local avaeraging |
minni |
Minimum sum of weights for updating values of |
hsig |
Bandwidth of the median filter. |
sigma |
Initial estimate for |
family |
One of |
u |
if |
a list with components
sigma |
either a scalar or a vector of estimated noise standard deviations. |
theta |
the estimated mean structure |
J\"org Polzehl [email protected]
K. Tabelow, H.U. Voss, J. Polzehl, Local estimation of the noise level in MRI using structural adaptation, Medical Image Analysis, 20 (2015), pp. 76–86.
Color map implementing the FA color scheme develop at Uniklinikum Muenster (M. Deppe)
colqFA
colqFA
A vector with 256 RGB color values.
This function creates a dtiData-object from two compatible dtiData-objects. Compatible means that the spatial dimensions coincide, but gradients and b-values may be different.
combineDWIdata(x1, x2, s0strategy = "first")
combineDWIdata(x1, x2, s0strategy = "first")
x1 |
Object of class |
x2 |
Object of class |
s0strategy |
Character, determines
how the unweighted S0 images are handled. Six strategies are implemented.
|
The function can be used to merge two objects of class "dtiData" under the condition that
the information in slot ddim
in both objects is identical. Also slots voxelext
,
orientation
and rotation
should be indentical.
An object of class "dtiData".
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiData
,
readDWIdata
,
dtiData
,
subsetg
These methods estimate, in each voxel, the diffusion kurtosis tensor (and the diffusion tensor) and some scalar indices.
## S4 method for signature 'dtiData' dkiTensor(object, method=c("CLLS-QP", "CLLS-H", "ULLS", "QL", "NLR"), sigma=NULL, L=1, mask=NULL, mc.cores=setCores(, reprt=FALSE), verbose=FALSE) ## S4 method for signature 'dkiTensor' dkiIndices(object, mc.cores=setCores(, reprt=FALSE), verbose=FALSE)
## S4 method for signature 'dtiData' dkiTensor(object, method=c("CLLS-QP", "CLLS-H", "ULLS", "QL", "NLR"), sigma=NULL, L=1, mask=NULL, mc.cores=setCores(, reprt=FALSE), verbose=FALSE) ## S4 method for signature 'dkiTensor' dkiIndices(object, mc.cores=setCores(, reprt=FALSE), verbose=FALSE)
object |
Object of class |
method |
Method for tensor estimation. May be |
sigma |
Scale parameter of intensity distribution (unprocessed). Used with |
L |
Effective number of coils, 2*L are the degrees of freedom of the intensity
distribution (unprocessed). The default corresponds, e.g., to the case of a SENSE reconstruction.
Used with |
mask |
argument to specify a precomputed brain mask |
mc.cores |
Number of cores to use. Defaults to number of threads specified for openMP, see documentation of package awsMethods. Not yet fully implemented for these methods. |
verbose |
Verbose mode. |
An object of class "dkiTensor"
or "dkiIndices"
.
signature(object = "ANY")
Returns a warning
signature(object = "dtiData")
The method "dkiTensor"
estimates the diffusion kurtosis
model, i.e., the kurtosis tensor and the diffusion tensor.
signature(object = "dkiTensor")
The method "dkiIndices"
estimates
some scalar indices from the kurtosis tensor. The method is still experimental, some
quantities may be removed in future versions, other might be included.
Karsten Tabelow [email protected]
A. Tabesh, J.H. Jensen, B.A. Ardekani, and J.A. Helpern, Estimation of tensors and tensor-derived measures in diffusional kurtosis imaging, Magnetic Resonance in Medicine, 65, 823-836 (2011).
E.S. Hui, M.M. Cheung, L. Qi, and E.X. Wu, Towards better MR characterization of neural tissues using directional diffusion kurtosis analysis, Neuroimage, 42, 122-134 (2008).
J. Polzehl, K. Tabelow (2019). Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R. Springer, Use R! series. Doi:10.1007/978-3-030-29184-6.
https://www.wias-berlin.de/projects/matheon_a3/
dtiData
,
readDWIdata
,
dtiData
,
dkiTensor
dkiIndices
The function can be used to adjust to radiological conventions in image displays.
dti.options(...)
dti.options(...)
... |
The following parameters can be used to determine the behaviour of the plot method for 3D image data in subsequent calls:
all default to FALSE. |
returns specified display orientations.
Joerg Polzehl [email protected]
The function provides structural adaptive smoothing for diffusion weighted image data within the context of an diffusion tensor (DTI) model. It implements smoothing of DWI data using a structural assumption of a local (anisotropic) homogeneous diffusion tensor model (in case a "dtiData"
-object is provided). It also implements structural adaptive smoothing of a diffusion tensor using a Riemannian metric (in case a "dtiTensor"
-object is given), although we strictly recommend to use the first variant due to methodological reasons.
## S4 method for signature 'dtiData' dti.smooth(object, hmax=5, hinit=NULL, lambda=20, tau=10, rho=1, graph=FALSE,slice=NULL, quant=.8, minfa=NULL, hsig=2.5, lseq=NULL, method="nonlinear", rician=TRUE, niter=5,result="Tensor")
## S4 method for signature 'dtiData' dti.smooth(object, hmax=5, hinit=NULL, lambda=20, tau=10, rho=1, graph=FALSE,slice=NULL, quant=.8, minfa=NULL, hsig=2.5, lseq=NULL, method="nonlinear", rician=TRUE, niter=5,result="Tensor")
object |
Either an object of class |
hmax |
Maximal bandwidth |
hinit |
Initial bandwidth (default 1) |
lambda |
Critical parameter (default 20) |
tau |
Critical parameter for orientation scores (default 10) |
rho |
Regularization parameter for anisotropic vicinities (default 1) |
graph |
"logical": Visualize intermediate results (default FALSE) |
slice |
slice number, determines the slice used in visualization |
quant |
determines |
minfa |
minimal anisotropy index (FA) to use in visualization |
hsig |
bandwidth for presmoothing of variance estimates |
lseq |
sequence of correction factors for |
method |
Method for tensor estimation. May be |
rician |
"logical": apply a correction for Rician bias. This is still experimental and depends on spatial independence of errors. |
niter |
Maximum number of iterations for tensor estimates using the nonlinear model. |
result |
Determines the created object. Alternatives are |
An object of class dtiTensor
.
Returns a warning.
We highly recommend to use the method dti.smooth
on DWI data directly, i.e. on an object of class "dtiData"
, due to methodological reasons, see Tabelow et al. (2008). It is usually not necessary to use any other argument than hmax
, which defines the maximum bandwidth of the iteration.
If model=="linear"
estimates are obtained using a linearization of the tensor model. This was the estimate used in Tabelow et.al. (2008). model=="nonlinear"
uses a nonlinear regression model with reparametrization that ensures the tensor to be positive semidefinite, see Koay et.al. (2006). If varmethod=="replicates"
the error variance is estimated from replicated gradient directions if possible, otherwise (default) an estimate is obtained from the residual sum of squares. If volseq==TRUE
the sum of location weights is fixed to within iteration
(does not depend on the actual tensor). Otherwise the ellipsoid of positive location weights is determined by a bandwidth
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
J. Polzehl and K. Tabelow, Beyond the diffusion tensor model: The package dti, Journal of Statistical Software, to appear.
K. Tabelow, H.U. Voss and J. Polzehl, Modeling the orientation distribution function by mixtures of angular central Gaussian distributions, Journal of Neuroscience Methods, to appear.
J. Polzehl and K. Tabelow, Structural adaptive smoothing in diffusion tensor imaging: The R package dti, Journal of Statistical Software, 31 (2009) pp. 1–24.
K. Tabelow, J. Polzehl, V. Spokoiny and H.U. Voss. Diffusion Tensor Imaging: Structural adaptive smoothing, NeuroImage 39(4), 1763-1773 (2008).
https://www.wias-berlin.de/projects/matheon_a3/
dtiData
,
readDWIdata
,
dtiTensor-methods
,
dtiIndices-methods
,
medinria
,
dtiData
,
dtiTensor
,
dtiIndices
The method creates estimates of the fractional anisotropy (FA) and relative anisotropy (RA) indices, the main directions of anisotropy and several statistics used for visualization.
## S4 method for signature 'dtiTensor' dtiIndices(object, mc.cores = setCores(,reprt=FALSE))
## S4 method for signature 'dtiTensor' dtiIndices(object, mc.cores = setCores(,reprt=FALSE))
object |
Object of class |
mc.cores |
Number of cores to use. Defaults to number of threads specified for openMP, see documentation of package awsMethods. Our experience suggests to use 4-6 cores if available. |
An object of class "dtiIndices"
.
Returns a warning.
Estimate tensor indices like trace, fractional and geodesic anisotropy, main diffusion direction and shape parameters.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
J. Polzehl, K. Tabelow (2019). Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R. Springer, Use R! series. Doi:10.1007/978-3-030-29184-6.
J. Polzehl and K. Tabelow, Beyond the diffusion tensor model: The package dti, Journal of Statistical Software, to appear.
K. Tabelow, H.U. Voss and J. Polzehl, Modeling the orientation distribution function by mixtures of angular central Gaussian distributions, Journal of Neuroscience Methods, to appear.
J. Polzehl and K. Tabelow, Structural adaptive smoothing in diffusion tensor imaging: The R package dti, Journal of Statistical Software, 31 (2009) pp. 1–24.
K. Tabelow, J. Polzehl, V. Spokoiny and H.U. Voss. Diffusion Tensor Imaging: Structural adaptive smoothing, NeuroImage 39(4), 1763-1773 (2008).
https://www.wias-berlin.de/projects/matheon_a3/
medinria
,
dtiTensor-methods
,
dtiTensor
,
dtiIndices
## Not run: demo(dti_art)
## Not run: demo(dti_art)
The method estimates, in each voxel, the diffusion tensor from the DWI data contained in an object of class "dtiData"
.
## S4 method for signature 'dtiData' dtiTensor(object, method=c( "nonlinear", "linear", "quasi-likelihood"), sigma = NULL, L = 1, mask=NULL, mc.cores = setCores( , reprt = FALSE))
## S4 method for signature 'dtiData' dtiTensor(object, method=c( "nonlinear", "linear", "quasi-likelihood"), sigma = NULL, L = 1, mask=NULL, mc.cores = setCores( , reprt = FALSE))
object |
Object of class |
method |
Method for tensor estimation. May be |
sigma |
(local) scale parameter of the signal's distribution. |
L |
(local) effective degrees of freedom. |
mask |
argument to specify a precomputed brain mask |
mc.cores |
Number of cores to use. Defaults to number of threads specified for openMP, see documentation of package awsMethods. Our experience suggests to use 4-6 cores if available. |
An object of class "dtiTensor"
.
Returns a warning.
Estimate diffusion tensor from data in each voxel with the different options for
the regression type and model for variance estimation. If method=="linear"
estimates are obtained
using a linearization of the tensor model. This was the estimate used in Tabelow et.al. (2008).
method=="nonlinear"
uses a nonlinear regression model with reparametrization that ensures the
tensor to be positive semidefinite, see Koay et.al. (2006). The imlementation is based on R's internal
C code for the
BFGS optimization. method=="quasi-likelihood"
solves the nonlinear regression problem with the
expected value of the signal as regression function and weighting according to the signal variance.
Tis requires additional parameters sigma
and L
characterizing the distribution of the signal. If varmethod=="replicates"
the error variance is estimated from replicated
gradient directions if possible, otherwise an estimate is obtained from the residual sum of squares. If
varmodel=="global"
a homogeneous variance is assumed and estimated as the median of the local
variance estimates.
sigma
and 2*L
are the scale parameter and degrees of freedom of the (local) signal distribution. L
characterizes the effective number of coils. Both parameters are either scalars or arrays of the size of the images.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
J. Polzehl and K. Tabelow, Beyond the diffusion tensor model: The package dti, Journal of Statistical Software, 44(12), 1-26 (2011).
K. Tabelow, H.U. Voss and J. Polzehl, Modeling the orientation distribution function by mixtures of angular central Gaussian distributions, Journal of Neuroscience Methods, 203(1), 200-211 (2012).
J. Polzehl and K. Tabelow, Structural adaptive smoothing in diffusion tensor imaging: The R package dti, Journal of Statistical Software, 31(9) 1-24 (2009).
K. Tabelow, J. Polzehl, V. Spokoiny and H.U. Voss. Diffusion Tensor Imaging: Structural adaptive smoothing, NeuroImage 39(4), 1763-1773 (2008).
C.G. Koay, J.D. Carew, A.L. Alexander, P.J. Basser and M.E. Meyerand. Investigation of Anomalous Estimates of Tensor-Derived Quantities in Diffusion Tensor Imaging, Magnetic Resonance in Medicine, 2006, 55, 930-936.
J. Polzehl, K. Tabelow (2019). Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R. Springer, Use R! series. Doi:10.1007/978-3-030-29184-6.
https://www.wias-berlin.de/projects/matheon_a3/
dtiData
,
readDWIdata
,
dtiIndices-methods
,
medinria
,
dtiData
,
dtiTensor
dwiMixtensor
## Not run: demo(dti_art)
## Not run: demo(dti_art)
The family of "dwi"
classes is used for Diffusion Weighted Imaging (DWI) data and, within the Diffusion Tensor Model (DTI), diffusion tenors and its indices.
"dwi"
is only a superclass, no instances should be created. However, objects can be created by calls of the form new("dwi", ...)
. "dtiData"
, "dtiTensor"
, and "dtiIndices"
can be created from their correspondingly named functions and methods.
.Data
: Object of class "list"
, usually empty.
gradient
: Object of class "matrix"
, matrix of dimension c(3,ngrad)
containing gradient directions.
btb
: Object of class "matrix"
, matrix of dimension c(6,ngrad)
obtained from gradient directions.
bvalue
: Object of class "numeric"
, of length ngrad
containing b-values if available.
ngrad
: Object of class "integer"
, number of gradients (including zero gradients).
s0ind
: Object of class "integer"
, index of zero gradients within the sequence 1:ngrad
.
replind
: Object of class "integer"
, index (identifier) of unique gradient directions. Used to characterize replications in the gradient design by identical indices. length is ngrad
.
ddim
: Object of class "integer"
, dimension of subcube defined by xind
, yind
and zind
.
ddim0
: Object of class "integer"
, dimension of original image cubes. Vector of length 3.
xind
, yind
, zind
: Objects of class "integer"
, index for subcube definition in x-, y- and z-direction.
voxelext
: Object of class "numeric"
, voxel extensions in x-, y- and z-direction. Vector of length 3.
orientation
: Object of class "integer"
, orientation of data according to AFNI convention. Vector of length 3.
rotation
: Object of class "matrix"
, optional rotation matrix for gradient directions.
level
: Object of class "numeric"
, minimal valid S0-level. No evaluation will be performed for voxels with S0-values less than level
.
source
: Object of class "character"
, name of the source imgage file or source directory.
call
: Object of class "call"
, call that created the object.
For class "dtiData"
:
si
: Object of class "array"
, Diffusion Weighted Data.
sdcoef
: Object of class "numeric"
, Parameters of the model for error
standard deviation as a function of the mean. First two entries refer to intercept and slope of a linear function,
third and fourth value are the endpoints of the interval of linearity. Contains rep(0,4)
if not set. If the function
For class "dtiTensor"
:
D
: Object of class "array"
, estimated tensors, dimension c(6,ddim)
.
Tensors are stored as upper diagonal matrices.
th0
: Object of class "array"
, estimated intensities in S0 images, dimension ddim
sigma
: Object of class "array"
, estimated error variances if method=="linear"
, zero otherwise.
scorr
: Object of class "numeric"
, estimated spatial correlations in coordinate directions
bw
: Object of class "numeric"
, bandwidth for a Gaussian kernel that approximately creates the estimated spatial correlations. Needed for adjustments of critical values in the adaptive smoothing algorithm used in function dti.smooth
mask
: Object of class "array"
, logical indicating the voxel where the tensor was estimated.
hmax
: Object of class "numeric"
, maximal bandwidth in case of adaptive smoothing, 1 otherwise.
outlier
: Object of class "numeric"
, index of voxel where physical constraints are not met, i.e. where the observed values in gradient images Si were larger than the corresponding S0 values. These are probably motion effects or registration errors. Values are replaced by the corresponding (mean) S0 values.
scale
:Numerical value corresponding to the 95% quantile of the maximal eigenvalues of estimated tensors within the mask.
Used for scaling in function show3d.dtiTensor
method
: Object of class "character"
, either "linear"
or "nonlinear"
or "unknown"
. Indicates the regression model used for estimating the tensors.
For class "dtiIndices"
:
fa
: Object of class "array"
, Fractional anisotropy values (FA)
ga
: Object of class "array"
, Geodetic anisotropy values (GA)
md
: Object of class "array"
, Mean diffusivity values (MD)
andir
: Object of class "array"
, Main directions of anisotropy
bary
: Object of class "array"
, Shape parameters
method
: Object of class "character"
either "linear"
or "nonlinear"
or "unknown"
. Indicates the regression model used for estimating the tensors.
For class "dkiTensor"
:
D
: Object of class "array"
, estimated tensors, dimension c(6,ddim)
.
Tensors are stored as upper diagonal matrices.
W
: Object of class "array"
, estimated kurtosis tensors, dimension c(15,ddim)
.
th0
: Object of class "array"
, estimated intensities in S0 images, dimension ddim
sigma
: Object of class "array"
, estimated error variances if method=="linear"
, zero otherwise.
scorr
: Object of class "numeric"
, estimated spatial correlations in coordinate directions
bw
: Object of class "numeric"
, bandwidth for a Gaussian kernel that approximately creates the estimated spatial correlations. Needed for adjustments of critical values in the adaptive smoothing algorithm used in function dti.smooth
mask
: Object of class "array"
, logical indicating the voxel where the tensor was estimated.
hmax
: Object of class "numeric"
, maximal bandwidth in case of adaptive smoothing, 1 otherwise.
outlier
: Object of class "numeric"
, index of voxel where physical constraints are not met, i.e. where the observed values in gradient images Si were larger than the corresponding S0 values. These are probably motion effects or registration errors. Values are replaced by the corresponding (mean) S0 values.
scale
:Numerical value corresponding to the 95% quantile of the maximal eigenvalues of estimated tensors within the mask.
Used for scaling in function show3d.dtiTensor
method
: Object of class "character"
, either "linear"
or "nonlinear"
or "unknown"
. Indicates the regression model used for estimating the tensors.
For class "dkiIndices"
:
fa
: Object of class "array"
, Fractional anisotropy values (FA)
ga
: Object of class "array"
, Geodetic anisotropy values (GA)
md
: Object of class "array"
, Mean diffusivity values (MD)
andir
: Object of class "array"
, Main directions of anisotropy
bary
: Object of class "array"
, Shape parameters
k1
: Object of class "array"
, Kurtosis along DT (Hui et al. 2008)
k2
: Object of class "array"
, Kurtosis along DT (Hui et al. 2008)
k3
: Object of class "array"
, Kurtosis along DT (Hui et al. 2008)
mk
: Object of class "array"
, Mean kurtosis (Hui et al. 2008)
mk2
: Object of class "array"
, Mean Kurtosis (Tabesh et al. (2011))
kaxial
: Object of class "array"
, Axial kurtosis (Hui et al. 2008)
kradial
: Object of class "array"
, Radial kurtosis (Hui et al. 2008)
fak
: Object of class "array"
, Kurtosis anisotropy (Hui et al. 2008)
method
: Object of class "character"
either "linear"
or "nonlinear"
or "unknown"
. Indicates the regression model used for estimating the tensors.
For class "dwiQball"
:
order
: Object of class "integer"
, maximal order of Spherical Harmonics to use, needs to be even.
forder
: Object of class "integer"
, maximal order Gaussian-Laguerre functions in SPF basis (for EAP estimation)
zeta
: Object of class "numeric"
, Scale parameter used in Gaussian-Laguerre functions (for EAP estimation)
lambda
: Object of class "numeric"
, nonnegative regularization parameter.
sphcoef
: Object of class "array"
, estimated coefficients for spherical harmonics, dimension c((order+1)*(order+2)/2,ddim)
.
sigma
: Object of class "array"
, estimated error variances if method=="linear"
, zero otherwise.
scorr
: Object of class "numeric"
, estimated spatial correlations in coordinate directions
bw
: Object of class "numeric"
, bandwidth for a Gaussian kernel that approximately creates the estimated spatial correlations. Needed for adjustments of critical values in the adaptive smoothing algorithm used in function dti.smooth
mask
: Object of class "array"
, logical indicating the voxel where the tensor was estimated.
hmax
: Object of class "numeric"
, maximal bandwidth in case of adaptive smoothing, 1 otherwise.
outlier
: Object of class "numeric"
, index of voxel where physical constraints are not met, i.e. where the observed values in gradient images Si were larger than the corresponding S0 values. These are probably motion effects or registration errors. Values are replaced by the corresponding (mean) S0 values.
scale
:Numerical value corresponding to the 95% quantile of the maximal eigenvalues of estimated tensors within the mask.
Used for scaling in function show3d.dwiQball
what
: Object of class "character"
, "ODF"
, "wODF"
, "aODF"
or "ADC"
. Indicates if the object contains coefficients of the orientation density function (ODF (Descoteaux 2007), wODF (Sapiro(2009) or aODF) or the apparent diffusion coefficient (ADC). Coefficients are computed with respect to spherical harmonics of the specified order.
For class "dwiFiber"
:
fibers
: Object of class "matrix"
, Matrix of fibers. The first three columns contain the coordinates of the track points, the last three columns the direction vectors for each of these points.
startind
: Object of class "integer"
, indices for the first dimension of fibers
where
coordinates for a new fiber start.
roix
: Object of class "integer"
, coordinate range of region of interest in x-direction
roiy
: Object of class "integer"
, coordinate range of region of interest in x-direction
roiz
: Object of class "integer"
, coordinate range of region of interest in x-direction
method
: Object of class "character"
, fiber tracking method.
minfa
: Object of class "numeric"
, minimal fractional anisotropy index
maxangle
: Object of class "numeric"
, maximal angle between fibres.
For class "dwiMixtensor"
:
model
: Object of class "character"
, characterizes the type of the
mixed tensor model. Currently the only implemented model is model="homogeneous_prolate"
.
ev
: Object of class "array"
, estimated eigenvalues, dimension c(2,ddim)
mix
: Object of class "array"
, estimated mixture coefficients, dimension c(nmix,ddim)
. nmix
is the number of mixture components specified.
orient
: Object of class "array"
, estimated tensor orientations, dimension c(2,nmix,ddim)
th0
: Object of class "array"
, estimated intensities in S0 images, dimension ddim
sigma
: Object of class "array"
, estimated error variances if method=="linear"
, zero otherwise.
scorr
: Object of class "numeric"
, estimated spatial correlations in coordinate directions
bw
: Object of class "numeric"
, bandwidth for a Gaussian kernel that approximately creates the estimated spatial correlations. Needed for adjustments of critical values in the adaptive smoothing algorithm used in function dti.smooth
mask
: Object of class "array"
, logical indicating the voxel where the tensor was estimated.
hmax
: Object of class "numeric"
, maximal bandwidth in case of adaptive smoothing, 1 otherwise.
outlier
: Object of class "numeric"
, index of voxel where physical constraints are not met, i.e. where the observed values in gradient images Si were larger than the corresponding S0 values. These are probably motion effects or registration errors. Values are replaced by the corresponding (mean) S0 values.
scale
:Numerical value corresponding to the 95% quantile of the maximal eigenvalues of estimated tensors within the mask.
Used for scaling in function show3d.dtiTensor
method
: Object of class "character"
, either "mixtensor"
or "Jian"
. Indicates the regression model used for estimating the tensors.
Methods only operate on subclasses "dtiData"
, "dtiTensor"
, "dtiIndices"
, "dwiQball"
and "dwiFiber"
.
Create estimates of diffusion tensors in each voxel using structural adaptive spatial smoothing.
signature(object = "dtiData")
: Create estimates of diffusion tensors in each voxel.
signature(object = "dtiTensor")
: Create estimates of diffusion tensors indices in each voxel.
signature(object = "dtiTensor")
or signature(object = "dtiIndices")
: Fiber tracking.
signature(object = "dtiData")
: Create estimates of ADC-parameters with respect to a sherical harmonics ortho-normal system.
Method for Function ‘show3d’ in Package ‘dti’.
Method for Function ‘plot’ in Package ‘dti’.
Method for Function ‘print’ in Package ‘dti’.
Method for Function ‘summary’ in Package ‘dti’.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
J. Polzehl and K. Tabelow, Beyond the diffusion tensor model: The package dti, Journal of Statistical Software, to appear.
K. Tabelow, H.U. Voss and J. Polzehl, Modeling the orientation distribution function by mixtures of angular central Gaussian distributions, Journal of Neuroscience Methods, to appear.
J. Polzehl and K. Tabelow, Structural adaptive smoothing in diffusion tensor imaging: The R package dti, Journal of Statistical Software, 31 (2009) pp. 1–24.
K. Tabelow, J. Polzehl, V. Spokoiny and H.U. Voss. Diffusion Tensor Imaging: Structural adaptive smoothing, NeuroImage 39(4), 1763-1773 (2008).
dtiData
,
readDWIdata
,
sdpar-methods
,
getsdofsb-methods
,
dwiRiceBias-methods
,
dtiTensor-methods
,
dwiMixtensor-methods
,
dti.smooth-methods
,
dwi.smooth-methods
,
dtiIndices-methods
,
dwiQball-methods
,
tracking-methods
,
show3d-methods
,
plot-methods
,
print-methods
,
summary-methods
,
extract-methods
Adaptive smoothing of DWI data. Smoothing is performed both in space and on the sphere (e.g. between images obtained for different gradient directions) employing a natural
geometrical distance ( in SE(3)). Structural adaptation is used in space only.
Method dwi.smooth
refers to the original POAS approach for single shell data.
Method dwi.smooth.ms
implements an improved method that is applicable for both single and multi-shell data.
## S4 method for signature 'dtiData' dwi.smooth(object, kstar, lambda=20, kappa0=NULL, mask=NULL, ncoils=1, sigma=NULL, level=NULL, vred=4, verbose=FALSE, dist=1, model=c("Gapprox","Gapprox2","Chi","Chi2")) ## S4 method for signature 'dtiData' dwi.smooth.ms(object, kstar, lambda=12, kappa0=.5, ncoils=1, sigma=NULL, ws0=1, level=NULL, mask = NULL, xind=NULL, yind=NULL, zind=NULL, verbose=FALSE, usemaxni=TRUE, memrelease = TRUE)
## S4 method for signature 'dtiData' dwi.smooth(object, kstar, lambda=20, kappa0=NULL, mask=NULL, ncoils=1, sigma=NULL, level=NULL, vred=4, verbose=FALSE, dist=1, model=c("Gapprox","Gapprox2","Chi","Chi2")) ## S4 method for signature 'dtiData' dwi.smooth.ms(object, kstar, lambda=12, kappa0=.5, ncoils=1, sigma=NULL, ws0=1, level=NULL, mask = NULL, xind=NULL, yind=NULL, zind=NULL, verbose=FALSE, usemaxni=TRUE, memrelease = TRUE)
object |
Object of class |
kstar |
Number of steps in structural adaptation |
lambda |
Scale parameter in adaptation |
kappa0 |
determines amount of smoothing on the sphere. Larger values correspond to stronger smoothing on the sphere. If |
ncoils |
Number of coils in MR system |
sigma |
Error standard deviation. Assumed to be known and homogeneous in the current implementation. A reasonable estimate may be defined
as the modal value of standard deviations obtained using method |
level |
Threshold for image intensities when setting mask. |
mask |
Binary 3D image defining a mask |
vred |
Used if |
xind |
index for x-coordinate |
yind |
index for y-coordinate |
zind |
index for z-coordinate |
verbose |
If |
dist |
Distance in SE3. Reasonable values are 1 (default, see Becker et.al. 2012), 2 ( a slight modification of 1: with k6^2 instead of abs(k6)) and 3 (using a 'naive' distance on the sphere) |
model |
Determines which quantities are smoothed. Possible values are
|
ws0 |
Factor to downweight information from S0 images, defaults
to |
usemaxni |
If |
memrelease |
If |
An object of class "dtiData"
with smoothed diffusion weighted images.
signature(object) = "ANY"
Returns a warning.
signature(object) = "dtiData"
Smoothing of DWI data
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
Compute mean diffusivity (MD) from dtiData or dtiTensor objects
## S4 method for signature 'dtiData' dwiMD(object, eps=.05) ## S4 method for signature 'dtiTensor' dwiMD(object)
## S4 method for signature 'dtiData' dwiMD(object, eps=.05) ## S4 method for signature 'dtiTensor' dwiMD(object)
object |
Object of class |
eps |
tolerance in search for good gradient combinations. |
Array of mean diffusivities.
signature(object = "ANY")
Returns a warning
signature(object = "dtiData")
searches for three gradients that enable best MD evaluation. Returns MD.
signature(object = "dtiTensor")
calculates MD values from estimated difusion tensors
Karsten Tabelow [email protected]
The method estimates, in each voxel, a mixture of radial symmetric tensors from the DWI data contained in an object of class "dtiData"
.
## S4 method for signature 'dtiData' dwiMixtensor(object, maxcomp=3, model=c("MT","MTiso","MTisoFA","MTisoEV"), fa=NULL, lambda=NULL, mask=NULL, reltol=1e-10, maxit=5000, ngc=1000, nguess=100*maxcomp^2, msc=c("BIC","AIC","AICC","none"), mc.cores = setCores(,reprt=FALSE)) ## S4 method for signature 'dwiMixtensor,dwiMixtensor' dwiMtCombine(mtobj1, mtobj2, msc="BIC", where=NULL)
## S4 method for signature 'dtiData' dwiMixtensor(object, maxcomp=3, model=c("MT","MTiso","MTisoFA","MTisoEV"), fa=NULL, lambda=NULL, mask=NULL, reltol=1e-10, maxit=5000, ngc=1000, nguess=100*maxcomp^2, msc=c("BIC","AIC","AICC","none"), mc.cores = setCores(,reprt=FALSE)) ## S4 method for signature 'dwiMixtensor,dwiMixtensor' dwiMtCombine(mtobj1, mtobj2, msc="BIC", where=NULL)
object |
Object of class |
maxcomp |
Maximal number of mixture components. |
model |
Specifies the mixture model used. |
fa |
Value for FA in case of |
lambda |
Value for first eigenvalue in case of |
mask |
Brain mask |
reltol |
Relative tolerance for R's optim() function. |
maxit |
Maximal number of iterations in R's optim() function. |
ngc |
provide information on number of voxel processed, elapsed time and estimated remaining time after |
nguess |
number of guesses in search for initial estimates |
msc |
Criterion used to select the order of the mixture model, either
|
mtobj1 |
For method |
where |
Mask of voxel for which |
mtobj2 |
For method |
mc.cores |
Number of cores to use. Defaults to number of threads specified for openMP, see documentation of package awsMethods. Our experience suggests to use 4-6 cores if available. |
For model=="MT"
the function estimates, in each voxel, a mixture of radial symmetric (prolate) tensors from the DWI data contained in an object of class "dtiData"
. The number of mixture components is selected depending on the data, with a maximum number of components specified by maxcomp
. Optimization is performed usin R's internal BFGS code with mixture weights (volumes of compartments
corresponding to a tensor component) computed using the Lawson-Hannson NNLS code. model=="MT"
is only available for single shell data.
In case of model=="MTiso"
the model additionally contains an isotropic compartment. Optimization uses the internal L-BFGS-B code.
model=="MTisoFA"
and model=="MTisoEV"
fix FA and eigenvalues
of the prolate tensors, respectively, in the tensor mixture model with isotropic compartment.
The method "dwiMtCombine"
enables to combine results obtained for the same
dwi data set with different specifications, e.g. for maximum number of components
mcomp
and settings that influence initial estimates. The combined result
contains in each voxel the best result from both reconstructions with respect to
the specified model selection criterion msc
.
An object of class "dwiMixtensor"
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
Jian et al. (2007), A novel tensor distribution model for the diffusion-weighted MR signal, NeuroImage 37, 164–176.
J. Polzehl, K. Tabelow (2019). Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R. Springer, Use R! series. Doi:10.1007/978-3-030-29184-6.
dtiData
,
readDWIdata
,
medinria
,
dtiData
,
dwiMixtensor
## Not run: demo(mixtens_art)
## Not run: demo(mixtens_art)
The method estimates, in each voxel, the coefficients of an expansion of the apparent diffusion cefficient (ADC) with respect to a apherical harmonics orthonormal system from the DWI data contained in an object of class "dtiData"
.
## S4 method for signature 'dtiData' dwiQball(object, what="wODF", order=4, lambda=0, mask=NULL)
## S4 method for signature 'dtiData' dwiQball(object, what="wODF", order=4, lambda=0, mask=NULL)
object |
Object of class |
what |
Determines quantity to estimate, coefficients ot the orientation density function (ODF) ( |
order |
even integer: maximum order of the sperical harmonics expansion |
lambda |
nonnegative regularization parameter. |
mask |
optional brain mask |
An object of class "dwiQball"
.
Returns a warning.
Estimate, in each voxel, the coefficients of an expansion of the orientation density function (ODF) or the apparent diffusion coefficient (ADC) with respect to a apherical harmonics orthonormal system. Note that the maxima of the ADC have no direct interpretation as fibre orientations.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
M. Descoteaux, E. Angelino, S. Fitzgibbons and R. Deriche, Regularized, Fast and Robust Analytical Q-Ball Imaging, Magnetic Resonance Methods, 2007, 58, 497-512.
J. Polzehl, K. Tabelow (2019). Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R. Springer, Use R! series. Doi:10.1007/978-3-030-29184-6.
dtiData
,
readDWIdata
,
dtiIndices-methods
,
medinria
,
dtiData
,
dtiTensor
## Not run: demo(dti_art)
## Not run: demo(dti_art)
Correction for Rician Bias assuming known variance parameter
## S4 method for signature 'dtiData' dwiRiceBias(object, sigma=NULL, ncoils=1)
## S4 method for signature 'dtiData' dwiRiceBias(object, sigma=NULL, ncoils=1)
object |
Object of class |
sigma |
Scale parameter that relates the distribution of the signal to a
|
ncoils |
number of effective coils in parallel imaging, the related |
An object of class "dtiData"
.
Returns a warning.
Returns a dtiData
object with bias-corrected image intensities.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiData
,
dtiTensor-methods
,
dwiMixtensor-methods
,
dtiData
,
dtiTensor
,
dwiMixtensor
,
Compute a positive definite estimate of the Ensemble Average Propagator (EAP) and Orientation Density Function (ODF) using the approach of Cjeng et. al (2012).
## S4 method for signature 'dtiData' dwiSqrtODF(object,what="sqrtODF",order=4,forder=1,lambda=0,D0=1.4e-3)
## S4 method for signature 'dtiData' dwiSqrtODF(object,what="sqrtODF",order=4,forder=1,lambda=0,D0=1.4e-3)
object |
Object of class |
what |
Character, currently only "sqrtODF" is possible |
order |
Even integer, Order of spherical harmonics approximation. |
forder |
Integer, Order of radial approximation. |
lambda |
Non-negative, Regularization parameter. |
D0 |
Numeric vector, grid of diffusivity parameters, typically about 1e-3. |
signature(object = "ANY")
Returns a warning.
signature(object = "dtiData")
Compute a positive definite estimate of the Ensemble Average Propagator (EAP) and Orientation Density Function (ODF) using the approach of Cjeng et. al (2012).
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
J. Cheng, T. Jiang and R. Deriche. Nonnegative Definite EAP and ODF Estimation via a Unified Multi-Shell HARDI Reconstruction, MICCAI 2012.
dtiData
,
readDWIdata
,
dtiData
,
dwiQball
The methods extract and/or compute specified statistics from object of class "dtiData"
, "dtiTensor"
, and "dtiIndices"
. This can be restricted to a subset of voxel.
## S4 method for signature 'dtiData' extract(x, what=c("data","gradient","btb","s0","sb","siq"), xind=TRUE, yind=TRUE, zind=TRUE) ## S4 method for signature 'dtiTensor' extract(x, what=c("tensor", "fa", "ga", "md", "evalues", "andir", "s0", "mask", "bic", "aic", "outlier"), xind=TRUE, yind=TRUE, zind=TRUE, mc.cores = setCores(, reprt = FALSE)) ## S4 method for signature 'dwiMixtensor' extract(x, what=c("w0","andir", "order", "ev", "mix", "s0", "mask", "fa", "eorder", "bic", "aic"), xind=TRUE, yind=TRUE, zind=TRUE) ## S4 method for signature 'dtiIndices' extract(x, what=c("fa", "andir", "ga", "md", "bary"), xind=TRUE, yind=TRUE, zind=TRUE) ## S4 method for signature 'dwiQball' extract(x, what=c("sphcoef", "s0", "mask", "bic", "aic", "outlier"), xind=TRUE, yind=TRUE, zind=TRUE) ## S4 method for signature 'dtiData' x[i, j, k, drop=FALSE] ## S4 method for signature 'dtiTensor' x[i, j, k, drop=FALSE] ## S4 method for signature 'dtiIndices' x[i, j, k, drop=FALSE] ## S4 method for signature 'dkiTensor' x[i, j, k, drop=FALSE] ## S4 method for signature 'dkiIndices' x[i, j, k, drop=FALSE] ## S4 method for signature 'dwiQball' x[i, j, k, drop=FALSE]
## S4 method for signature 'dtiData' extract(x, what=c("data","gradient","btb","s0","sb","siq"), xind=TRUE, yind=TRUE, zind=TRUE) ## S4 method for signature 'dtiTensor' extract(x, what=c("tensor", "fa", "ga", "md", "evalues", "andir", "s0", "mask", "bic", "aic", "outlier"), xind=TRUE, yind=TRUE, zind=TRUE, mc.cores = setCores(, reprt = FALSE)) ## S4 method for signature 'dwiMixtensor' extract(x, what=c("w0","andir", "order", "ev", "mix", "s0", "mask", "fa", "eorder", "bic", "aic"), xind=TRUE, yind=TRUE, zind=TRUE) ## S4 method for signature 'dtiIndices' extract(x, what=c("fa", "andir", "ga", "md", "bary"), xind=TRUE, yind=TRUE, zind=TRUE) ## S4 method for signature 'dwiQball' extract(x, what=c("sphcoef", "s0", "mask", "bic", "aic", "outlier"), xind=TRUE, yind=TRUE, zind=TRUE) ## S4 method for signature 'dtiData' x[i, j, k, drop=FALSE] ## S4 method for signature 'dtiTensor' x[i, j, k, drop=FALSE] ## S4 method for signature 'dtiIndices' x[i, j, k, drop=FALSE] ## S4 method for signature 'dkiTensor' x[i, j, k, drop=FALSE] ## S4 method for signature 'dkiIndices' x[i, j, k, drop=FALSE] ## S4 method for signature 'dwiQball' x[i, j, k, drop=FALSE]
x |
Object of class |
i |
vector of x-coordinates, defaults to whole range. |
j |
vector of y-coordinates, defaults to whole range. |
k |
vector of z-coordinates, defaults to whole range. |
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. |
what |
Statistic to extract. See Methods Section for details. |
drop |
unused. |
mc.cores |
Number of cores to use. Defaults to number of threads specified for openMP, see documentation of package awsMethods. Our experience suggests to use 4-6 cores if available. |
For function extract
a list with components carrying the names of the options specified in
argument what
. For "["
the cutted object.
The generic extract function "["
does what it is expected to do: it extracts parts of
the object specified by i
, j
, and k
.
Returns a warning for extract
. Generic funtion for "["
returns an object of same class with data clipped to the indices specified in arguments i
,
j
and k
.
Extraction of squared gradient matrix "btb"
or of S0 "s0"
,
Sb "sb"
, Si/mean(SO) "siq"
or all images "data"
restricted to the cube
defined by arguments i
, j
and k
.
Returns an array containing the specified statistics, i.e.
fractional anisotropy "fa"
, geodesic anisotropy "ga"
, mean diffusivity "md"
,
main direction of anisotropy "andir"
and/or shape parameters "bary"
,
as specified in argument what
. Information is extracted for voxel within the
cube defined by xind
, yind
, and zind
.
Returns a list with component names corresponding to what
containing the specified statistics, i.e. fractional anisotropy "fa"
,
geodesic anisotropy "ga"
, mean diffusivity "md"
, eigenvalues "evalues"
,
main direction of anisotropy "andir"
, the tensor "tensor"
the estimated S0 image "s0"
, the values of the model selection criteia
BIC "bic"
or AIC "aic"
and/or the mask used to restrict computations
"mask"
, as specified in argument what
. Information is extracted
for voxel within the cube defined by arguments xind
, yind
and zind
.
Returns a list with component names corresponding to
what
containing the specified statistics. Possible values for what
are
"w0"
(size of isotropic department), "order"
(estimated number of mixture components),
"eorder"
effective order), "ev"
(eigenvalues), "mix"
(mixture weights),
"andir"
(main directions of diffusion), "fa"
(FA index), "s0"
(the estimated S0 image), the values of the model selection criteia BIC "bic"
or AIC "aic"
and mask
(the mask used to restrict computations).
Information is extracted for voxel within the cube defined by arguments xind
,
yind
and zind
.
Returns an array containing the specified statistics,
the estimated coefficients with respect to the selected spherical harmonics basis
"sphcoef"
, the estimated S0 image "s0"
, the values of the model selection
criteia BIC "bic"
or AIC "aic"
and/or the mask used to restrict computations
"mask"
, as specified in argument what
. Information is extracted for voxel
within the cube defined by arguments xind
, yind
and zind
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiData
,
dtiTensor
,
dtiIndices
dwiMixtensor
,
dwiQball
Create a mask containing voxel inside the head
## S4 method for signature 'dtiData' getmask(object, level = NULL, prop = 0.4, size = 3)
## S4 method for signature 'dtiData' getmask(object, level = NULL, prop = 0.4, size = 3)
object |
an object of class |
level |
S0 intensity value to be used to discriminate between
voxel inside and outside the brain. A good value of level may be determined
using method |
prop |
proportion of voxel in test area with s0 value larger than level needed to decide for a voxel inside the brain |
size |
size of a cube defining a test area |
The function returns an object of class dtiData
.
Returns a warning
Create a mask containing voxel inside the head
Create a mask containing voxel inside the head
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiData
,
readDWIdata
,
dti.smooth
,
sdpar
Estimate the noise standard deviation. Uses an assumption that the standard deviation
is a linear function of the expected mean for image intensities. qA0
and qA1
define quantiles of observed image intensities that define the range of values where this assumption is made.
## S4 method for signature 'dtiData' getsdofsb(object,qA0=.1,qA1=.98,nsb=NULL,level=NULL)
## S4 method for signature 'dtiData' getsdofsb(object,qA0=.1,qA1=.98,nsb=NULL,level=NULL)
object |
Object of class |
qA0 |
level for lower quantile of image intensities |
qA1 |
level for upper quantile of image intensities |
nsb |
number of diffusion weighted image to use |
level |
level for mask |
An object of class "dtiData"
with results in slot sdcoef
in components
5
: intercept parameter, 6
: slope parameter for linear model,
7
: lower bound (depending on qA0
) and 8
: upper bound (depending on qA1
).
signature(object) = "ANY"
Returns a warning.
signature(object) = "dtiData"
Returns a dtiData
object with estimated standard deviation parameters in
slot sdcoef
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiData
,
dwi.smooth-methods
,
dtiData
,
Read/Write diffusion tensor data from/to NIfTI file. Interface functions to MedINRIA.
medinria2tensor(filename) tensor2medinria(obj, filename, xind = NULL, yind = NULL, zind = NULL)
medinria2tensor(filename) tensor2medinria(obj, filename, xind = NULL, yind = NULL, zind = NULL)
filename |
file name for the tensor data. |
obj |
object of class |
xind |
index to define a subcube in x-direction. If |
yind |
index to define a subcube in y-direction. If |
zind |
index to define a subcube in z-direction. If |
For function medinria2tensor
: object of class "dtiTensor"
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
P. Fillard, J. Souplet and N. Toussaint Medical Image Navigation and Research Tool by INRIA (MedINRIA), INRIA Sophia Antipolis - Research Project ASCLEPIOS 2007
https://www-sop.inria.fr/asclepios/software/MedINRIA/
dtiTensor
,
dtiTensor-methods
dtiIndices-methods
## Not run: demo(dti_art)
## Not run: demo(dti_art)
List containing gradient directions minimizing Coulomb forces on the sphere following a proposal by D. Jones (1999) for number of gradients between 6 and 162.
Optimal gradient directions minimizing symmetrized Coulomb forces on the sphere following a proposal by Jones et al. (1999). These directions define an optimal design in DWI for given number of gradients.
optgrad
optgrad
a list with name optgrad and component ngrad-5 containing a matrix with ngrad gradients as columns.
Visualization of objects of class "dtiData"
, "dtiIndices"
, "dtiTensor"
and class "dwiMixtensor"
## S4 method for signature 'dtiData' plot(x, y, slice=1, gradient=NULL, view= "axial", show=TRUE, density=FALSE, xind=NULL, yind=NULL, zind=NULL, mar=par("mar"), mgp=par("mgp"), ...) ## S4 method for signature 'dtiTensor' plot(x, y, slice=1, view="axial", quant=0, minfa=NULL, contrast.enh=1, what="fa", qrange=c(.01,.99), xind=NULL, yind=NULL, zind=NULL, mar=par("mar"), mgp=par("mgp"), ...) ## S4 method for signature 'dwiMixtensor' plot(x, y, slice=1, view="axial", what="fa", minfa=NULL, identify=FALSE, xind=NULL, yind=NULL, zind=NULL, mar=par("mar"), mgp=par("mgp"), ...) ## S4 method for signature 'dtiIndices' plot(x, y, slice=1, view= "axial", method=1, quant=0, minfa=NULL, show=TRUE, identify=FALSE, density=FALSE, contrast.enh=1, what="fa", xind=NULL, yind=NULL, zind=NULL, mar=par("mar"), mgp=par("mgp"), ...) ## S4 method for signature 'dwiFiber' plot(x, y, ...) ## S4 method for signature 'dkiIndices' plot(x, y, slice=1, what=c("md", "fa", "mk", "mk2", "k1", "k2", "k3", "kaxial", "kradial", "fak"), xind=NULL, yind=NULL, mar=par("mar"), mgp=par("mgp"), ...)
## S4 method for signature 'dtiData' plot(x, y, slice=1, gradient=NULL, view= "axial", show=TRUE, density=FALSE, xind=NULL, yind=NULL, zind=NULL, mar=par("mar"), mgp=par("mgp"), ...) ## S4 method for signature 'dtiTensor' plot(x, y, slice=1, view="axial", quant=0, minfa=NULL, contrast.enh=1, what="fa", qrange=c(.01,.99), xind=NULL, yind=NULL, zind=NULL, mar=par("mar"), mgp=par("mgp"), ...) ## S4 method for signature 'dwiMixtensor' plot(x, y, slice=1, view="axial", what="fa", minfa=NULL, identify=FALSE, xind=NULL, yind=NULL, zind=NULL, mar=par("mar"), mgp=par("mgp"), ...) ## S4 method for signature 'dtiIndices' plot(x, y, slice=1, view= "axial", method=1, quant=0, minfa=NULL, show=TRUE, identify=FALSE, density=FALSE, contrast.enh=1, what="fa", xind=NULL, yind=NULL, zind=NULL, mar=par("mar"), mgp=par("mgp"), ...) ## S4 method for signature 'dwiFiber' plot(x, y, ...) ## S4 method for signature 'dkiIndices' plot(x, y, slice=1, what=c("md", "fa", "mk", "mk2", "k1", "k2", "k3", "kaxial", "kradial", "fak"), xind=NULL, yind=NULL, mar=par("mar"), mgp=par("mgp"), ...)
x |
Object of class |
y |
Not used |
slice |
Slice number |
view |
Choose |
gradient |
Index of data cube to plot. Defaults to the first S0 image. |
method |
Method for color coding tensor indices. |
quant |
If |
minfa |
Display only information for voxel with |
show |
Visualize information in a graphics device (for classes |
identify |
Enable identification of coordinates by mouse actions, logical with default FALSE. Uses function |
density |
Show density of S0(Sb)-values (for class |
contrast.enh |
Enhance image contrast using |
what |
In case of class |
mar |
Graphical parameter for |
mgp |
Graphical parameter for |
qrange |
Cut image intensity to these quantiles to avoid that outliers determine the dynamic range of the image. |
xind |
If provided restrict display to indices specified in |
yind |
If provided restrict display to indices specified in |
zind |
If provided restrict display to indices specified in |
... |
currently not used |
Generic function: see plot
.
Returns a warning.
gradient
can be used to specify a specific data cube associated with the index of a gradient direction. For objects of class "dtiData"
images are produces that are scaled by the maximal observed image value. This guarantees that subsequently produced images are on a comparable grey scale. The resulting image of class "adimpro"
from package adimpro is returned.
Color coded anisotropy maps are produced depending on the specification in method
. method==1
, method==2
, method==4
and method==5
specify three different color schemes for directional FA-maps. method==6
uses colored FA maps based on scheme developed at Uni Muenster (M. Deppe, Germany). method==3
specifies visualization of dtiIndices using color coded shape parameters. If identify==FALSE
the resulting image of class "adimpro"
from package adimpro, otherwise a matrix with coordinates of identified voxel is returned.
The tensor itself, fractional anisotropy (FA), mean diffusivity (MD) and a color coded anisotropy map are provided. NULL
is returned.
Depending of what
images of FA (what="fa"
), number of mixture components (what="order"
), effective order (what="eorder"
) or maximum eigenvalues (what="ev"
). is returned.
Creates a density plot of fiber lengths. NULL
is returned.
Prelimanary function to plot a slice of diffusion kurtosis indices: Mean Kurtosis what="mk"
or what="mk2"
, mean diffusivity what="md"
, fractional anisotropy what="fa"
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiIndices
,
dtiData
,
dtiTensor
dwiMixtensor
## Not run: demo(dti_art)
## Not run: demo(dti_art)
icosa0 - icosa4 provide a description of regular polyeders derived from the Icosahedron (icosa0) by sequential triangulation of surface triangles
icosa0
icosa0
a list with components
vertices - array of dimension c(3,nv)
. containing cartesian coordinate of the nv
vertices.
indices - Indices of vertices that define surface triangles of the polyeder.
edges - Indices of vertices that define edges of the polyeder.
nv - number of vertices
ne - number of edges
ni - number of triangles
The function provides information on data dimensions, data source and existing slot-names for objects of class "dti"
, "dtiData"
,
"dtiTensor"
, "dtiIndices"
, "dkiIndices"
, "dkiTensor"
, "dwiMixtensor"
, "dwiQball"
and "dwiFiber"
.
## S4 method for signature 'dwi' print(x)
## S4 method for signature 'dwi' print(x)
x |
Object of class |
Generic function: see print
.
The function provides information on data dimensions, data source and existing slot-names for objects of class "dwi"
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiIndices
,
dtiData
,
dtiTensor
dwiMixtensor
dwiQball
dwiFiber
The functions create a "dtiData"
object from Diffusion Weighted Data from medicial imaging files in a list of directories or from an imagefile, where the diffusion weighted data is given as 2-byte integer.
dtiData(gradient, imagefile, ddim, bvalue = NULL, xind = NULL, yind = NULL, zind = NULL, level = 0, mins0value = 1, maxvalue = 32000, voxelext = c(1, 1, 1), orientation = c(0L, 2L, 5L), rotation = diag(3)) readDWIdata(gradient, dirlist, format = c("DICOM", "NIFTI", "ANALYZE", "AFNI"), nslice = NULL, order = NULL, bvalue = NULL, xind = NULL, yind = NULL, zind = NULL, level = 0, mins0value = 1, maxvalue = 32000, voxelext = NULL, orientation = c(0L, 2L, 5L), rotation = NULL, pattern = NULL, SPM2=TRUE, verbose = FALSE)
dtiData(gradient, imagefile, ddim, bvalue = NULL, xind = NULL, yind = NULL, zind = NULL, level = 0, mins0value = 1, maxvalue = 32000, voxelext = c(1, 1, 1), orientation = c(0L, 2L, 5L), rotation = diag(3)) readDWIdata(gradient, dirlist, format = c("DICOM", "NIFTI", "ANALYZE", "AFNI"), nslice = NULL, order = NULL, bvalue = NULL, xind = NULL, yind = NULL, zind = NULL, level = 0, mins0value = 1, maxvalue = 32000, voxelext = NULL, orientation = c(0L, 2L, 5L), rotation = NULL, pattern = NULL, SPM2=TRUE, verbose = FALSE)
gradient |
matrix of diffusion gradients (including zero gradients for S0 images) |
imagefile |
name of data image file (binary 2Byte integers) |
ddim |
dimension of image cube (3D) |
dirlist |
list of directories containing the data files or name of a single data file (e.g. 4D NIFTI) |
format |
string specifying the medical imaging format, one of ”DICOM”, ”NIFTI”, ”ANALYZE”, or ”AFNI” |
nslice |
number of slices (usually z-direction) |
order |
vector, specifying a different order of the data files, i.e. other than alphabetic order in the directories given by |
bvalue |
vector of b-values (default 0 for S0 and 1 for Si) |
xind |
subindex for x-direction |
yind |
subindex for y-direction |
zind |
subindex for z-direction |
level |
determine |
mins0value |
set voxel in S0-images with values less than |
maxvalue |
set voxel with values larger than |
voxelext |
voxel extensions in coordinate directions |
orientation |
orientations of data as coded in AFNI |
rotation |
optional rotation matrix for the coordinate system. |
pattern |
pattern for file matching in the directories |
SPM2 |
Enable some non-standard NIfTI files produced by SPM to be readable. |
verbose |
some progress reports if TRUE |
The function dtiData
creates an object of class "dtiData"
from an image file, where the diffusion weighted data is given as 2-byte integer. This image file has to be prepared by the user. Use writeBin
to write out first all S0 images and than all Si images. The gradient
should be created according to this order. Run the demo in order to have an example, how to do this!
The function readDWIdata
reads the data files given in the directories in dirlist
in alphabetic order. The order can be changed using the order
argument: If filelist
is the vector of files in alphabetic order, they are read in the order filelist[order]
. If order is not given order <- 1:n
is used (no change!). The medical imaging format is given by format
and can be one of ”DICOM”, ”NIFTI”, ”ANALYZE”, or ”AFNI”. The number of slices of the three dimensional data cube is given by nslice
. The diffusion gradients are provided as matrix gradient
.
xind
, yind
, and zind
define a region of interest as indices. If not given 1:dim[i]
is used. level
determine mins0value
as quantile of positive S0-values. mins0value
sets voxel in S0-images with values less than level
“inactive”. maxvalue
sets voxel with values larger than maxvalue
inactive.
voxelext
defines the voxel extension, overwrites the values found in the imaging files. orientation
codes the data orientation in AFNI notation.
An object of class "dtiData"
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
J. Polzehl, K. Tabelow (2019). Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R. Springer, Use R! series. Doi:10.1007/978-3-030-29184-6.
https://afni.nimh.nih.gov/pub/dist/src/README.attributes
dti.smooth
,
dtiTensor-methods
,
dtiData
## Not run: demo(dti_art)
## Not run: demo(dti_art)
This function estimates the parameters of a piecewise linear model for the dependence between error standard deviation and mean.
## S4 method for signature 'dtiData' sdpar(object,level=NULL,sdmethod="none",interactive=TRUE,threshfactor=1)
## S4 method for signature 'dtiData' sdpar(object,level=NULL,sdmethod="none",interactive=TRUE,threshfactor=1)
object |
An object of class |
level |
Suggested value for slot |
sdmethod |
Method for estimating voxelwise standard deviations if replicates of zero weighted images are available, can be set to |
interactive |
If |
threshfactor |
Factor for threshold-value selected if function is run in interactive mode. May be used to correct results if automatic threshold selection fails. |
The function returns an object of class dtiData
.
Returns a warning
Estimate parameters of a model for the dependence between error standard deviation and mean.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiData
,
readDWIdata
,
dti.smooth
,
dtiTensor
,
## Not run: demo(dti_art)
## Not run: demo(dti_art)
Read mask definition from NIfTI file and include it in dtiData object
## S4 method for signature 'dtiData' setmask(object, maskfile)
## S4 method for signature 'dtiData' setmask(object, maskfile)
object |
an object of class |
maskfile |
NIfTI file containing mask definition. Dimension need to be
compatible, i.e. either equal |
The function returns an object of class dtiData
.
Returns a warning
Set mask definition in dtiObject using information provided as NIfTI file as e.g. provided by fsl_bet
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
The function provides information on data dimensions, data source and existing slot-names for objects of class "dti"
, "dtiData"
,
"dtiTensor"
, "dwiMixtensor"
, "dtiIndices"
, "dwiQball"
or "dwiFiber"
## S4 method for signature 'dti' show(object)
## S4 method for signature 'dti' show(object)
object |
Object of class |
Generic function.
The function provides information on data dimensions, data source and existing slot-names for objects of class "dti"
and classes that extent "dti"
.
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiIndices
,
dtiData
,
dtiTensor
dwiMixtensor
dwiQball
dwiFiber
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.
## 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, delta=0, ...)
## 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, delta=0, ...)
obj |
An object of class |
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 ( |
box |
Logical, add a bounding box. |
title |
Either a character string specifying a title or a logical. If |
method |
|
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 |
maxangle |
argument for fibertracking |
level |
Radius of sphere used as support for ODF visualisation |
subdivide |
Level of subdivisions for meshing, level |
what |
For dtiTensor-objects either |
odfscale |
Determines visualisation of the Orientation density function (ODF). For |
lwd |
Linewidth for visualization of dtiIndices objects. |
index |
Eiter |
delta |
if |
... |
Additional parameters passed to function |
The function returns the number of the current rgl-device.
Returns a warning
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.
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
.
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.
Prelimenary show3d method for diffusion kurtosis tensors.
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.
Display and combine fibres generated by function tracking.
Displays can be closed using function rgl.close
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiIndices-methods
,
dti.smooth
,
dtiTensor
,
dtiIndices
## Not run: demo(dti_art)
## Not run: demo(dti_art)
Writes an image (type PNG) with the colqFA colorscale to disk.
showFAColorScale(filename = "FAcolorscale.png")
showFAColorScale(filename = "FAcolorscale.png")
filename |
Name of file to write. |
See Also colqFA
This function creates an object of class "dtiData" that containes only a subset, defined by an index vector, of the S0 and diffusion weighted images. This function may e.g. be used to separate information measured on different shells.
subsetg(x, ind)
subsetg(x, ind)
x |
Object of class |
ind |
Indexvector containing values between |
An object of class "dtiData".
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiData
,
readDWIdata
,
dtiData
,
combineDWIdata
The method provides summary information for objects of class "dti"
.
## S4 method for signature 'dwi' summary(object, ...)
## S4 method for signature 'dwi' summary(object, ...)
object |
Object of class |
... |
Additional arguments in |
Generic function: see summary
.
The function provides summary information for objects of class "dwi"
, "dtiData"
, "dtiTensor"
, "dwiMixtensor"
, "dtiIndices"
, "dkiIndices"
, "dkiTensor"
, "dwiQball"
and , "dwiFiber"
Karsten Tabelow [email protected]
J\"org Polzehl [email protected]
dtiIndices
, ]
dtiData
,
dtiTensor
dwiMixtensor
dwiQball
dwiFiber
The function provides fiber tracking of "dtiTensor"
, "dtiIndices"
, and "dwiMixtensor"
objects and
methods for fiber manipulations.
## S4 method for signature 'dtiTensor' tracking(obj, roix=NULL, roiy=NULL, roiz=NULL, mask=NULL, method="LINEPROP", minfa=0.3, maxangle=30, subsample = 1) ## S4 method for signature 'dtiIndices' tracking(obj, roix=NULL, roiy=NULL, roiz=NULL, mask=NULL, method="LINEPROP", minfa=0.3, maxangle=30, subsample = 1) ## S4 method for signature 'dwiMixtensor' tracking(obj, roix=NULL, roiy=NULL, roiz=NULL, mask=NULL, method="LINEPROP", minfa=0.3, maxangle=30, subsample = 1, mincompartsize = 0) ## S4 method for signature 'dwiFiber' selectFibers(obj, roix=NULL, roiy=NULL, roiz=NULL, mask=NULL, minlength=1) ## S4 method for signature 'dwiFiber' reduceFibers(obj, maxdist=1, ends=TRUE) ## S4 method for signature 'dwiFiber,dwiFiber' combineFibers(obj, obj2) ## S4 method for signature 'dwiFiber,dwiFiber' touchingFibers(obj, obj2, maxdist=1, combine=FALSE)
## S4 method for signature 'dtiTensor' tracking(obj, roix=NULL, roiy=NULL, roiz=NULL, mask=NULL, method="LINEPROP", minfa=0.3, maxangle=30, subsample = 1) ## S4 method for signature 'dtiIndices' tracking(obj, roix=NULL, roiy=NULL, roiz=NULL, mask=NULL, method="LINEPROP", minfa=0.3, maxangle=30, subsample = 1) ## S4 method for signature 'dwiMixtensor' tracking(obj, roix=NULL, roiy=NULL, roiz=NULL, mask=NULL, method="LINEPROP", minfa=0.3, maxangle=30, subsample = 1, mincompartsize = 0) ## S4 method for signature 'dwiFiber' selectFibers(obj, roix=NULL, roiy=NULL, roiz=NULL, mask=NULL, minlength=1) ## S4 method for signature 'dwiFiber' reduceFibers(obj, maxdist=1, ends=TRUE) ## S4 method for signature 'dwiFiber,dwiFiber' combineFibers(obj, obj2) ## S4 method for signature 'dwiFiber,dwiFiber' touchingFibers(obj, obj2, maxdist=1, combine=FALSE)
obj |
An object of class |
obj2 |
An object of class |
roix |
Indices defining the ROI in x direction. Currently min/max is used to define ROIx |
roiy |
Indices defining the ROI in y direction. Currently min/max is used to define ROIy |
roiz |
Indices defining the ROI in z direction. Currently min/max is used to define ROIz |
mask |
Mask defining seed points for tracking |
method |
Method for fibre tracking. "LINEPROP" is simple line propagation algorithm which is the default. |
minfa |
Minimal FA to follow the tracks. default 0.3 |
maxangle |
Maximal angle between fiber in adjacent voxels. default 30 degree. |
subsample |
Subsampling order of the data to get more dense fibre tracks. Note, that objects become very(!) large. |
minlength |
Minimal length of fibers to be selected. |
maxdist |
Maximal supremum distance between fibers in mm |
ends |
Logical: Use only endpoints of shorter fibers for distance (TRUE) or compute distances using full fiber-length (FALSE). Default (TRUE) removes more fibers and is significantly faster. |
mincompartsize |
Minimal size of a compartment in dwiMixtensor that will be used in fiber tracking. |
combine |
If |
The function returns an object of class dwiFiber
.
Fiber tracking is performed on the estimated vector field of principal diffusion direction using the method method
. Currently only line propagation is implemented. The resulting tracks can be visualized using function show3d
.
Fiber tracking is performed on the estimated vector field of principal diffusion direction using the method method
. Currently only line propagation is implemented. The resulting tracks can be visualized using function show3d
.
Fiber tracking is performed on the estimated vector fields of diffusion direction in the mixed tensor model using the method method
. Currently only line propagation is implemented. The resulting tracks can be visualized using function show3d
.
selectFibers
produces a dwiFiber-object containing all fibers that cross the region of interest and exceed a minimum length. reduceFibers
eliminates all fibers that are within a maximum supremum distance of maxdist
mm of a longer fiber. reduceFibers
allows to reduce the size of a dwiFiber-object considerably but is slow !
signature(obj1 = "dwiFiber", obj2 = "dwiFiber")
combineFibers
produces a dwiFiber-object containing all fibers that are in one of the supplied objects.
touchingFibers
takes all fibers from obj
that have
a minimum distance to a fiber in obj2
of less than maxdist
.
If combine=TRUE
these fibers are combined with the fibers from obj2
.
Karsten Tabelow [email protected], Joerg Polzehl [email protected]
J. Polzehl, K. Tabelow (2019). Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R. Springer, Use R! series. Doi:10.1007/978-3-030-29184-6.
dtiTensor
,dtiIndices
,dwiFiber
,
show3d
, summary
, print