# Dicom rt save and load

**URL:** <https://discourse.slicer.org/t/dicom-rt-save-and-load/29391>\
**Category:** Support\
**Created:** [May 10, 2023, 2:51am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391 "2023-05-10T02:51:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dex2046](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dex2046/32/65593_2.png) [@Dex2046](https://discourse.slicer.org/u/Dex2046)\
**Post date:** [May 10, 2023, 2:51am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/1 "2023-05-10T02:51:17Z")

</div>

I segmented a PET image and exported the segmentation as rtstruct with dicom-rt format. But, when I import the rtstruct, something goes wrong. Where is the problem, thank you for all.  
 ![屏幕截图 2023-05-10 105103](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/6/d698cccd00aa65b8200939386a2d314d57641d52.png)

![屏幕截图 2023-05-10 104842](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/0/60d834d7bc2d49b89226fc04641aae7cbab5f677.png)  
 ![屏幕截图 2023-05-10 104912](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/8/083e453be8cb5c2d71e56d433a59b4bbd381ba27.png)

---

<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:** [May 10, 2023, 4:44am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/2 "2023-05-10T04:44:31Z")

</div>

It may be just a visualization issue or an invalid RT structure set. If you create a binary labelmap representation and there are still artifacts then it means that the structure set is invalid. What software did you use to generate the structure set?

---

<div class="post-metadata">

**Author:** ![Dex2046](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dex2046/32/65593_2.png) [@Dex2046](https://discourse.slicer.org/u/Dex2046)\
**Post date:** [May 10, 2023, 5:18am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/3 "2023-05-10T05:18:07Z")

</div>

the structure set was generated by 3d-slicer 😅

---

<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:** [May 10, 2023, 5:25am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/4 "2023-05-10T05:25:59Z")

</div>

RT structure sets are designed for storing manually drawn polygons. It is not suitable at all for general-purpose storage of any image segmentation result. SlicerRT uses Plastimatch library to try to convert binary labelmap segmentation to polygons, but of course it can only work for simple shapes.

If you want to save segmentation into DICOM I would recommend to use DICOM Segmentation Object (exporter is provided by QuantitativeReporting extension).

---

<div class="post-metadata">

**Author:** ![Dex2046](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dex2046/32/65593_2.png) [@Dex2046](https://discourse.slicer.org/u/Dex2046)\
**Post date:** [May 10, 2023, 5:37am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/5 "2023-05-10T05:37:04Z")

</div>

You mean that I draw a too complex segmentation for dicom RT structure? I am just testing the possibility the export the segmentation to tps because our tps do not support pet image.

I’ll test some simple rois, thank you.

---

<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:** [May 10, 2023, 12:57pm UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/6 "2023-05-10T12:57:41Z")

</div>

You are showing a coronal plane. Is the PET image oriented coronally?

Also, does the ROI have “donut-shaped” regions? What I mean is an ROI with a hole somewhere in the middle.

---

<div class="post-metadata">

**Author:** ![Dex2046](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dex2046/32/65593_2.png) [@Dex2046](https://discourse.slicer.org/u/Dex2046)\
**Post date:** [May 11, 2023, 12:17am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/7 "2023-05-11T00:17:15Z")

</div>

The roi was drawn with threshold tool, so I did get some holes.  
The orientation is corrected.

---

<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:** [May 11, 2023, 2:46pm UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/8 "2023-05-11T14:46:11Z")

</div>

Can you try again with a ROI that doesn’t have holes?

Also, which TPS is this?

---

<div class="post-metadata">

**Author:** ![Dex2046](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dex2046/32/65593_2.png) [@Dex2046](https://discourse.slicer.org/u/Dex2046)\
**Post date:** [May 12, 2023, 4:31am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/9 "2023-05-12T04:31:06Z")

</div>

I opened the rtstructure I saved using 3d-slicer.

I’ll try later, thank you

---

<div class="post-metadata">

**Author:** ![Dex2046](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dex2046/32/65593_2.png) [@Dex2046](https://discourse.slicer.org/u/Dex2046)\
**Post date:** [May 15, 2023, 12:55am UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/10 "2023-05-15T00:55:39Z")

</div>

I manually draw some a voi while a hole in the middle. When I loaded the rtstructure, the hole disappeared.

I open the segmentation editor, click a tool, then i got a message, like the picture, choose yes, then the hole came back.

I also tried the complex segmentation, unfortunately, 3d-slicer does not response.  
 ![屏幕截图 2023-05-15 085500](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/c/dcf769265327f0543bbeafa3c6211520182612c5.png)

---

<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:** [May 17, 2023, 6:34pm UTC](https://discourse.slicer.org/t/dicom-rt-save-and-load/29391/11 "2023-05-17T18:34:55Z")

</div>

When segmentation is displayed in 2D views using `Closed surface` representation (either because this is the only available representation or because this representation is chosen to be shown in `Segmentations` module: `Display` / `Advanced` / `Representation in 2D views` → `Closed surface`) then filling of the contours may be incomplete and/or inverted. To avoid this, create `Binary labelmap` representation and choose `Representation in 2D views` → `Binary labelmap`
