Get the number of image slices in an image series

num_slices(img_data)

Arguments

img_data

Image data returned by e.g. read_dicom or read_nifti1

Value

Number of slices

Examples

data(sample_dicom_img)
data(sample_nifti_img)
num_slices(sample_dicom_img)
#> [1] 3
num_slices(sample_nifti_img)
#> [1] 10