Extract centerline curves in two disconnected branches

Hi! I have been using the ExtractCenterline module in 3D slicer to extract centerlines in a vessel structure. The original segmentation that I have has a small part of a large vessel, from which multiple branches of small vessels stem. As I only want to extract centerlines in the small vessels, and I want to ensure that the endpoints or branching points are completely inside the small vessels, I manually defined the endpoints (“final_endpoints_15/16”) from which the centerlines should grow. After running the algorithm, I found that the centerline model (thick green lines) is correct, but the centerline curves were only extracted for one branch. Is there any way to extract the curves in the other branch as well? Thanks!

Hi! @mikebind @lassoan I was wondering if you guys or other experts have any thoughts on this question?

I don’t have experience working with much with branching trees with VMTK. However, could you just run the analysis twice, once with final-endpoints-16 as the source and F-10, F-11, and F-12 as the endpoints and then once with final-endpoints-15 as the source and the rest of the tips as endpoints?

I believe @chir.set is an expert VMTK user, perhaps they can weigh in?

Do ‘final_endpoints-x’ and ‘F-x’ belong to the same point list?

It seems that the centeline model(s) have been generated from 2 different point lists. If ‘final_endpoints-x’ and ‘F-x’ belong to the same point list, ‘final_endpoints-15’ and ‘final_endpoints-16’ should have been connected by the centerline.

Curves are generated by ‘Extract centerline’ as a consequence of the centerline model. If the left centerline tree has been generated independently from the the right centerline tree, are you meaning that ‘Extract centeline’ created centerline curves for the right tree and not for the left? Please clarify the steps that led to this image.

For simplicity, I would have created a point list for the right tree well identified by consistent labels, a second one for the left one, and process them separately.

Can you share the data as an MRB file?

2 Likes

The forum does not allow me to upload an MRB file, so I’ve saved the scene as an MRB file and uploaded here.

Please clarify the steps that led to this image

I created this segmentation and the ‘F-x’ endpoints using my own script outside Slicer and loaded them into this scene. The two ‘final_endpoints-x’ endpoints were then added manually on Slicer. Because when I created the ‘F-x’ endpoints I named the points as ‘F-x’ but saved them as ‘final_endpoints.json’, when I added two more endpoints on slicer to the same list, they were automatically named as ‘final_endpoints-x’. Therefore, to answer your question, ‘final_endpoints-x’ and ‘F-x’ do belong to the same point list.

After manually placing the two extra endpoints, I toggle selected them as source (thus they appear blue), and I used the ExtractCenterline module to extract the centerline model and centerline curves. The left centerline tree and the right centerline tree were generated at the same time, and on the ‘subject hierarchy’ panel they belong to the same node named ‘centerline model’. I don’t know why they were not connected as you said they should – possibly because I selected two endpoints as source?

However, after generating the centerline model, the centerline curves were only extracted for the right tree. Hence the question that I posted.

It will certainly work if I define the endpoints for the left and right trees in two separate endpoint lists. However, I want to automate the endpoint detection as much as possible as I need to repeat similar procedure for many files, and since the branches all belong to the same segment, running automatic endpoint detection will simply get all the endpoints at once without distinguishing which one is in which branch. Thus, I was hoping that I can just manually place the two source endpoints at the bottom and grow the centerline model and curves upwards. The current ‘centerline model’ is already exactly the centerline structure that I want to extract. It’s just that the curves were not extracted fully.

Another alternative approach that I’ve tried is to split the segmentation first (detach the two branches from the base) and then run automatic endpoint detection and centerline extraction. This can work, but the user still needs to cut the segmentation, check the endpoints, select source endpoint… so it’s more tedious than my original approach where the manual part is just placing two endpoints.

I hope my explanation makes sense. I look forward to hearing your thoughts.

After simply activating ‘final_endpoints-x’ in the Markups module’s widget, ‘Extract centerline’ generated the model and the curve centerlines as expected.

As to why the activated state of control points matters, @lassoan may have some explanations. But really, just activate them.

1 Like

I see. Thanks a lot! My understanding based on some tutorial videos on youtube is that by deactivating a control point (toggle select it and make it appear blue), you are specifying it as the inlet of flow, so the centerline tree will grow from there. If no endpoint is deactivated, then the first point in this fudicial point list will be used as the inlet. However, as in my case the first point is actually ‘F-1’ which is at the top, it did not make sense to grow the tree from there based on the real physiology, so in the end I only kept ‘final_endpoints-15’ as in the inlet, and I can then do some postprocessing to remove C(18) to only keep the centerline curves in the two branches.