determine_slice_axis

bidsaid.metadata.determine_slice_axis(nifti_file_or_img=None, nifti_header=None)[source]

Determine the slice axis.

Uses “slice_end” plus one to determine the likely slice axis.

Parameters

nifti_file_or_imgstr, Path, or Nifti1Image, default=None

Path to the NIfTI file or a NIfTI image. Must be specified if nifti_header is None.

nifti_headerNifti1Header, default=None

Path to the NIfTI file or a NIfTI image. Must be specified if nifti_file_or_img is None.

Returns

int

A number representing the slice axis.