kwneuro.dwi =========== .. py:module:: kwneuro.dwi Classes ------- .. autoapisummary:: kwneuro.dwi.Dwi Module Contents --------------- .. py:class:: Dwi A diffusion weighted image. .. py:attribute:: volume :type: 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. .. py:attribute:: bval :type: kwneuro.resource.BvalResource The DWI b-values .. py:attribute:: bvec :type: kwneuro.resource.BvecResource The DWI b-vectors .. py:method:: load() -> Dwi Load any on-disk resources into memory and return a Dwi with all loadable resources loaded. .. py:method:: save(path: kwneuro.util.PathLike, basename: str) -> Dwi Save all resources to disk and return a Dwi with all resources being on-disk. :param path: The desired save directory. :param basename: The desired file basenames, i.e. without an extension. Returns: A Dwi with its internal resources being on-disk. .. py:method:: get_gtab() -> dipy.core.gradients.GradientTable Get the GradientTable for this DWI. .. py:method:: compute_mean_b0() -> kwneuro.resource.InMemoryVolumeResource Compute the mean of the b=0 images of a DWI. .. py:method:: concatenate(dwis: list[Dwi]) -> Dwi :staticmethod: Concatenate a list of ``Dwi``\s into a single (loaded) DWI. The affine and metadata of the first ``Dwi`` in the list will be used to concatenate volumes. .. py:method:: denoise() -> Dwi Denoise using Patch2Self from DIPY. .. py:method:: 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 :func:`kwneuro.masks.brain_extract_batch`. .. py:method:: estimate_dti(mask: kwneuro.resource.VolumeResource | None = None) -> kwneuro.dti.Dti Estimate diffusion tensor image from this DWI .. py:method:: 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 :meth:`kwneuro.noddi.Noddi.estimate_from_dwi` for details.