How to move nibabel.Nifti1Image metadata into a SimpleITK.Image object?

458 views Asked by At

I am working with MRI images which in their raw form are 5-dimensional. I can load them in using nibabel package which gives me nibabel.Nifti1Image objects. Then I can slice that object into a bunch of 3D numpy arrays from which I create SimpleITK.Image objects, but I would like to preserve the metadata (affine, header) contained in nibabel.Nifti1Image. When working with just SimpleITK.Image objects, you can use the .CopyInformation() method, unfortunately that does not work with nibabel.Nifti1Image. How do I copy the information across?

I don't know how to copy the information across manually as I do not understand the difference in how either package approaches defining spatial information.

0

There are 0 answers