# PyQt6 conversion to pixmap

**URL:** https://discourse.itk.org/t/pyqt6-conversion-to-pixmap/5919
**Category:** Beginner Questions
**Created:** [May 2, 2023, 12:13pm UTC](https://discourse.itk.org/t/pyqt6-conversion-to-pixmap/5919 "2023-05-02T12:13:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CaptainHaddock](https://discourse.itk.org/letter_avatar_proxy/v4/letter/c/b77776/32.png) [@CaptainHaddock](https://discourse.itk.org/u/CaptainHaddock)
#### Post date: [May 2, 2023, 12:13pm UTC](https://discourse.itk.org/t/pyqt6-conversion-to-pixmap/5919/1 "2023-05-02T12:13:26Z")

</div>

How do I convert a DICOM image to a QPixmap in memory? I found an example of writing to disk in e.g. png ([Resample and Convert DICOM to Common Image Formats — SimpleITK 2.0rc2 documentation](https://simpleitk.readthedocs.io/en/master/link_DicomConvert_docs.html)), but looking to be able to complete in memory.

---

<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: [May 2, 2023, 12:54pm UTC](https://discourse.itk.org/t/pyqt6-conversion-to-pixmap/5919/2 "2023-05-02T12:54:09Z")

</div>

Hello @CaptainHaddock,

I believe [this is what you are looking for](https://github.com/niaid/rap_tb_ntb_service_frontend/blob/bf84583d89d55330846c2bff1a4655be0117c5e1/tb_ntb_gui.py#L349-L372).

---

<div class="post-metadata">

### Author: ![CaptainHaddock](https://discourse.itk.org/letter_avatar_proxy/v4/letter/c/b77776/32.png) [@CaptainHaddock](https://discourse.itk.org/u/CaptainHaddock)
#### Post date: [May 3, 2023, 12:52pm UTC](https://discourse.itk.org/t/pyqt6-conversion-to-pixmap/5919/3 "2023-05-03T12:52:53Z")

</div>

@zivy This is exactly what I am looking for. Thank you very much for the pointer, works as advertised 🕶
