Get metadata contained in a header field

header_value(img_data, field)

Arguments

img_data

Image data returned by e.g. read_dicom or read_nifti1

field

Field name

Value

Metadata for the field in an appropriate format for the data type

Examples

data(sample_dicom_img)
data(sample_nifti_img)
header_value(sample_dicom_img, "SliceLocation")
#> [1] 0 0 0
header_value(sample_nifti_img, "dim_")
#> [1]  3 64 64 10  0  0  0  0