# Slicer - Convert centerlines to a graph {V,E}

**URL:** <https://discourse.slicer.org/t/slicer-convert-centerlines-to-a-graph-v-e/18604>\
**Category:** Support\
**Tags:** vtk, python, vmtk-centerline\
**Created:** [July 9, 2021, 3:55pm UTC](https://discourse.slicer.org/t/slicer-convert-centerlines-to-a-graph-v-e/18604 "2021-07-09T15:55:45Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![som1197](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/som1197/32/14945_2.png) [@som1197](https://discourse.slicer.org/u/som1197)\
**Post date:** [July 16, 2021, 4:42am UTC](https://discourse.slicer.org/t/slicer-convert-centerlines-to-a-graph-v-e/18604/3 "2021-07-16T04:42:25Z")

</div>

Thank you @lassoan for the piece of code. Yes I will send out a pull request with the proposed changes soon.

Moreover, I also wanted to know if scalar values of **‘GroupIDsarray’, ‘TortuosityArray’ , ‘BlankingArray’** etc. can be incorporated in the centerline model. I generated the following plots by using the conventional vmtkscripts, but it does not always work correctly.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/8/882e1766835d9ccda430877ca40183bae29a5bd9.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/b/2bd69ea780065406186d299c62ef460f2e619001.jpeg)

Currently there are only 3 ways to postprocess the centerline data as shown here.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/f/efab10cb0050f2cad8831bc139d9d91baabdd09b.png)

- However, can we make any changes here in the base code to store values of other arrays as well?

- Also would it be possible to run this function independently in a separate python code given the vtkpolymesh surface data and the endpoint co ordinates?

> <https://github.com/vmtk/SlicerExtension-VMTK/blob/995027f17f195d802134f799aab095ea31f3e6c5/ExtractCenterline/ExtractCenterline.py#L635-L723>

This has been done for the network curves but the centerline curves hold the real information.

> <https://github.com/vmtk/SlicerExtension-VMTK/blob/995027f17f195d802134f799aab095ea31f3e6c5/ExtractCenterline/ExtractCenterline.py#L616-L633>

---

_[View the full topic](https://discourse.slicer.org/t/slicer-convert-centerlines-to-a-graph-v-e/18604)._
