# import image axis reorder and flipping

**URL:** https://discourse.itk.org/t/import-image-axis-reorder-and-flipping/5433
**Category:** Beginner Questions
**Created:** [October 20, 2022, 7:31pm UTC](https://discourse.itk.org/t/import-image-axis-reorder-and-flipping/5433 "2022-10-20T19:31:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![leandro328](https://discourse.itk.org/letter_avatar_proxy/v4/letter/l/97f17d/32.png) [@leandro328](https://discourse.itk.org/u/leandro328)
#### Post date: [October 20, 2022, 7:31pm UTC](https://discourse.itk.org/t/import-image-axis-reorder-and-flipping/5433/1 "2022-10-20T19:31:46Z")

</div>

i need to work with itk images and numpy arrays, but the operations itk.GetImageFromArray and itk.GetArrayFromImage

e.g.:  
img = itk.GetImageFromArray(input\_img)

res\_img = itk.GetArrayFromImage(img)

are flipping and are changing the axes of my image. How can I revert the res\_img to the input\_img orientation and disposition?

---

<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: [October 20, 2022, 7:36pm UTC](https://discourse.itk.org/t/import-image-axis-reorder-and-flipping/5433/2 "2022-10-20T19:36:25Z")

</div>

Is your array in Fortran order or C order? I think that ITK’s conversion might not fully support one (Fortran, I think). Can you try changing that using numpy, before converting to ITK image?

---

<div class="post-metadata">

### Author: ![leandro328](https://discourse.itk.org/letter_avatar_proxy/v4/letter/l/97f17d/32.png) [@leandro328](https://discourse.itk.org/u/leandro328)
#### Post date: [October 20, 2022, 8:06pm UTC](https://discourse.itk.org/t/import-image-axis-reorder-and-flipping/5433/3 "2022-10-20T20:06:21Z")

</div>

Thanks a lot for the feedback.  
I solved my problem with: res\_img.CopyInformation(input\_img) method.
