It seems that the generated centerline does not start and end from the endpoints I give it, but it is as if it is cut before. Any idea?
That is expected behavior.
but I need the centerline from the two assigned points. I am missing a part because it is not totally attached to the assigned points.
The problem is that the endpoints you provided are not on the “centerline” of the object you provided. The centerline returned by VMTK runs along the voronoi medial surface of the object. The endpoints you chose are not on this surface. I assume the physical object you are interested in extends beyond the two flat faces that you put the endpoints on, but those are the boundaries of your image. You could try adding two cylindrical extensions to those faces (one for each face) with your endpoints at the center of the cylinder face against the object, and then run centerline extraction on the augmented object. The extensions should ensure that your endpoints then lie on the voronoi medial surface, and you can see if the extracted centerline will work for you as desired.