Extract CenterLine - Start in py


I have two points and a segmentation and I would like to obtain the center line. I did that using the extension VMTK and now I would like to do this in my phyton script, just like an other part of my process.

Can I use slicer.modules.extractcenterline.logic() for that? How? Can anybody share un example to guide me? I saw the extratcenterline.py but Im really lost.

Thanks, Lucas.

If your script runs inside Slicer, you can get the logic class this way :

import ExtractCenterline
extractCenterlineLogic = ExtractCenterline.ExtractCenterlineLogic()

It contains everything you need to work with your inputs.

1 Like

Hi Chir, once again thanks for your help. I used the same logic to use the module CurvedPlanar and it worked very well.