# Display Dicom data just received by websocket connection

**URL:** <https://discourse.slicer.org/t/display-dicom-data-just-received-by-websocket-connection/7293>\
**Category:** Development\
**Tags:** dicom\
**Created:** [June 24, 2019, 3:30pm UTC](https://discourse.slicer.org/t/display-dicom-data-just-received-by-websocket-connection/7293 "2019-06-24T15:30:41Z")\
**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:** [June 25, 2019, 12:06pm UTC](https://discourse.slicer.org/t/display-dicom-data-just-received-by-websocket-connection/7293/2 "2019-06-25T12:06:05Z")

</div>

You need to create a vtkMRMLScalarVolumeNode as shown [here](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Create_a_new_volume). I’m not sure how to set the pixel data in vtkImageData from a QByteArray but @pieper did something similar in the past so maybe he can help.

A much simpler approach is to write the byte array to a file, create a text header file (e.g., a [NRRD image file header](https://discourse.slicer.org/t/load-vol-file-into-3d-slicer-from-morita-machine/4815/5)) and read the header file into Slicer using `slicer.util.loadVolume("path/to/something.nhdr")`.

---

_[View the full topic](https://discourse.slicer.org/t/display-dicom-data-just-received-by-websocket-connection/7293)._
