# How to just flip an image about z axes?

**URL:** https://discourse.itk.org/t/how-to-just-flip-an-image-about-z-axes/3333
**Category:** Uncategorized
**Created:** [July 26, 2020, 6:37am UTC](https://discourse.itk.org/t/how-to-just-flip-an-image-about-z-axes/3333 "2020-07-26T06:37:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![unicorn](https://discourse.itk.org/letter_avatar_proxy/v4/letter/u/35a633/32.png) [@unicorn](https://discourse.itk.org/u/unicorn)
#### Post date: [July 26, 2020, 6:37am UTC](https://discourse.itk.org/t/how-to-just-flip-an-image-about-z-axes/3333/1 "2020-07-26T06:37:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [July 26, 2020, 11:41am UTC](https://discourse.itk.org/t/how-to-just-flip-an-image-about-z-axes/3333/2 "2020-07-26T11:41:55Z")

</div>

Possible things to look at:

- This [example](https://itk.org/ITKExamples/src/Filtering/ImageGrid/ChangeImageOriginSpacingOrDirection/Documentation.html)
- This [filter](https://itk.org/Doxygen/html/classitk_1_1OrientImageFilter.html)
- This [discussion](https://discourse.itk.org/t/orientimagefilter-changes-the-origin-of-the-image/2200/)

---

<div class="post-metadata">

### Author: ![dchen](https://discourse.itk.org/user_avatar/discourse.itk.org/dchen/32/34_2.png) [@dchen](https://discourse.itk.org/u/dchen)
#### Post date: [July 27, 2020, 2:20am UTC](https://discourse.itk.org/t/how-to-just-flip-an-image-about-z-axes/3333/3 "2020-07-27T02:20:23Z")

</div>

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])
```
