How to just flip an image about z axes?

I am working on simple ITK python.
can I use Image[:,:,::-1] as we do usually in python? But it is changing the origin of the image.
I just want to flip my image.

Possible things to look at:

In SimpleITK the Flip function or FlipImageFilter should do what you want.

This code flips an image about Z.

import SimpleITK as sitk

img = sitk.Image(100,100,100,sitk.sitkUInt8)
flipped_img = sitk.Flip(img, [false, false, true])
1 Like