kwneuro.dti =========== .. py:module:: kwneuro.dti Classes ------- .. autoapisummary:: kwneuro.dti.Dti Module Contents --------------- .. py:class:: Dti A diffusion tesnor image. .. py:attribute:: volume :type: kwneuro.resource.VolumeResource The DTI image volume. It is a 4D volume, with the first three dimensions being spatial and the final dimension indexing the lower triangular entries of a symmetric matrix, in dipy order (Dxx, Dxy, Dyy, Dxz, Dyz, Dzz). .. py:method:: load() -> Dti Load any on-disk resources into memory and return a DTI with all loadable resources loaded. .. py:method:: save(path: kwneuro.util.PathLike) -> Dti Save all resources to disk and return a Dti with all resources being on-disk. :param path: The desired file save location, a nifti file path. Returns: A Dti with its internal resources being on-disk. .. py:method:: estimate_from_dwi(dwi: kwneuro.dwi.Dwi, mask: kwneuro.resource.VolumeResource | None = None) -> Dti :staticmethod: Estimate a DTI from a DWI. :param dwi: The source DWI :param mask: Optionally, a boolean 3D volume that has indicates where the fit should take place, such as a brain mask. .. py:method:: get_eig() -> tuple[kwneuro.resource.VolumeResource, kwneuro.resource.VolumeResource] Get eigenvalues and eigenvectors of the diffusion tensors. Returns 3D volumes with the same spatial shape as the DTI. Returns eigenvalues (evals), eigenvectors (evecs). Each is returned as a VolumeResource. The evals have shape (H,W,D,3). The evecs have shape (H,W,D,9), where the final axis provides the three components of the eigenvector that goes with the first eigenvalue, followed by the three components of the eigenvector that goes with the second value, and so on for a total of 9 components. .. py:method:: get_fa_md() -> tuple[kwneuro.resource.VolumeResource, kwneuro.resource.VolumeResource] Get fractional anisotropy and mean diffusivity images. Returns 3D volumes for FA and MD, as VolumeResources.