Tools for using spherical harmonic models to fit diffusion data
Implementation of Constant Solid Angle reconstruction method.
References
[R7] | Aganj, I., et. al. 2009. ODF Reconstruction in Q-Ball Imaging With Solid Angle Consideration. |
Methods
cache_clear | |
cache_get | |
cache_set | |
fit |
Implementation of Orientation Probability Density Transform reconstruction method.
References
[R8] | Tristan-Vega, A., et. al. 2010. A new methodology for estimation of fiber populations in white matter of the brain with Funk-Radon transform. |
[R9] | Tristan-Vega, A., et. al. 2009. Estimation of fiber orientation probability density functions in high angular resolution diffusion imaging. |
Methods
cache_clear | |
cache_get | |
cache_set | |
fit |
Implementation of regularized Qball reconstruction method.
References
[R10] | Descoteaux, M., et. al. 2007. Regularized, fast, and robust analytical Q-ball imaging. |
Methods
cache_clear | |
cache_get | |
cache_set | |
fit |
Returns a residual bootstrap sample of the signal_object when indexed
Wraps a signal_object, this signal object can be an interpolator. When indexed, the the wrapper indexes the signal_object to get the signal. There wrapper than samples the residual boostrap distribution of signal and returns that sample.
Diffusion data fit to a spherical harmonic model
Methods
odf |
Samples the odf function on the points of a sphere
Parameters : | sphere : Sphere
|
---|---|
Returns : | values : ndarray
|
The base class to sub-classed by specific spherical harmonic models of diffusion data
Methods
cache_clear | |
cache_get | |
cache_set | |
fit |
Fits the model to diffusion data and returns the model fit
Applies the Residual Bootstraps to the data given H and R
data must be normalized, ie 0 < data <= 1
This function, and the bootstrap_data_voxel function, calculat residual-bootsrap samples given a Hat matrix and a Residual matrix. These samples can be used for non-parametric statistics or for bootstrap probabilistic tractography:
References
[R11] | J. I. Berman, et al., “Probabilistic streamline q-ball tractography using the residual bootstrap” 2008. |
[R12] | HA Haroon, et al., “Using the model-based residual bootstrap to quantify uncertainty in fiber orientations from Q-ball analysis” 2009. |
[R13] | B. Jeurissen, et al., “Probabilistic Fiber Tracking Using the Residual Bootstrap with Constrained Spherical Deconvolution” 2011. |
Like bootstrap_data_array but faster when for a single voxel
data must be 1d and normalized
Returns the hat matrix for the design matrix B
Produces a lazy index
Returns a slice that can be used for indexing an array, if no slice can be made index is returned as is.
Returns a matrix for computing leveraged, centered residuals from data
if r = (d-Hd), the leveraged centered residuals are lcr = (r/l)-mean(r/l) ruturns the matrix R, such lcr = Rd
Normalizes the data with respect to the mean b0
Return random integers from low (inclusive) to high (exclusive).
Return random integers from the “discrete uniform” distribution in the “half-open” interval [low, high). If high is None (the default), then results are from [0, low).
Parameters : | low : int
high : int, optional
size : int or tuple of ints, optional
|
---|---|
Returns : | out : int or ndarray of ints
|
See also
Examples
>>> np.random.randint(2, size=10)
array([1, 0, 0, 0, 1, 1, 0, 0, 1, 0])
>>> np.random.randint(1, size=10)
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
Generate a 2 x 4 array of ints between 0 and 4, inclusive:
>>> np.random.randint(5, size=(2, 4))
array([[4, 0, 2, 1],
[3, 2, 2, 0]])
Compute real spherical harmonics, where the real harmonic Y^m_n is defined to be:
Real(Y^m_n) * sqrt(2) if m > 0 Y^m_n if m == 0 Imag(Y^m_n) * sqrt(2) if m < 0
This may take scalar or array arguments. The inputs will be broadcasted against each other.
Parameters : | m : int |m| <= n
n : int >= 0
theta : float [0, 2*pi]
phi : float [0, pi]
|
---|---|
Returns : | y_mn : real float
|
See also
scipy.special.sph_harm
Compute real spherical harmonics as in fibernavigator, where the real harmonic Y^m_n is defined to be:
Imag(:math:`Y^m_n`) * sqrt(2) if m > 0
:math:`Y^m_n` if m == 0
Real(:math:`Y^|m|_n`) * sqrt(2) if m < 0
This may take scalar or array arguments. The inputs will be broadcasted against each other.
Parameters : | sh_order : int
theta : float [0, 2*pi]
phi : float [0, pi]
|
---|---|
Returns : | y_mn : real float
m : array
n : array
|
References
[R14] | (1, 2) http://code.google.com/p/fibernavigator/ |
Compute real spherical harmonics as in mrtrix, where the real harmonic Y^m_n is defined to be:
Real(:math:`Y^m_n`) if m > 0
:math:`Y^m_n` if m == 0
Imag(:math:`Y^|m|_n`) if m < 0
This may take scalar or array arguments. The inputs will be broadcasted against each other.
Parameters : | sh_order : int
theta : float [0, pi]
phi : float [0, 2*pi]
|
---|---|
Returns : | y_mn : real float
m : array
n : array
|
Spherical function to spherical harmonics (SH).
Parameters : | sf : ndarray
sphere : Sphere
sh_order : int, optional
basis_type : {None, ‘mrtrix’, ‘fibernav’}
smooth : float, optional
|
---|---|
Returns : | sh : ndarray
|
Spherical harmonics (SH) to spherical function (SF).
Parameters : | sh : ndarray
sphere : Sphere
sh_order : int, optional
basis_type : {None, ‘mrtrix’, ‘fibernav’}
|
---|---|
Returns : | sf : ndarray
|
Regularized psudo-inverse
Computes a regularized least square inverse of B
Parameters : | B : array_like (n, m)
L : array_like (n,) |
---|---|
Returns : | inv : ndarray (m, n)
|
Notes
In the literature this inverse is often written (B^{T}B+L^{2})^{-1}B^{T}. However here this inverse is implemented using the psudo-inverse because it is more numerically stable than the direct implementation of the matrix product.
Returns the degree (n) and order (m) of all the symmetric spherical harmonics of degree less then or equal it sh_order. The results, m_list and n_list are kx1 arrays, where k depends on sh_order. They can be passed to real_sph_harm.
Parameters : | sh_order : int
|
---|---|
Returns : | m_list : array
n_list : array
|
See also