# Issue with Visualizing predictions and Groundtruths after numpy to sitk conversion

**URL:** https://discourse.itk.org/t/issue-with-visualizing-predictions-and-groundtruths-after-numpy-to-sitk-conversion/6167
**Category:** Beginner Questions
**Tags:** sitk
**Created:** [August 25, 2023, 3:49pm UTC](https://discourse.itk.org/t/issue-with-visualizing-predictions-and-groundtruths-after-numpy-to-sitk-conversion/6167 "2023-08-25T15:49:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rosanajurdi](https://discourse.itk.org/user_avatar/discourse.itk.org/rosanajurdi/32/3659_2.png) [@rosanajurdi](https://discourse.itk.org/u/rosanajurdi)
#### Post date: [August 25, 2023, 3:49pm UTC](https://discourse.itk.org/t/issue-with-visualizing-predictions-and-groundtruths-after-numpy-to-sitk-conversion/6167/1 "2023-08-25T15:49:41Z")

</div>

Hello,

I am running into an error whenever I try to visualize the predictions vs ground-truths with sitk .

I have a probability map correspinding to the out put of the model, and a binary groundtruth (resamppled) and a PET scan (also resampled).

Whenever I try to visualize the predictions and groundtruths together sitk flips can visualize the grooundtruth on the pet but when it does the probability the axis is overlaped.

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [August 25, 2023, 4:07pm UTC](https://discourse.itk.org/t/issue-with-visualizing-predictions-and-groundtruths-after-numpy-to-sitk-conversion/6167/2 "2023-08-25T16:07:24Z")

</div>

Hello @rosanajurdi,

Without the data it is all but impossible to guess what is causing the issue.

If you are using SimpleITK to perform the overlays then look at the meta-data for all of these images (`GetOrigin()`, `GetSpacing()`, `GetDirection()`). The meta-data needs to match so that the overlay works as expected. If using numpy, SimpleITK and numpy indexing access is in opposite order (`image[x,y,z]`, `image_numpy_array[z,y,x]`).

---

<div class="post-metadata">

### Author: ![rosanajurdi](https://discourse.itk.org/user_avatar/discourse.itk.org/rosanajurdi/32/3659_2.png) [@rosanajurdi](https://discourse.itk.org/u/rosanajurdi)
#### Post date: [August 29, 2023, 2:39pm UTC](https://discourse.itk.org/t/issue-with-visualizing-predictions-and-groundtruths-after-numpy-to-sitk-conversion/6167/3 "2023-08-29T14:39:43Z")

</div>

Thank you,

It was the issue you have mentioned( `image[x,y,z]` , `image_numpy_array[z,y,x]`).  
It got resolved by simply transposing the channels.

BIg Thanks for the help 🙂
