kwneuro.io

Classes

NiftiVolumeResource

A volume or volume stack that is saved to disk in the nifti file format.

FslBvalResource

A b-value list that is saved to disk in the FSL text file format.

FslBvecResource

A b-vector list that is saved to disk in the FSL text file format.

JsonResponseFunctionResource

A response function that is saved to disk in a json file.

Module Contents

class kwneuro.io.NiftiVolumeResource

Bases: kwneuro.resource.VolumeResource

A volume or volume stack that is saved to disk in the nifti file format.

is_loaded: ClassVar[bool] = False

Whether a resource corresponds to in-memory data, rather than for example on-disk data.

path_in: dataclasses.InitVar[kwneuro.util.PathLike]

Path to the underlying volume nifti file

path: pathlib.Path
load() kwneuro.resource.InMemoryVolumeResource

Load volume into memory

get_array() numpy.typing.NDArray[numpy.number]

Get the underlying volume data array

get_affine() numpy.typing.NDArray[numpy.floating]

Get the 4x4 affine matrix that maps index space to patient/scanner space

get_metadata() dict[str, Any]

Get the volume image metadata

static save(vol: kwneuro.resource.VolumeResource, path: kwneuro.util.PathLike) NiftiVolumeResource

Save volume data to a path, creating a NiftiVolumeResource.

class kwneuro.io.FslBvalResource

Bases: kwneuro.resource.BvalResource

A b-value list that is saved to disk in the FSL text file format.

is_loaded: ClassVar[bool] = False

Whether a resource corresponds to in-memory data, rather than for example on-disk data.

path_in: dataclasses.InitVar[kwneuro.util.PathLike]

Path to the underlying bval txt file

path: pathlib.Path
load() kwneuro.resource.InMemoryBvalResource

Load b-values into memory

get() numpy.typing.NDArray[numpy.floating]

Get the underlying array of b-values

static save(bvals: kwneuro.resource.BvalResource, path: kwneuro.util.PathLike) FslBvalResource

Save data to a path, creating a FslBvalResource.

class kwneuro.io.FslBvecResource

Bases: kwneuro.resource.BvecResource

A b-vector list that is saved to disk in the FSL text file format.

is_loaded: ClassVar[bool] = False

Whether a resource corresponds to in-memory data, rather than for example on-disk data.

path_in: dataclasses.InitVar[kwneuro.util.PathLike]

Path to the underlying bvec txt file

path: pathlib.Path
load() kwneuro.resource.InMemoryBvecResource

Load b-vectors into memory

get() numpy.typing.NDArray[numpy.floating]

Get the underlying array of b-vectors of shape (N,3)

static save(bvecs: kwneuro.resource.BvecResource, path: kwneuro.util.PathLike) FslBvecResource

Save data to a path, creating a FslBvecResource.

class kwneuro.io.JsonResponseFunctionResource

Bases: kwneuro.resource.ResponseFunctionResource

A response function that is saved to disk in a json file.

is_loaded: ClassVar[bool] = False

Whether a resource corresponds to in-memory data, rather than for example on-disk data.

path_in: dataclasses.InitVar[kwneuro.util.PathLike]

Path to the underlying json file

path: pathlib.Path
get() tuple[numpy.typing.NDArray, numpy.floating]

Get the underlying response function

get_dipy_object() dipy.reconst.csdeconv.AxSymShResponse

Get the underlying response function in a format compatible with Dipy

load() kwneuro.resource.InMemoryResponseFunctionResource

Load volume into memory

static save(response: kwneuro.resource.ResponseFunctionResource, path: kwneuro.util.PathLike) JsonResponseFunctionResource

Save response function data to a path, creating a JsonResponseFunctionResource.