You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to get the affine transform from a Nifti image, but I am not quite sure how? There is a simple method to get the image as a numpy array or the spacing from a loaded sitk Image object, but not for the affine.
Here is example code that illustrates my problem:
importSimpleITKassitkimage_data=sitk.ReadImage(filename)
image=sitk.GetArrayFromImage(image_data) # Easy to get the numpy imagespacing=image_data.GetSpacing() # Easy to get the image spacingaffine= ... # ???
I hope someone can help me.
Best,
Karol
The text was updated successfully, but these errors were encountered:
Hey,
I would like to get the affine transform from a Nifti image, but I am not quite sure how? There is a simple method to get the image as a numpy array or the spacing from a loaded sitk Image object, but not for the affine.
Here is example code that illustrates my problem:
I hope someone can help me.
Best,
Karol
The text was updated successfully, but these errors were encountered: