Computes the diffusion kurtosis tensor element (with indexes i, j, k and l) based on the individual diffusion tensor components of a multicompartmental model.
Add noise of specified distribution to a 4D array.
Parameters:
volarray, shape (X,Y,Z,W)
Diffusion measurements in W directions at each (X,Y,Z) voxel
position.
snrfloat, optional
The desired signal-to-noise ratio. (See notes below.)
S0float, optional
Reference signal for specifying snr.
noise_typestring, optional
The distribution of noise added. Can be either ‘gaussian’ for Gaussian
distributed noise, ‘rician’ for Rice-distributed noise (default) or
‘rayleigh’ for a Rayleigh distribution.
rngnumpy.random.Generator class, optional
Numpy’s random generator for setting seed values when needed.
Returns:
volarray, same shape as vol
Volume with added noise.
Notes
SNR is defined here, following [1], as
S0/sigma, where sigma is the standard deviation of the two
Gaussian distributions forming the real and imaginary components of the
Rician noise distribution (see [2]).
Add noise of specified distribution to the signal from a single voxel.
Parameters:
signal1-d ndarray
The signal in the voxel.
snrfloat
The desired signal-to-noise ratio. (See notes below.)
If snr is None, return the signal as-is.
S0float
Reference signal for specifying snr.
noise_typestring, optional
The distribution of noise added. Can be either ‘gaussian’ for Gaussian
distributed noise, ‘rician’ for Rice-distributed noise (default) or
‘rayleigh’ for a Rayleigh distribution.
rngnumpy.random.Generator, optional
Random number generator for the noise. If None, uses NumPy’s default
random generator.
Returns:
signalarray, same shape as the input
Signal with added noise.
Notes
SNR is defined here, following [1], as
S0/sigma, where sigma is the standard deviation of the two
Gaussian distributions forming the real and imaginary components of the
Rician noise distribution (see [2]).
Table with information of b-values and gradient directions g.
Note that if gtab has a btens attribute, simulations will be performed
according to the given b-tensor B information.
S0double, optional
Strength of signal in the presence of no diffusion gradient (also
called the b=0 value).
evals(3,) ndarray, optional
Eigenvalues of the diffusion tensor. By default, values typical for
prolate white matter are used.
evecs(3, 3) ndarray, optional
Eigenvectors of the tensor. You can also think of this as a rotation
matrix that transforms the direction of the tensor. The eigenvectors
need to be column wise.
snrfloat, optional
Signal to noise ratio, assuming Rician noise. None implies no noise.
rngnumpy.random.Generator, optional
Random number generator for the noise. If None, uses NumPy’s default
random generator.
Returns:
S(N,) ndarray
Simulated signal:
S(b,g)=S_0e^(-bg^TRDR.Tg), if gtab.tens=None
S(B)=S_0e^(-B:D), if gtab.tens information is given
Table with information of b-values and gradient directions.
Note that if gtab has a btens attribute, simulations will be performed
according to the given b-tensor information.
mevalsarray (K, 3)
each tensor’s eigenvalues in each row
S0float, optional
Unweighted signal value (b0 signal).
anglesarray (K, 2) or (K, 3), optional
List of K tensor directions in polar angles (in degrees) or unit
vectors
fractionsarray-like, optional
Percentage of the contribution of each tensor. The sum of fractions
should be equal to 100%.
snrfloat, optional
Signal to noise ratio, assuming Rician noise. If set to None, no
noise is added.
rngnumpy.random.Generator, optional
Random number generator for the noise. If None, uses NumPy’s default
random generator.
eigenvalues of the diffusion tensor for each individual compartment
S0float, optional
Unweighted signal value (b0 signal).
anglesarray (K,2) or (K,3), optional
List of K tensor directions of the diffusion tensor of each compartment
in polar angles (in degrees) or unit vectors
fractionsfloat (K,), optional
Percentage of the contribution of each tensor. The sum of fractions
should be equal to 100%.
snrfloat, optional
Signal to noise ratio, assuming Rician noise. If set to None, no
noise is added.
Returns:
S(N,) ndarray
Simulated signal based on the DKI model.
dt(6,)
elements of the diffusion tensor.
kt(15,)
elements of the kurtosis tensor.
Notes
Simulations are based on multicompartmental models which assumes that
tissue is well described by impermeable diffusion compartments
characterized by their only diffusion tensor. Since simulations are based
on the DKI model, coefficients larger than the fourth order of the signal’s
taylor expansion approximation are neglected.
Computes the diffusion kurtosis tensor element (with indexes i, j, k
and l) based on the individual diffusion tensor components of a
multicompartmental model.
Parameters:
D_comps(K,3,3) ndarray
Diffusion tensors for all K individual compartment of the
multicompartmental model.
frac[float]
Percentage of the contribution of each tensor. The sum of fractions
should be equal to 100%.
ind_iint
Element’s index i (0 for x, 1 for y, 2 for z)
ind_jint
Element’s index j (0 for x, 1 for y, 2 for z)
ind_kint
Element’s index k (0 for x, 1 for y, 2 for z)
ind_l: int
Elements index l (0 for x, 1 for y, 2 for z)
DT(3,3) ndarray, optional
Voxel’s global diffusion tensor.
MDfloat, optional
Voxel’s global mean diffusivity.
Returns:
wijklfloat
kurtosis tensor element of index i, j, k, l
Notes
wijkl is calculated using equation 8 given in
[8].
Measurement positions in (x, y, z), either as a list or on a grid.
evals(3,)
Eigenvalues of diffusion tensor. By default, use values typical for
prolate white matter.
evecs(3, 3) ndarray
Eigenvectors of the tensor, written column-wise. You can also think
of these as the rotation matrix that determines the orientation of
the diffusion tensor.