# VMTK automatic centerline and export control points as XYZ coordinates

**URL:** <https://discourse.slicer.org/t/vmtk-automatic-centerline-and-export-control-points-as-xyz-coordinates/33841>\
**Category:** Support\
**Tags:** python, vmtk, vmtk-centerline\
**Created:** [January 17, 2024, 7:52pm UTC](https://discourse.slicer.org/t/vmtk-automatic-centerline-and-export-control-points-as-xyz-coordinates/33841 "2024-01-17T19:52:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RD\_morph](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@RD\_morph](https://discourse.slicer.org/u/RD_morph)\
**Post date:** [January 17, 2024, 7:52pm UTC](https://discourse.slicer.org/t/vmtk-automatic-centerline-and-export-control-points-as-xyz-coordinates/33841/1 "2024-01-17T19:52:06Z")

</div>

Operating system: Windows 10  
Slicer version: 5.6.1  
Expected behavior: Use the ExtractCenterline.py code to automatically generate centerlines for existing models and export XYZ control points of centerlines  
Actual behavior: Trying to run the .py code in slicer python console results in nothing happening

Hi all - I have a few thousand models (meshes created in a different software) for which I need to generate centerlines and then obtain the XYZ coordinates of the control points of each centerline. I can execute this manually but was hoping to streamline to process due to the large volume of models.

I have attempted to automate the process by running the [VMTK extract centerline code](https://github.com/vmtk/SlicerExtension-VMTK/blob/3787ea4a300da28ec5f0824f0715f2713b631155/ExtractCenterline/ExtractCenterline.py#L378) with no success. I have gone through many topics here to solve my problem but nothing has worked. I’m a fairly novice coder (mostly Python) and the existing code is well beyond my understanding. I had a ton of errors initially but seemed to resolve them by downloading/fixing some .py files that were not included in the imported packages. Now, when I try to run code in the console literally nothing happens - the code just turns grey. I also attempted [this code](https://discourse.slicer.org/t/automatic-centerline/14829/23) but have yet to successfully debug it on my end.

How do I get the extract centerline code to actually run in the console? And is this process even any faster than the manual process? It seems like I will have to manually export the control point coordinates regardless of automation. I apologize if this is a very basic question - I’m not sure what I’m missing here.
