# Convert image and segmentation to DICOM

**URL:** <https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543>\
**Category:** Support\
**Created:** [June 20, 2017, 7:20pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543 "2017-06-20T19:20:23Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josiah\_McAllister](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Josiah\_McAllister](https://discourse.slicer.org/u/Josiah_McAllister)\
**Post date:** [June 20, 2017, 7:20pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/1 "2017-06-20T19:20:23Z")

</div>

Andras,  
I am now trying to convert nrrd files to DICOM. The main image is  
converting just fine, but I am not able to figure out how to convert just  
the contour, as it does not show up when using “Create a DICOM series.” How  
can I also convert this file?

---

<div class="post-metadata">

**Author:** ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)\
**Post date:** [June 20, 2017, 8:02pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/2 "2017-06-20T20:02:14Z")

</div>

You are trying to convert nrrd files into a RT Structure Set using 3D Slicer? By coincidence, I documented this procedure earlier today.

1. Load all images. At time of load, click “Labelmap” checkbox for each structure
2. Go to Segmentation module
3. For “Active segmentation”, choose “Create new segmentation”
4. For each structure, repeat:  
4a) In “Export/Import segments”, choose structure, and import as labelmap
5. Click on one of the segments, and then click “Edit selected”
6. Set the “Master volume” to your CT
7. Go to Data module.
8. On background, right click choose “Create new subject”
9. On subject, right click choose “Create child study”
10. Drag the CT and segmentation node onto the child study
11. Right click on study, choose “Export to DICOM”
12. Enjoy your newly created DICOM-RT file

---

<div class="post-metadata">

**Author:** ![Josiah\_McAllister](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Josiah\_McAllister](https://discourse.slicer.org/u/Josiah_McAllister)\
**Post date:** [June 20, 2017, 8:18pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/3 "2017-06-20T20:18:07Z")

</div>

When I am loading the images, I am not seeing a “Labelmap” checkbox.

---

<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 20, 2017, 8:21pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/4 "2017-06-20T20:21:29Z")

</div>

> [@Josiah\_McAllister](#):
>
> When I am loading the images, I am not seeing a “Labelmap” checkbox.

Click “Show options” in the Add data dialog.

If you already have your contours as segmentation you can start at step 7.

---

<div class="post-metadata">

**Author:** ![Josiah\_McAllister](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Josiah\_McAllister](https://discourse.slicer.org/u/Josiah_McAllister)\
**Post date:** [June 20, 2017, 8:42pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/5 "2017-06-20T20:42:01Z")

</div>

I am not seeing a “create new subject” option once I am in the data module,  
or any of the steps past 7.

---

<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 20, 2017, 8:59pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/6 "2017-06-20T20:59:12Z")

</div>

You should see this when you right-click in the big white empty area in the Subject hierarchy tab of Data module:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/6/26329c81f4fffe173f793fbef785635420658222.png)

---

<div class="post-metadata">

**Author:** ![Josiah\_McAllister](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Josiah\_McAllister](https://discourse.slicer.org/u/Josiah_McAllister)\
**Post date:** [June 20, 2017, 9:10pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/7 "2017-06-20T21:10:36Z")

</div>

That is not what I have. I have version 4.6.2, so I’m not sure if that is  
where the difference is.

---

<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 20, 2017, 9:12pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/8 "2017-06-20T21:12:16Z")

</div>

4.6.2 is very old (almost a year). Use the latest nightly build.

---

<div class="post-metadata">

**Author:** ![Josiah\_McAllister](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Josiah\_McAllister](https://discourse.slicer.org/u/Josiah_McAllister)\
**Post date:** [June 21, 2017, 3:04pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/9 "2017-06-21T15:04:06Z")

</div>

When I click on export on the final step, nothing happens. Nothing shows up in the folder which I have selected, and the export window doesn’t change or go away.

---

<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 21, 2017, 4:20pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/10 "2017-06-21T16:20:14Z")

</div>

Please copy the complete application log (menu: Help / Report a bug). Scrub any patient info from the logs before posting.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [June 21, 2017, 5:06pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/11 "2017-06-21T17:06:26Z")

</div>

> [@Josiah\_McAllister](#):
>
> I am now trying to convert nrrd files to DICOM

There are very different ways to do this, and the approach will be different depending on your specific needs.

Can you explain why you want to convert these nrrd files to DICOM? What do you want to do next with those DICOM files?

---

<div class="post-metadata">

**Author:** ![Josiah\_McAllister](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Josiah\_McAllister](https://discourse.slicer.org/u/Josiah_McAllister)\
**Post date:** [June 21, 2017, 6:15pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/12 "2017-06-21T18:15:22Z")

</div>

It is to test if the files from pyradiomics will be able to run on some new  
code we have created. We are trying to verify that our code will correctly  
read the images.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [June 21, 2017, 7:44pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/13 "2017-06-21T19:44:41Z")

</div>

> [@Josiah\_McAllister](#):
>
> It is to test if the files from pyradiomics will be able to run on some new  
> code we have created. We are trying to verify that our code will correctly  
> read the images.

I do not understand what you are trying to do. The output from pyradiomics is a table with numbers. pyradiomics does not produce any images.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [June 21, 2017, 7:59pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/14 "2017-06-21T19:59:59Z")

</div>

There is a plugin in Slicer called “Create a DICOM Series”

---

<div class="post-metadata">

**Author:** ![Josiah\_McAllister](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Josiah\_McAllister](https://discourse.slicer.org/u/Josiah_McAllister)\
**Post date:** [June 21, 2017, 8:32pm UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/15 "2017-06-21T20:32:03Z")

</div>

I am trying to get another system to output the same numbers as  
pyradiomics. However, that other system can only use DICOM images. This is  
to check that the other system is outputting the correct numbers.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [June 22, 2017, 2:27am UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/16 "2017-06-22T02:27:42Z")

</div>

Ok, now I understand I think.

The simplest would be to just start with an image dataset that is already in DICOM and compute radiomics features using both tools.

---

<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 10, 2020, 12:32am UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/17 "2020-10-10T00:32:06Z")

</div>

A post was split to a new topic: [Export segmentation as DICOM](https://discourse.slicer.org/t/export-segmentation-as-dicom/13970)

---

<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 10, 2020, 12:31am UTC](https://discourse.slicer.org/t/convert-image-and-segmentation-to-dicom/543/18 "2020-10-10T00:31:13Z")

</div>

A post was split to a new topic: [Use segmentation for radiomics](https://discourse.slicer.org/t/use-segmentation-for-radiomics/13969)
