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:
Returns the prefix (a.k,a, base name) used for the
dtifitfile names in the given directory, orNoneif thedtifitfiles could not be identified.Returns
Trueif the given directory path looks like it containsdtifitdata,Falseotherwise.Returns
Trueif the givenImagelooks like it could contain tensor matrix data,Falseotherwise.Decomposes the given
numpyarray 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
dtifitfile names in the given directory, orNoneif thedtifitfiles could not be identified.
- fsl.data.dtifit.isDTIFitPath(path)[source]
Returns
Trueif the given directory path looks like it containsdtifitdata,Falseotherwise.
- fsl.data.dtifit.looksLikeTensorImage(image)[source]
Returns
Trueif the givenImagelooks like it could contain tensor matrix data,Falseotherwise.
- fsl.data.dtifit.decomposeTensorMatrix(data)[source]
Decomposes the given
numpyarray into six separate arrays, containing the eigenvectors and eigenvalues of the tensor matrix decompositions.- Parameters:
image – A 4D
numpyarray 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(*args, **kwargs)[source]
Bases:
NiftiThe
DTIFitTensorclass is able to load and encapsulate the diffusion tensor data generated by the FSLdtifittool. TheDtiFitTensorclass supports tensor model data generated bydtifit, where the eigenvectors and eigenvalues of the tensor matrices have been saved as six separate NIFTI images.- __annotations__ = {}
- __module__ = 'fsl.data.dtifit'