# ".vtk" surface mesh to segmentation

**URL:** <https://discourse.slicer.org/t/vtk-surface-mesh-to-segmentation/15795>\
**Category:** Support\
**Tags:** segmentation, dicom, vtk, python, 3d-model\
**Created:** [February 2, 2021, 1:11pm UTC](https://discourse.slicer.org/t/vtk-surface-mesh-to-segmentation/15795 "2021-02-02T13:11:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohand24](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@rohand24](https://discourse.slicer.org/u/rohand24)\
**Post date:** [February 2, 2021, 1:11pm UTC](https://discourse.slicer.org/t/vtk-surface-mesh-to-segmentation/15795/1 "2021-02-02T13:11:18Z")

</div>

Operating system:Mac OS Catalina 10.15.7  
Slicer version: 4.13.0-2020-12-16 r29527 / d63012c

Hi,

I have a DICOM series and “.vtk” segmentation files (yellow) in the image.  
I am able to load these files only as models.

How do I convert these surface meshes to segmentations.  
**Note:** These are **not closed** surface meshes.

 ![Screen Shot 2021-02-01 at 9.11.47 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/9/09cd382fb4faae7b1ae738f790d540474fdb72cf.jpeg) ![Screen Shot 2021-02-01 at 9.12.31 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/b/6bd7ace99a8b915bfc23ae0b262529f5c8a6f7db.jpeg)

Attached below is the pyvista visualization of an example mesh.

 ![Screen Shot 2021-02-01 at 9.16.23 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/5/0581073040e90fe35eaf250b25dfedafed557a84.jpeg)

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:** [February 2, 2021, 1:24pm UTC](https://discourse.slicer.org/t/vtk-surface-mesh-to-segmentation/15795/2 "2021-02-02T13:24:07Z")

</div>

Reconstructing a surface from closed curves is not a trivial operation.

Are the curves all planar? Are the planes parallel? Then you can import them by installing SlicerRT extension and doing the same as it is done in the OsiriX ROI importer:

> <https://github.com/PerkLab/SlicerSandbox/blob/master/ImportOsirixROI/ImportOsirixROI.py#L276-L281>

If curves are on arbitrarily oriented planes then it is more complicated but even then there are many options available to reconstruct. For example, you can straighten the centerline using Curved Planar Reformat module (in Sandbox extension) and import the parallel contours as segmentation, then warp it back using the reformatting transform to the original geometry. Alternatively, you can rasterize each contour to a binary labelmap and then use Volume reconstructor (in SlicerIGSIO extension) to reconstruct a Cartesian segmentation volume from the oblique slices.
