# Display an image in a separate window

**URL:** <https://discourse.slicer.org/t/display-an-image-in-a-separate-window/8821>\
**Category:** Development\
**Created:** [October 17, 2019, 7:34pm UTC](https://discourse.slicer.org/t/display-an-image-in-a-separate-window/8821 "2019-10-17T19:34:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 17, 2019, 8:39pm UTC](https://discourse.slicer.org/t/display-an-image-in-a-separate-window/8821/2 "2019-10-17T20:39:34Z")

</div>

You can show a proper image viewer outside the view layout as shown here: [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Show\_a\_slice\_view\_outside\_the\_view\_layout](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Show_a_slice_view_outside_the_view_layout)

If you want to convert a numpy array to QImage then I would recommend to use qimage2ndarray package:

```auto
try:
    import qimage2ndarray
except ImportError:
    pip_install('qimage2ndarray')
    import qimage2ndarray

import numpy as np
image = np.fromfunction(lambda i, j: i + j, (100, 100), dtype='uint8')
qImg = qimage2ndarray.array2qimage(image, normalize=True)
pixmap = qt.QPixmap.fromImage(qImg)
myLabel = qt.QLabel()
myLabel.setPixmap(pixmap)
myLabel.show()

```

---

_[View the full topic](https://discourse.slicer.org/t/display-an-image-in-a-separate-window/8821)._
