# Automatic endpoint selection outside of surface module

**URL:** <https://discourse.slicer.org/t/automatic-endpoint-selection-outside-of-surface-module/17037>\
**Category:** VMTK\
**Created:** [April 12, 2021, 10:40am UTC](https://discourse.slicer.org/t/automatic-endpoint-selection-outside-of-surface-module/17037 "2021-04-12T10:40:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![perecanals](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/perecanals/32/9006_2.png) [@perecanals](https://discourse.slicer.org/u/perecanals)\
**Post date:** [April 12, 2021, 10:40am UTC](https://discourse.slicer.org/t/automatic-endpoint-selection-outside-of-surface-module/17037/1 "2021-04-12T10:40:38Z")

</div>

Hi,

I am trying to extract centerlines from vascular models using the automatic endpoint selection from the VMTK module in Slicer, and in some cases (I’d say in about 10-20% of cases) I come across an error which gets the centerline computation stuck:

```
Warning: In /Volumes/D/S/S-0-build/VTK/Common/DataModel/vtkPolyData.cxx, line 993 
vtkPolyData (0x7fe922612940): Building VTK_LINE 15 with only one point, but VTK_LINE needs at 
least two points. Check the input.

```

Investigating this issue, I found that this happens when at least one of the endpoints is placed outside of the volume closed by the surface model of the vascular structure in a given case, and I can avoid the issue by manually placing the problematic endpoint/s inside of the model. However, I want to keep the whole process automatic. Is there a way to fix that?

Thank you,

---

<div class="post-metadata">

**Author:** ![perecanals](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/perecanals/32/9006_2.png) [@perecanals](https://discourse.slicer.org/u/perecanals)\
**Post date:** [April 12, 2021, 4:41pm UTC](https://discourse.slicer.org/t/automatic-endpoint-selection-outside-of-surface-module/17037/2 "2021-04-12T16:41:32Z")

</div>

Of course, I meant surface model\* in the topic. Sorry about that.
