get_n_volumes

bidsaid.metadata.get_n_volumes(nifti_file_or_img)[source]

Get the number of volumes from a 4D NIftI image.

Parameters

nifti_file_or_imgstr, Path, or Nifti1Image

Path to the NIfTI file or a NIfTI image.

Returns

int

The number of volumes in img.