I am trying to get the centerline for a very intricate tree-like structure. While the centerline computation gets most of the structure, there are still branches that it does not cover despite there being endpoints on those branches. Are there any ways I can improve the coverge?
Do you use network extraction or centerline extraction?
If you use centerline extraction, you may need to move the automatically detected endpoints a bit closer (further up towards the parent branch) to make sure a path can be found to it.
You can enable “Developer mode” in application settings and then click on the “Edit” button in the “Extract Centerline” module GUI and then you can edit all the parameters.
Voronoi smoothing is not available since VTK-9.2 introduced some backward-incompatible changes, but it should not matter, as it generally just barely improved connectivity if at all.
As I am working on a big volume, it might not be possible to move all of the points manually. Can you suggest any methods to train a network to predict the endpoints better?
It should be possible to slightly adjust the automatic endpoint detection function to snap to the closest Voronoi surface point that has sufficiently large associated radius. For the implementation you can use VTK threshold filter to remove points of the Voronoi surface that has small associated radius, then use a locator to find closest point on this reduced surface. It would probably not take more than 15-20 lines of Python code in total. The script repository and Bing Chat or ChatGPT should be able to give you all the code snippets you need but if you get stuck then you can ask us here.
Wouldn’t removing points with small associated radius also remove connections of thin branch points?
Should these new points be used along with the automatic detection?
Do I simply use these new points for centerline detection or do is there any other intermediate step? I tried using just the new endpoints for the detection and also the new points combined with the automatically detected points. Each time there was barely a centerline formed and I received this error message on the console:
[VTK] vtkvmtkSteepestDescentLineTracer (0000017EAB6FA3B0): Can’t find a steepest descent edge. Target not reached.
[VTK] Warning: In vtkvmtkSteepestDescentLineTracer.cxx, line 240
[VTK] vtkvmtkSteepestDescentLineTracer (0000017EAB6FA3B0): Degenerate descent detected. Target not reached.
[VTK] Warning: In vtkvmtkSteepestDescentLineTracer.cxx, line 240
It would not remove any connections, it would only make the centerline shorter by a fraction of a millimeter.
You would add this as a preprocessing step in centerline extraction: you would not use the raw input that the user provides (that may come from manual specification or automatic endpoint detection) but first you would snap the points to the Voronoi diagram.
There might be a bug in the implementation. Could you please send a link to your github repository/branch where you added this?
I misunderstood your suggestion earlier so I have made edits now, but the application/code seems to freeze for a very long time (24+ hours) at the “markupsNode.AddControlPoint(point[0], point[1], point[2])” line.