[Neuroimaging] Niftiimage Affine Rotation

Kai Canoll kaicanoll at gmail.com
Wed Jul 10 16:09:16 EDT 2019


HI All,

We are having some problems applying an affine transform to some nifti data.
We are trying to apply a new transform using
affine_transformed_image=nib.Nifti1Image(datamatrix,affinetransform)
When we look at a slice of affine_transformed_image in Python, it doesn't
seem to change in any way.  However, if we open it in FSLeyes, it appears
to be rotated according to affinetransform.
However, if we resample affine_transformed_image using
resampled_image=nib.processing.resample_from_to(affine_transformed_image,
*v*ox_map)
where vox_map contains an affine identity transform, then the slices in
python are successfully rotated.

In other words, our image does not appear to be affine transformed in the
first step.  Can anyone suggest how to apply the affine transform such that
the image actually rotates without having to do the resampling step?

thanks!

Kai and Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20190710/c2288121/attachment.html>


More information about the Neuroimaging mailing list