# Convert RT struct to a label map volume

**URL:** <https://discourse.slicer.org/t/convert-rt-struct-to-a-label-map-volume/457>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [June 8, 2017, 1:25pm UTC](https://discourse.slicer.org/t/convert-rt-struct-to-a-label-map-volume/457 "2017-06-08T13:25:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yannick\_s](https://avatars.discourse-cdn.com/v4/letter/y/f14d63/32.png) [@yannick\_s](https://discourse.slicer.org/u/yannick_s)\
**Post date:** [June 8, 2017, 1:25pm UTC](https://discourse.slicer.org/t/convert-rt-struct-to-a-label-map-volume/457/1 "2017-06-08T13:25:11Z")

</div>

Operating system: Ubuntu 16.04 LTS  
Slicer version: 4.7.0-2017-06-03 r26072  
Expected behavior: Conversion from RT Struct to a label map in segmentation module producing label map volume with nonzero entries  
Actual behavior: Output label map volume is zero everywhere

Dear all,  
I have RT structs with a contouring in it, after installing SlicerRT I can import these from DICOM files. I would like to convert the RT struct to a binary labelmap. This is what I tried:  
Segmentations module -\> Representations: Create binary labelmap -\> Export/import models and labelmaps: select export, label map and an output node. This produces a labelmap volume with no nonzero entries.  
Can you point me to a solution?

Best and thank you,  
Yannick

---

<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 8, 2017, 1:28pm UTC](https://discourse.slicer.org/t/convert-rt-struct-to-a-label-map-volume/457/2 "2017-06-08T13:28:47Z")

</div>

Are the structure sets displayed correctly?  
If you go to Segment Editor and select a master volume, can you edit segments (for example, paint in it)?

---

<div class="post-metadata">

**Author:** ![pwang](https://avatars.discourse-cdn.com/v4/letter/p/73ab20/32.png) [@pwang](https://discourse.slicer.org/u/pwang)\
**Post date:** [August 30, 2017, 3:31pm UTC](https://discourse.slicer.org/t/convert-rt-struct-to-a-label-map-volume/457/3 "2017-08-30T15:31:30Z")

</div>

> [@lassoan](#):
>
> Are the structure sets displayed correctly?

Hi Lassoan, I can display correctly and be able to paint in it. And the file format of contours is changed from .seg.vtm to .seg.nrrd. However, I still need to convert the contours to label cause I assume the label can be deformed with the image during the deformable image registration. Please advice 1. if my assumption is correct and 2. if correct, how I can convert the contours to label. Thanks a lot.

---

<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:** [August 30, 2017, 4:22pm UTC](https://discourse.slicer.org/t/convert-rt-struct-to-a-label-map-volume/457/4 "2017-08-30T16:22:23Z")

</div>

You can apply rigid or deformable transforms directly to segmentation nodes, even in real-time (change the transform and you immediately see how the segments change). No need to export it to other node type.

If you want to edit a deformed segmentation then you need to go to Transforms module and “harden” the transform on the segmentation by clicking ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/a/7a90682e9aeed4c641d5d1589fee56294badfb97.png) button.

---

<div class="post-metadata">

**Author:** ![pwang](https://avatars.discourse-cdn.com/v4/letter/p/73ab20/32.png) [@pwang](https://discourse.slicer.org/u/pwang)\
**Post date:** [September 1, 2017, 7:31pm UTC](https://discourse.slicer.org/t/convert-rt-struct-to-a-label-map-volume/457/5 "2017-09-01T19:31:17Z")

</div>

Thanks Lassoan. Please see the screen shot:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/2/c203fc233c0faeabca4758f479a6e20ed4027220.png). Q1: The structure is not deformed by BSpine. Because pink contour represents heart, and it is not following heart. How to make BSpine applied on RTSTRUCT? Q2: RTSTRUCT stays at the original location. How to change its original location to the same as CBCT (the fixed image) in the work? Thanks a lot.

---

<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:** [September 1, 2017, 10:39pm UTC](https://discourse.slicer.org/t/convert-rt-struct-to-a-label-map-volume/457/6 "2017-09-01T22:39:31Z")

</div>

I’ve just checked and Transforms are applied correctly to Segmentations nodes. See this example video: [https://1drv.ms/v/s!Arm\_AFxB9yqHsJ8NLVWOX6tvTNHtpw](https://1drv.ms/v/s!Arm_AFxB9yqHsJ8NLVWOX6tvTNHtpw)

If you still have problems, then please reproduce the problem with a data set that you can share (for example, data sets from Slicer’s Sample Data module), save the scene, upload to dropbox/onedrive, and paste the link here.
