fsl.data.dtifit
¶
This module provides the DTIFitTensor
class, which encapsulates
the diffusion tensor data generated by the FSL dtifit
tool.
There are also conversion tools between the diffusion tensors defined in 3 formats:
- (…, 3, 3) array with the full diffusion tensor
- (…, 6) array with the unique components (Dxx, Dxy, Dxz, Dyy, Dyz, Dzz)
- Tuple with the eigenvectors and eigenvalues (V1, V2, V3, L1, L2, L3)
Finally the following utility functions are also defined:
getDTIFitDataPrefix
Returns the prefix (a.k,a, base name) used for the dtifit
file names in the given directory, orNone
if thedtifit
files could not be identified.isDTIFitPath
Returns True
if the given directory path looks like it containsdtifit
data,False
otherwise.looksLikeTensorImage
Returns True
if the givenImage
looks like it could contain tensor matrix data,False
otherwise.decomposeTensorMatrix
Decomposes the given numpy
array into six separate arrays, containing the eigenvectors and eigenvalues of the tensor matrix decompositions.
-
fsl.data.dtifit.
eigendecompositionToTensor
(V1, V2, V3, L1, L2, L3)[source]¶ Converts the eigenvalues/eigenvectors into a 3x3 diffusion tensor
Parameters: - V1 – (…, 3) shaped array with the first eigenvector
- V2 – (…, 3) shaped array with the second eigenvector
- V3 – (…, 3) shaped array with the third eigenvector
- L1 – (…, ) shaped array with the first eigenvalue
- L2 – (…, ) shaped array with the second eigenvalue
- L3 – (…, ) shaped array with the third eigenvalue
Returns: (…, 3, 3) array with the diffusion tensor
-
fsl.data.dtifit.
tensorToEigendecomposition
(matrices)[source]¶ Decomposes the 3x3 diffusion tensor into eigenvalues and eigenvectors
Parameters: matrices – (…, 3, 3) array-like with diffusion tensor Returns: Tuple containing the eigenvectors and eigenvalues (V1, V2, V3, L1, L2, L3)
-
fsl.data.dtifit.
tensorToComponents
(matrices)[source]¶ Extracts the 6 unique components from a 3x3 diffusion tensor
Parameters: matrices – (…, 3, 3) array-like with diffusion tensors Returns: (…, 6) array with the unique components sorted like Dxx, Dxy, Dxz, Dyy, Dyz, Dzz
-
fsl.data.dtifit.
componentsToTensor
(components)[source]¶ Creates 3x3 diffusion tensors from the 6 unique components
Parameters: components – (…, 6) array-like with Dxx, Dxy, Dxz, Dyy, Dyz, Dzz Returns: (…, 3, 3) array with the diffusion tensors
-
fsl.data.dtifit.
eigendecompositionToComponents
(V1, V2, V3, L1, L2, L3)[source]¶ Converts the eigenvalues/eigenvectors into the 6 unique components of the diffusion tensor
Parameters: - V1 – (…, 3) shaped array with the first eigenvector
- V2 – (…, 3) shaped array with the second eigenvector
- V3 – (…, 3) shaped array with the third eigenvector
- L1 – (…, ) shaped array with the first eigenvalue
- L2 – (…, ) shaped array with the second eigenvalue
- L3 – (…, ) shaped array with the third eigenvalue
Returns: (…, 6) array with the unique components sorted like Dxx, Dxy, Dxz, Dyy, Dyz, Dzz
-
fsl.data.dtifit.
componentsToEigendecomposition
(components)[source]¶ Decomposes diffusion tensor defined by its 6 unique components
Parameters: components – (…, 6) array-like with Dxx, Dxy, Dxz, Dyy, Dyz, Dzz Returns: Tuple containing the eigenvectors and eigenvalues (V1, V2, V3, L1, L2, L3)
-
fsl.data.dtifit.
getDTIFitDataPrefix
(path)[source]¶ Returns the prefix (a.k,a, base name) used for the
dtifit
file names in the given directory, orNone
if thedtifit
files could not be identified.
-
fsl.data.dtifit.
isDTIFitPath
(path)[source]¶ Returns
True
if the given directory path looks like it containsdtifit
data,False
otherwise.
-
fsl.data.dtifit.
looksLikeTensorImage
(image)[source]¶ Returns
True
if the givenImage
looks like it could contain tensor matrix data,False
otherwise.
-
fsl.data.dtifit.
decomposeTensorMatrix
(data)[source]¶ Decomposes the given
numpy
array into six separate arrays, containing the eigenvectors and eigenvalues of the tensor matrix decompositions.Parameters: image – A 4D numpy
array with 6 volumes, which contains the unique elements of diffusion tensor matrices at every voxel.Returns: A tuple containing the principal eigenvectors and eigenvalues of the tensor matrix.
-
class
fsl.data.dtifit.
DTIFitTensor
(path)[source]¶ Bases:
fsl.data.image.Nifti
The
DTIFitTensor
class is able to load and encapsulate the diffusion tensor data generated by the FSLdtifit
tool. TheDtiFitTensor
class supports tensor model data generated bydtifit
, where the eigenvectors and eigenvalues of the tensor matrices have been saved as six separate NIFTI images.-
__module__
= 'fsl.data.dtifit'¶
-