kwneuro.dti

Classes

Dti

A diffusion tesnor image.

Module Contents

class kwneuro.dti.Dti

A diffusion tesnor image.

volume: 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).

load() Dti

Load any on-disk resources into memory and return a DTI with all loadable resources loaded.

save(path: kwneuro.util.PathLike) Dti

Save all resources to disk and return a Dti with all resources being on-disk.

Parameters:

path – The desired file save location, a nifti file path.

Returns: A Dti with its internal resources being on-disk.

static estimate_from_dwi(dwi: kwneuro.dwi.Dwi, mask: kwneuro.resource.VolumeResource | None = None) Dti

Estimate a DTI from a DWI.

Parameters:
  • dwi – The source DWI

  • mask – Optionally, a boolean 3D volume that has indicates where the fit should take place, such as a brain mask.

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.

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.