mcot.cifti.cifti¶
Functions
|
Stores the information from an axis in HDF5 group. |
|
Stores the information from an axis in HDF5 group. |
|
Find the common space of multiple BrainModel axes. |
|
Creates a new HDF5 group with an empty dataset. |
|
Creates a new zarr group with an empty dataset. |
|
Reads a CIFTI array from the HDF5 format. |
|
Guesses the extension based on the CIFTI axes. |
|
Store the CIFTI array in an HDF5 format. |
|
Writes a CIFTI file guessing the extension of the filename. |
axis_from_hdf5¶
axis_to_hdf5¶
combine¶
empty_hdf5¶
-
mcot.cifti.cifti.
empty_hdf5
(group: Union[h5py._hl.group.Group, zarr.hierarchy.Group], axes: Sequence[nibabel.cifti2.cifti2_axes.Axis], dtype=<class 'float'>, compression='gzip')[source]¶ Creates a new HDF5 group with an empty dataset.
- Parameters
group – HDF5 group
axes – sequence of axes (all have to be defined)
dtype – data type
compression – which compression to use on each chunk
- Returns
new array to be filled
empty_zarr¶
-
mcot.cifti.cifti.
empty_zarr
(group: Union[h5py._hl.group.Group, zarr.hierarchy.Group], axes: Sequence[nibabel.cifti2.cifti2_axes.Axis], dtype=<class 'float'>, compressor='default')[source]¶ Creates a new zarr group with an empty dataset.
- Parameters
group – zarr group
axes – sequence of axes (all have to be defined)
dtype – data type
compressor – which compressor to use on each chunk
- Returns
new array to be filled
from_hdf5¶
-
mcot.cifti.cifti.
from_hdf5
(group: Union[h5py._hl.group.Group, zarr.hierarchy.Group]) → Tuple[h5py._hl.dataset.Dataset, Sequence[nibabel.cifti2.cifti2_axes.Axis]][source]¶ Reads a CIFTI array from the HDF5 format.
- Parameters
group – HDF5 group the data was stored in
- Returns
tuple with data array (still on disk) and sequence of axes
guess_extension¶
to_hdf5¶
-
mcot.cifti.cifti.
to_hdf5
(group: Union[h5py._hl.group.Group, zarr.hierarchy.Group], arr, axes: Sequence[nibabel.cifti2.cifti2_axes.Axis], compression='gzip')[source]¶ Store the CIFTI array in an HDF5 format.
- Parameters
group – HDF5 group to store the data in (can be top-level HDF5 file)
arr – data array
axes – sequence of axes (optionally None)
compression – which compression to use on the main data array (None, ‘gzip’, or ‘lzf’)
write¶
-
mcot.cifti.cifti.
write
(filename: str, arr: numpy.ndarray, axes: Tuple[nibabel.cifti2.cifti2_axes.Axis])[source]¶ Writes a CIFTI file guessing the extension of the filename.
- Parameters
filename – full filename of basename
arr – array to be stored
axes – CIFTI axes describing the rows/columns of a CIFTI file