After loading a NIFTI (.nii) image (using Nibabel) with the code scan = nibabel.load(filepath)
, it is useful to display the image header information via scan.header
.
If you call scan.get_fdata()
before calling scan.header
, the error arises: AttributeError: 'memmap' object has no attribute 'header'
. Example of such code:
scan = nibabel.load(test_image.nii)
scan_volume_data = scan.get_fdata()
print(scan.header)