# Recover 2d curve from 2d slices

**URL:** <https://discourse.slicer.org/t/recover-2d-curve-from-2d-slices/12160>\
**Category:** Development\
**Tags:** slicerrt\
**Created:** [June 22, 2020, 4:37pm UTC](https://discourse.slicer.org/t/recover-2d-curve-from-2d-slices/12160 "2020-06-22T16:37:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![loubna](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@loubna](https://discourse.slicer.org/u/loubna)\
**Post date:** [June 22, 2020, 4:37pm UTC](https://discourse.slicer.org/t/recover-2d-curve-from-2d-slices/12160/1 "2020-06-22T16:37:12Z")

</div>

Hi,  
Is there any way to recover the points of 2D curve corresponding to segmented area into 2D slices as shown in figure. I want recover the coordinates of red points (red curve) surrounded the green area.

I know that in slicerRT, the labelMap is computed automatically from reconstructed surface, but how can I access to this labelMap in my code.  
Thank’s in advance

 ![slicer](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/4/54983cb54d557493ab34ccfd4ce98244cb86c5b0.jpeg)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 22, 2020, 5:54pm UTC](https://discourse.slicer.org/t/recover-2d-curve-from-2d-slices/12160/2 "2020-06-22T17:54:50Z")

</div>

Do you want just an unordered list of the coordinates or do you want something like clockwise order fitted curve (the first is easier)/

---

<div class="post-metadata">

**Author:** ![loubna](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@loubna](https://discourse.slicer.org/u/loubna)\
**Post date:** [June 22, 2020, 5:56pm UTC](https://discourse.slicer.org/t/recover-2d-curve-from-2d-slices/12160/3 "2020-06-22T17:56:43Z")

</div>

Yes, i would just recover an unordered list of the coordinates.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 22, 2020, 6:11pm UTC](https://discourse.slicer.org/t/recover-2d-curve-from-2d-slices/12160/4 "2020-06-22T18:11:25Z")

</div>

The `points` variable in this snippet would have that info.

[https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get\_the\_values\_of\_all\_voxels\_for\_a\_label\_value](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_the_values_of_all_voxels_for_a_label_value)

---

<div class="post-metadata">

**Author:** ![loubna](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@loubna](https://discourse.slicer.org/u/loubna)\
**Post date:** [June 22, 2020, 6:13pm UTC](https://discourse.slicer.org/t/recover-2d-curve-from-2d-slices/12160/5 "2020-06-22T18:13:57Z")

</div>

Thank you very much for the answer
