kwneuro.util¶
Common utility functions
Attributes¶
Functions¶
|
Accepts a path as a string or Path object, expands the tilde (~), |
Creates an InMemoryVolumeResource from a numpy array of scalar estimates, |
|
|
Use the convenience of nibabel's header class to update volume metadata. |
|
Recursively compares two objects, including nested lists, tuples, |
Module Contents¶
- kwneuro.util.PathLike¶
- kwneuro.util.normalize_path(path_input: PathLike) pathlib.Path¶
Accepts a path as a string or Path object, expands the tilde (~), and returns a resolved, absolute Path object.
- kwneuro.util.create_estimate_volume_resource(array: numpy.typing.NDArray[Any], reference_volume: kwneuro.resource.VolumeResource, intent_name: str) kwneuro.resource.VolumeResource¶
Creates an InMemoryVolumeResource from a numpy array of scalar estimates, using the affine and metadata of a reference volume.
- kwneuro.util.update_volume_metadata(metadata: dict[str, Any], volume_data_array: numpy.ndarray, intent_code: int | str | None = None, intent_params: Any = (), intent_name: str = '') dict[str, Any]¶
Use the convenience of nibabel’s header class to update volume metadata. If intent_code is not provided then we don’t modify the intent parameters.