kwneuro.dwi

Classes

Dwi

A diffusion weighted image.

Module Contents

class kwneuro.dwi.Dwi

A diffusion weighted image.

volume: kwneuro.resource.VolumeResource

The DWI image volume. It is assumed to be a 4D volume, with the first three dimensions being spatial and the final dimension indexing the diffusion weightings.

bval: kwneuro.resource.BvalResource

The DWI b-values

bvec: kwneuro.resource.BvecResource

The DWI b-vectors

load() Dwi

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

save(path: kwneuro.util.PathLike, basename: str) Dwi

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

Parameters:
  • path – The desired save directory.

  • basename – The desired file basenames, i.e. without an extension.

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

get_gtab() dipy.core.gradients.GradientTable

Get the GradientTable for this DWI.

compute_mean_b0() kwneuro.resource.InMemoryVolumeResource

Compute the mean of the b=0 images of a DWI.

static concatenate(dwis: list[Dwi]) Dwi

Concatenate a list of Dwis into a single (loaded) DWI.

The affine and metadata of the first Dwi in the list will be used to concatenate volumes.

denoise() Dwi

Denoise using Patch2Self from DIPY.

extract_brain() kwneuro.resource.InMemoryVolumeResource

Extract brain mask. This is meant to be convenient rather than efficient. Using this in a loop could result in unnecessary repetition of file I/O operations. For efficiency, see kwneuro.masks.brain_extract_batch().

estimate_dti(mask: kwneuro.resource.VolumeResource | None = None) kwneuro.dti.Dti

Estimate diffusion tensor image from this DWI

estimate_noddi(mask: kwneuro.resource.VolumeResource | None = None, dpar: float = 0.0017, n_kernel_dirs: int = 500) kwneuro.noddi.Noddi

Estimate NODDI model parameters from this DWI. See kwneuro.noddi.Noddi.estimate_from_dwi() for details.