# Extract contours only from a segmentation

**URL:** <https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [January 16, 2018, 12:03pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853 "2018-01-16T12:03:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![giuseppe.cardone](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@giuseppe.cardone](https://discourse.slicer.org/u/giuseppe.cardone)\
**Post date:** [January 16, 2018, 12:03pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/1 "2018-01-16T12:03:47Z")

</div>

Operating system: Windows 10 Pro  
Slicer version: 4.8.1

Hi, I am a new users of 3D Slicers. I have to use it to extract a geometry from a CT-Angiography. This geometry has to be as simple as possible because I should modify it on a CAD software (Solidworks).  
My idea was to extract only the contour of each slice (like polylines) with the segmentation tool of 3D Slicer. However, with this tool I can only export mesh objects that are more difficult to modify in Solidworks. There is a way to extract only the contours of the segmentation like an .iges file for example?

Thank you

---

<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:** [January 16, 2018, 1:42pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/2 "2018-01-16T13:42:56Z")

</div>

In general, you cannot edit arbitrary shapes in generic CAD software. Tools that import surface meshes into solid objects in CAD software are usually intended for reconstructing relatively simple shapes.

One of the main reasons we developed Slicer’s Segment Editor module was to allow editing of arbitrary anatomical shapes (in accordance with the original image data) and combine them with CAD models. There are some nice [tutorials](https://www.slicer.org/wiki/Documentation/Nightly/Training#Slicer4_Image_Segmentation) on how to do this and we are happy to help with any specific questions that you may have.

---

<div class="post-metadata">

**Author:** ![giuseppe.cardone](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@giuseppe.cardone](https://discourse.slicer.org/u/giuseppe.cardone)\
**Post date:** [January 16, 2018, 1:54pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/3 "2018-01-16T13:54:38Z")

</div>

Thank you Andras.  
I extracted a 3D model of the system subclavian vein-superior vena cava-right atrium and I want to modifiy it through a CAD software in order to have a smoother and more regular geometry.

Thank you for you answer.

---

<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:** [January 16, 2018, 2:03pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/4 "2018-01-16T14:03:12Z")

</div>

You can use Smoothing effect in Segment editor module (and experiment with different methods and parameters in it) to make the geometry more regular. You can also further smooth the mesh and reduce number of polygons when you create the 3D closed surface representation (by adjusting parameters in Segmentations module, Representations section, Closed surface row, Update button).

You can also generate tetrahedral mesh of the vasculature directly from the segmentation, using Segment Mesher extension (that uses Cleaver2 or TetGen internally).

What is your end goal? Finite-element analysis, direct 3D printing, 3D printing of mold, …?

---

<div class="post-metadata">

**Author:** ![giuseppe.cardone](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@giuseppe.cardone](https://discourse.slicer.org/u/giuseppe.cardone)\
**Post date:** [January 16, 2018, 4:31pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/5 "2018-01-16T16:31:53Z")

</div>

My final goal is the 3D printing of the vein but smoother and more regular (not a lot of variation of the lumen)

---

<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:** [January 16, 2018, 6:35pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/6 "2018-01-16T18:35:25Z")

</div>

This video tutorial may help:

> [@New video tutorial for Segment editor - lumbar spine segmentation for 3D printing](https://discourse.slicer.org/t/new-video-tutorial-for-segment-editor-lumbar-spine-segmentation-for-3d-printing/700):
>
> This is the first part of a video tutorial series that teaches how to use Segment editor. This tutorial explains how to create a 3D-printable lumbar spine segment that can be used for lumbar puncture training: The video tutorial was created by Hilary Lia (PerkLab, Queen’s University), with help from @cpinter, @lassoan, @ungi. Please post your comments here about how useful this tutorial format is, what did you like/what to improve, what topics/techniques/anatomical structures you would be int…

The Smoothing effect in Segment Editor (see at 5:00 in video) can make your model more suitable for 3D printing.

---

<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:** [January 16, 2018, 7:30pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/7 "2018-01-16T19:30:39Z")

</div>

> [@giuseppe.cardone](#):
>
> not a lot of variation of the lumen

Smoothing should fix that. You can also use VMTK extension’s level set segmentation to get a nicely smoothed vessel wall.

If you want to print a shell (so that you can try placement of intravascular devices) then you can create that easily in Segment Editor:

- Go to Logical operators effect, set Overwrite other segments = None in Masking section (to allow segments to overlap)
- Create a new segment and copy the existing vessel lumen segment into it
- Grow the new segment using Margin effect, by as much as shell thickness you would like to have
- Subtract the original vessel lumen segment from the enlarged segment using Logical operators effect

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/4/8405f57a90dfa8eaccc0e38def2a4ccfe9ad9bc7.jpeg)

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/c/bc346556c9f910909258adf83dcb8859433201bc.png)

---

<div class="post-metadata">

**Author:** ![giuseppe.cardone](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@giuseppe.cardone](https://discourse.slicer.org/u/giuseppe.cardone)\
**Post date:** [January 16, 2018, 8:18pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/8 "2018-01-16T20:18:26Z")

</div>

Thank you!  
This will be very useful!

---

<div class="post-metadata">

**Author:** ![giuseppe.cardone](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@giuseppe.cardone](https://discourse.slicer.org/u/giuseppe.cardone)\
**Post date:** [January 16, 2018, 8:19pm UTC](https://discourse.slicer.org/t/extract-contours-only-from-a-segmentation/1853/9 "2018-01-16T20:19:40Z")

</div>

Thank you! I will try!
