# Inability to export segmentations as RTStruct File

**URL:** <https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745>\
**Category:** Support\
**Created:** [February 10, 2023, 3:07pm UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745 "2023-02-10T15:07:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![KSC\_IA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ksc_ia/32/18357_2.png) [@KSC\_IA](https://discourse.slicer.org/u/KSC_IA)\
**Post date:** [February 10, 2023, 3:07pm UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/1 "2023-02-10T15:07:51Z")

</div>

Slicer Version: 5.2.1 (Stable Release)  
OS: MacOS Big Sur 11.7.3 (Intel i7)  
Expected Behaviour: ‘Export as DICOM’ in Export Data converts scene to DICOM files and segmentations to RT Structure file  
Actual Behaviour: DICOM files are created but RT structure file is not created

Hello.

I am a radiation oncologist and just beginning to explore 3DSlicer for integration into our research workflow.

I saw the video by Dr @lassoan on exporting segmentations to DICOM and RT Structure files ([Create DICOM files from CT volume and segmentation - YouTube](https://youtu.be/nzWf4xHy1BM)). I have the SlicerRT and QuantitativeReporting modules installed as well. Following along the video step-by-step, unfortunately after hitting ‘Export’, the output folder contains the DICOM files, but not the RT Structure File.

Before posting here, I scanned through all posts related to this topic, but most dealt with problems with RT Structure files, rather than the process of exporting it. At present, I am performing a clean install of Slicer, using the nightly release (v5.3.0) and also attempting to recreate the problem on a Windows machine. [Update: Tried this step, but no luck. DICOM files are still exporting, but no RT Structure file.]

I am also aware that as a format, RT Structure, is considered a legacy format. But its a core component of Radiation Oncology workflows.

Thank you for your help in advance.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 13, 2023, 12:10pm UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/3 "2023-02-13T12:10:32Z")

</div>

Can you please make a screenshot of your Data module (Subject hierarchy tab) before starting DICOM export?

---

<div class="post-metadata">

**Author:** ![KSC\_IA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ksc_ia/32/18357_2.png) [@KSC\_IA](https://discourse.slicer.org/u/KSC_IA)\
**Post date:** [February 17, 2023, 6:48am UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/4 "2023-02-17T06:48:54Z")

</div>

Thank you for your reply & apologies for my delayed response.

 ![Screenshot 2023-02-17 at 12.13.26 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/e/0ea4ab0bfe70a82be265b31b17113a0e68840fae.jpeg)  
This is the subject hierarchy screen

 ![Screenshot 2023-02-17 at 12.14.13 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/7/27097cb47c9e87b179e7dcddeb6bd8d8b69c9c7b.png)  
Here is the export selection screen after I have selected ‘Export to DICOM’

Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![KSC\_IA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ksc_ia/32/18357_2.png) [@KSC\_IA](https://discourse.slicer.org/u/KSC_IA)\
**Post date:** [February 18, 2023, 7:33am UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/5 "2023-02-18T07:33:22Z")

</div>

I can also confirm that this is not an issue on Windows-based systems. The RT structure file is created as expected.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 19, 2023, 12:27pm UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/6 "2023-02-19T12:27:02Z")

</div>

Please attach the log after export fails on Mac. Maybe it contains some pointers.

---

<div class="post-metadata">

**Author:** ![KSC\_IA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ksc_ia/32/18357_2.png) [@KSC\_IA](https://discourse.slicer.org/u/KSC_IA)\
**Post date:** [February 20, 2023, 7:36am UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/7 "2023-02-20T07:36:18Z")

</div>

Thank you for your reply @cpinter. I’m not sure when you say ‘log file’. I actually don’t get an ‘export failed’ message. The DICOM files are generated successfully, but the RT structure file is not!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 20, 2023, 2:45pm UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/8 "2023-02-20T14:45:02Z")

</div>

You can find the log in `View / Error Log` or `Help / Report a Bug`. Basic information such as what is the log file can be found easily in the forum or the [Slicer documentation](https://slicer.readthedocs.io/en/latest/index.html), so I encourage consulting these material for help.

---

<div class="post-metadata">

**Author:** ![KSC\_IA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ksc_ia/32/18357_2.png) [@KSC\_IA](https://discourse.slicer.org/u/KSC_IA)\
**Post date:** [February 23, 2023, 4:38am UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/9 "2023-02-23T04:38:32Z")

</div>

Thank you for your suggestion @cpinter. I did as you suggested and discovered that I need to save all my data into an MRML scene first, quit the scene and then reload the MRML scene. Then after exporting as RT structure set, it creates an RT\_Struct file.  
My next task will be check the compatibility of these RT\_Struct files with our manufacturers’ Treatment Planning Software (TPS).  
Thank you for all your responses.

---

<div class="post-metadata">

**Author:** ![KSC\_IA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ksc_ia/32/18357_2.png) [@KSC\_IA](https://discourse.slicer.org/u/KSC_IA)\
**Post date:** [February 23, 2023, 11:18am UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/10 "2023-02-23T11:18:49Z")

</div>

I can also confirm that the RT\_Struct file from Slicer imports perfectly into Varian Eclipse TPS.

Will add to this list in the future.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 24, 2023, 3:16pm UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/11 "2023-02-24T15:16:52Z")

</div>

I think it would be much better to fix this issue rather than do the save/load workaround. Can you please help with this by sharing the error log that you get after a failed export attempt?

---

<div class="post-metadata">

**Author:** ![KSC\_IA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ksc_ia/32/18357_2.png) [@KSC\_IA](https://discourse.slicer.org/u/KSC_IA)\
**Post date:** [February 25, 2023, 4:22am UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/12 "2023-02-25T04:22:31Z")

</div>

![Error Log for Export as RT_Struct](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/1/f15f555b6fba71c1f68fc1ef8b92e67cc519757f.png)

The last step in this sequence was when I switched to the Data Module and rearranged the hierarchy as demonstrated in your video. Upon hitting export, nothing gets logged and I got only DICOM files (no RT\_Struct file).

 ![Screenshot 2023-02-25 at 9.49.18 AM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/d/ad5f51e855a0a8948a59d60f959b7b277b3c7d70.png)

I then closed the previous scene. I next loaded a scene, which I had already worked upon, and repeated the export procedure and it behaved as expected.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 28, 2023, 9:49am UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/13 "2023-02-28T09:49:20Z")

</div>

I find it very strange that there is no error or warning in the log. Do you have access to a Windows or Linux machine to try the same thing? To see if it’s OS specific or not. Also is there any special data involved? Can you reproduce it with data from the Sample Data module? Thanks!

---

<div class="post-metadata">

**Author:** ![KSC\_IA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ksc_ia/32/18357_2.png) [@KSC\_IA](https://discourse.slicer.org/u/KSC_IA)\
**Post date:** [March 1, 2023, 3:52am UTC](https://discourse.slicer.org/t/inability-to-export-segmentations-as-rtstruct-file/27745/14 "2023-03-01T03:52:21Z")

</div>

It does appear to be OS Specific. I tried the same steps on Windows, with no issues whatsoever.  
All of the above was performed on the datasets from the sample data module. No special data was used.  
Thank you for you help @cpinter!
