# nii image not displaying with SimpleITK gui

**URL:** <https://discourse.itk.org/t/nii-image-not-displaying-with-simpleitk-gui/6667>\
**Category:** Uncategorized\
**Tags:** simpleitk, python\
**Created:** [June 1, 2024, 6:55am UTC](https://discourse.itk.org/t/nii-image-not-displaying-with-simpleitk-gui/6667 "2024-06-01T06:55:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![debapriya](https://discourse.itk.org/letter_avatar_proxy/v4/letter/d/bc79bd/32.png) [@debapriya](https://discourse.itk.org/u/debapriya)\
**Post date:** [June 1, 2024, 6:55am UTC](https://discourse.itk.org/t/nii-image-not-displaying-with-simpleitk-gui/6667/1 "2024-06-01T06:55:56Z")

</div>

I have a 3D nii image representing the ROI of tumor region in brain. It is displaying properly with Slicer.

 ![ROI](https://discourse.itk.org/uploads/default/original/2X/6/6fbf155f5445203bcc2c3ebfc8da0ee4dffedd4b.png)

However, when I try to display the same image using SimpleITK gui, I see a black image. My SimpleITK code is

```auto
import SimpleITK as sitk
import gui
import numpy as np

ROI_image = sitk.ReadImage("Coreg/Data1/roi.nii", sitk.sitkFloat32)
ROIwindowMinimum = float(np.array(ROI_image).min())
ROIwindowMaximum = float(np.array(ROI_image).max())
ROI_window_level = (ROIwindowMaximum-ROIwindowMinimum, (ROIwindowMaximum+ROIwindowMinimum)/2)

print(ROIwindowMinimum)
print(ROIwindowMaximum)
print(ROI_window_level)

gui.MultiImageDisplay(
    image_list=[ROI_image],
    title_list=["ROI"],
    figure_size=(8, 4),
    window_level_list=[ROI_window_level],
);

```

Output is

 ![ROI_GUI](https://discourse.itk.org/uploads/default/original/2X/b/bc0bd4aca8a9aa2c9dc64ef58a7ee46b2ba60298.png)

---

<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:** [June 2, 2024, 1:32pm UTC](https://discourse.itk.org/t/nii-image-not-displaying-with-simpleitk-gui/6667/2 "2024-06-02T13:32:27Z")

</div>

Hello @debapriya,

You are trying to display a label image, which was not the original intent of the `MultiImageDisplay`. [The documentation](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/84c88a6f84b53bbdfba13ca505c8993c1718fd8e/Python/gui.py#L612-L623) for this component gives a hint to the possible problem: “The range of the intensity slider is set to be from top/bottom 2% of intensities”. You can modify your code so that the range includes all intensities (`intensity_slider_range_percentile` parameter in constructor) and then the labels should be visible.

---

<div class="post-metadata">

**Author:** ![debapriya](https://discourse.itk.org/letter_avatar_proxy/v4/letter/d/bc79bd/32.png) [@debapriya](https://discourse.itk.org/u/debapriya)\
**Post date:** [June 2, 2024, 3:19pm UTC](https://discourse.itk.org/t/nii-image-not-displaying-with-simpleitk-gui/6667/3 "2024-06-02T15:19:49Z")

</div>

Thank you @zivy. It worked.
