-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying Affine not affecting get_fdata() output #660
Comments
The affine is metadata for the image - it records the relationship of coordinates in the image array to coordinates in some real space - see: http://nipy.org/nibabel/coordinate_systems.html So - changing the affine doesn't change the underlying image, it only changes the metadata for the image. |
@matthew-brett I figured that much, I used the nib.orientations.apply_orientation to get the orientation for the plots right. Is there another way to apply changes to affine to the image data itself? Also, side question, when using nib.viewers.OrthoSlicer3D, is there a way to display to different images overlayed, like a main image and corresponding mask? |
Sorry - we don't support multiple images in OrthoSlicer3D - but it would be a good feature to add ... If you want to resample the image to some orientation, set the affine as you want it, make an affine for the output image, maybe a simple diagonal one, and resample with that. Something like:
|
I opened a new issue for overlays. |
I am trying to manipulate an image by modifying its affine matrix. When I modify it and plot the output using the OrthoSlicer3D class, it is properly modified as the slices are oriented differently. However, when I try to look at a raw image slice output using get_fdata() and matplotlib, nothing changes. I am not sure exactly what I am doing wrong. I am currently working with Nifti1Image class images.
The text was updated successfully, but these errors were encountered: