# converting dicom dataset into vtp file

**URL:** <https://discourse.slicer.org/t/converting-dicom-dataset-into-vtp-file/20867>\
**Category:** VMTK\
**Tags:** dicom, vmtk\
**Created:** [December 1, 2021, 5:21pm UTC](https://discourse.slicer.org/t/converting-dicom-dataset-into-vtp-file/20867 "2021-12-01T17:21:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![khater](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@khater](https://discourse.slicer.org/u/khater)\
**Post date:** [December 1, 2021, 5:21pm UTC](https://discourse.slicer.org/t/converting-dicom-dataset-into-vtp-file/20867/1 "2021-12-01T17:21:03Z")

</div>

i just started using vmtk on python ( windows operating system) and i want to use the vmtkcenterlines but the problem is that vmtkcenterlines uses .vtp file and i didn’t find any tutorial to help converting dicom files into vtp files.  
how can i change a .dcm file to .vtp file?

thanks in advance

---

<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:** [December 2, 2021, 4:24pm UTC](https://discourse.slicer.org/t/converting-dicom-dataset-into-vtp-file/20867/2 "2021-12-02T16:24:43Z")

</div>

You need to segment the DICOM image before you can extract centerline. Vessel segmentation of very well contrasted large vessels can be trivial, so that you can use any of the automatic segmentation methods (thresholding, region growing, fast marching, etc.). However, for most images you need to use a a combination of a few semi-automatic segmentation tools, such as those implemented in 3D Slicer’s Segment Editor ([this page](https://slicer.readthedocs.io/en/latest/user_guide/image_segmentation.html) is a good starting point).

Once you have the segmentation, you can export it to a polygonal mesh (.vtp file) and automatically extract centerline.

Here is a short video of a typical vessel segmentation and centerline extraction workflow:

[![](https://img.youtube.com/vi/caEuwJ7pCWs/maxresdefault.jpg "Vessel segmentation and centerline extraction using 3D Slicer and VMTK") ](https://www.youtube.com/watch?v=caEuwJ7pCWs)

---

<div class="post-metadata">

**Author:** ![khater](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@khater](https://discourse.slicer.org/u/khater)\
**Post date:** [December 3, 2021, 3:22pm UTC](https://discourse.slicer.org/t/converting-dicom-dataset-into-vtp-file/20867/3 "2021-12-03T15:22:38Z")

</div>

Dear Mr. Lasso,  
thank you so much for your help and I’ll definitely check it out.
