kwneuro.io module¶
- class kwneuro.io.FslBvalResource(path_in)¶
Bases:
BvalResourceA b-value list that is saved to disk in the FSL text file format.
- Parameters:
path_in (
InitVar)
- is_loaded: ClassVar[bool] = False¶
Whether a resource corresponds to in-memory data, rather than for example on-disk data.
- load()¶
Load b-values into memory
- Return type:
- path_in: dataclasses.InitVar[pathlib.Path | str]¶
Path to the underlying bval txt file
- static save(bvals, path)¶
Save data to a path, creating a FslBvalResource.
- Parameters:
bvals (
BvalResource)
- Return type:
- class kwneuro.io.FslBvecResource(path_in)¶
Bases:
BvecResourceA b-vector list that is saved to disk in the FSL text file format.
- Parameters:
path_in (
InitVar)
- get()¶
Get the underlying array of b-vectors of shape (N,3)
- is_loaded: ClassVar[bool] = False¶
Whether a resource corresponds to in-memory data, rather than for example on-disk data.
- load()¶
Load b-vectors into memory
- Return type:
- path_in: dataclasses.InitVar[pathlib.Path | str]¶
Path to the underlying bvec txt file
- static save(bvecs, path)¶
Save data to a path, creating a FslBvecResource.
- Parameters:
bvecs (
BvecResource)
- Return type:
- class kwneuro.io.JsonResponseFunctionResource(path_in)¶
Bases:
ResponseFunctionResourceA response function that is saved to disk in a json file.
- Parameters:
path_in (
InitVar)
- get()¶
Get the underlying response function
- get_dipy_object()¶
Get the underlying response function in a format compatible with Dipy
- Return type:
AxSymShResponse
- is_loaded: ClassVar[bool] = False¶
Whether a resource corresponds to in-memory data, rather than for example on-disk data.
- load()¶
Load volume into memory
- Return type:
- path_in: dataclasses.InitVar[pathlib.Path | str]¶
Path to the underlying json file
- static save(response, path)¶
Save response function data to a path, creating a JsonResponseFunctionResource.
- Parameters:
response (
ResponseFunctionResource)
- Return type:
- class kwneuro.io.NiftiVolumeResource(path_in)¶
Bases:
VolumeResourceA volume or volume stack that is saved to disk in the nifti file format.
- Parameters:
path_in (
InitVar)
- get_affine()¶
Get the 4x4 affine matrix that maps index space to patient/scanner space
- get_array()¶
Get the underlying volume data array
- is_loaded: ClassVar[bool] = False¶
Whether a resource corresponds to in-memory data, rather than for example on-disk data.
- load()¶
Load volume into memory
- Return type:
- path_in: dataclasses.InitVar[pathlib.Path | str]¶
Path to the underlying volume nifti file
- static save(vol, path)¶
Save volume data to a path, creating a NiftiVolumeResource.
- Parameters:
vol (
VolumeResource)
- Return type: