Closed ALEXJAZZ008008 closed 3 years ago
I did
from sirf.STIR import *
image = ImageData('my_image.hv')
image.fill(numpy.transpose(image.as_array(), (0, 2, 1)))
image.write('my_image_zxy.hv')
and I got images with x and y axes swapped in my_image_zxy.
You must be using some old version of SIRF, please check.
I also need to pass transposed and flipped images although to STIR, not SIRF, and the equivalent of @evgueni-ovtchinnikov's code above works for me.
I found that when using Numpy translate if the matrix is not hard copied then SIRF fill does not reflect the translation. This is possibly due to the fact that Numpy translate only changes the way the data is read not the data itself.
It seems that Evgueni has tried an experiment:
and he did not find the same as me.
My code was:
The following fixed the issue: