get_n_slices
- bidsaid.metadata.get_n_slices(nifti_file_or_img, slice_axis=None, verbose=False)[source]
Gets the number of slices from the header of a NIfTI image.
Parameters
- nifti_file_or_img
str,Path, orNifti1Image Path to the NIfTI file or a NIfTI image.
- slice_axis
Literal["i", "j", "k"]orNone, default=None Axis the image slices were collected in. If None, determines the slice axis using metadata (“slice_end”) from the NIfTI header.
- verbose
bool, default=False Logs information.
Returns
- int
The number of slices.
- nifti_file_or_img