# Strange conversion between planer contours to binary labelmap

**URL:** <https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718>\
**Category:** Support\
**Tags:** registration, segmentation\
**Created:** [May 30, 2023, 5:35am UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718 "2023-05-30T05:35:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sotarad](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sotarad](https://discourse.slicer.org/u/sotarad)\
**Post date:** [May 30, 2023, 5:35am UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/1 "2023-05-30T05:35:08Z")

</div>

Hi,all.  
I’m troubled with converting planer contour (master) into binary lebelmap.  
Finally, I want to do segment registration that reflected patient’s body shrink.  
So, I make new segmentation that reproduced body shrink using by shrink function in segment editor.  
When use the function, I have to convert master into binary lebelmap.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/c/6cf1c0d350e87bc6b6de400b53f0298d59aaf626.png)

But, some segmaentations can’t be converted accurately like a uploaded pictures.  
 ![Untitled](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/1/81f5b9fcd7e6e26ff7573755e89f7cb3229e6fd7.png)

Could you tell me reasons for that thing and solutions.

---

<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 30, 2023, 7:55pm UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/2 "2023-05-30T19:55:56Z")

</div>

It looks like your input contours are messed up, but of course there is also a chance that Slicer’s contour interpolation method can be improved. What software did you use to create the contours? Can you share the DICOM RTSTRUCT file (upload somewhere and post the link here)?

---

<div class="post-metadata">

**Author:** ![sotarad](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sotarad](https://discourse.slicer.org/u/sotarad)\
**Post date:** [May 31, 2023, 2:29am UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/3 "2023-05-31T02:29:13Z")

</div>

Thanks for comment, Dr.lassoan.  
The data what I used is Kanazawa University’s registration-based database.  
So, the data isn’t created by me.  
The open database explained that contouring data is manually segmented by radiation oncologist and software used only mentions MIM.  
I can send the URLs about the data, but probably you can’t view the data because the data only available in Japan and used Japan IP addres.  
If you could use the database, please continue to help me.  
database link : [https://takemuralab.net/dirdb2/](https://takemuralab.net/dirdb2/)  
paper about database : [https://www.jstage.jst.go.jp/article/jjrt/76/5/76\_2020\_JSRT\_76.5.500/\_pdf](https://www.jstage.jst.go.jp/article/jjrt/76/5/76_2020_JSRT_76.5.500/_pdf)  
patient data : H&N No.6 PLAN1 in the database

---

<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 31, 2023, 3:02am UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/4 "2023-05-31T03:02:41Z")

</div>

I could not register. You can upload a sample data set to somewhere (dropbox, onedrive, google drive, etc.) and post the link here.

---

<div class="post-metadata">

**Author:** ![sotarad](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sotarad](https://discourse.slicer.org/u/sotarad)\
**Post date:** [May 31, 2023, 8:44am UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/5 "2023-05-31T08:44:00Z")

</div>

Thanks for trying.  
I’ll upload in onedrive.  
But my organization limit the access.  
If it’s not a problem, could you tell me mail addres used in onedrive to message.  
I’ll let you available to share.

---

<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 31, 2023, 1:43pm UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/6 "2023-05-31T13:43:31Z")

</div>

You can send the download link to me and @Sunderlandkyl (who will most likely to the actual investigation) as private message. You can send a private message to someone by clicking on the username and then clicking on the “Message” button.

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [June 1, 2023, 2:13am UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/7 "2023-06-01T02:13:21Z")

</div>

@sotarad I’ll investigate at the issue once you are able to send the dataset.

You could also try the workaround in this post: [Retrieving statistics from RTSTRUCT and scalar volume - binary labelmap representation computation is very slow - #5 by Sunderlandkyl](https://discourse.slicer.org/t/retrieving-statistics-from-rtstruct-and-scalar-volume-binary-labelmap-representation-computation-is-very-slow/28100/5).

---

<div class="post-metadata">

**Author:** ![sotarad](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sotarad](https://discourse.slicer.org/u/sotarad)\
**Post date:** [June 2, 2023, 2:13am UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/8 "2023-06-02T02:13:20Z")

</div>

Thank for give me an advice!  
I tried to make CTV segmentation to shrink after create ribbon model, but I can’t do that good.  
Strange line disappeared, but shrinking segmentation couldn’t be seen shrunk from master data.  
Is my data set bad ??

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [June 2, 2023, 3:14pm UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/9 "2023-06-02T15:14:23Z")

</div>

I’ve taken a look at the dataset, and I don’t think that it is bad.

I don’t see any major issues with the conversion from planar contours to closed surfaces, except that the contours are quite dense. Due to the density, triangles in the mesh are quite long and thin, which may be causing issues in the surface to labelmap conversion.

> [@sotarad](#):
>
> I tried to make CTV segmentation to shrink after create ribbon model, but I can’t do that good.  
> Strange line disappeared, but shrinking segmentation couldn’t be seen shrunk from master data.

Did you make the binary labelmap into the master representation after converting from ribbon model?

---

<div class="post-metadata">

**Author:** ![sotarad](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sotarad](https://discourse.slicer.org/u/sotarad)\
**Post date:** [June 6, 2023, 6:34am UTC](https://discourse.slicer.org/t/strange-conversion-between-planer-contours-to-binary-labelmap/29718/10 "2023-06-06T06:34:21Z")

</div>

I did that again, so had successfully converted binary lebelmap exactly.  
Thanks for giving advices to me!!
