Get the dimensions of an image

img_dimensions(img_data)

Arguments

img_data

Image data returned by e.g. read_dicom or read_nifti1

Value

Image dimensions, or NA if image has no slices

Examples

data(sample_dicom_img)
data(sample_nifti_img)
img_dimensions(sample_dicom_img)
#> Warning: ImagePositionPatient is moving in more than one dimension.
#> [1] 256 256   3
img_dimensions(sample_nifti_img)
#> [1] 64 64 10