How can I extract voxel indices of points along a tubular segmentation obtained by Draw Tube?

Hi everyone!

I am trying to create synthetic Catheter insertion data.

First I create synthetic catheter label inside CT via segmentation by Draw Tube as shown below:

After that, I convert it to Binary Label Map.
I would like to crop this label map by following the curve along control points iteratively such that it looks like the insertion of the catheter as below GIF:

I could extract the world coordinates of the control points I used in Draw Tube and I also tried Extract Centerline. The latter gave me world coordinates of the points along the curve but I could not figure out how I can crop label maps according to those coordinates.

TL;DR: I am trying to order voxel indices in a binary label map according to their positions along the curve.

I would appreciate any hints, thank you!

You can use fast marching algorithm to create a distance map. You can then simply extract a binary image of a given catheter length using global thresholding.

However, a catheter is not solid but a thin shell, often with one or few ring markers near the tip. You can simulate them more realistically by rendering as a semi-transparent surface instead of a volume.

Dear Andras Lasso,

Thank you very much for your answer!

Would it be possible to a bit further explain how to use the fast marching algorithm for this purpose?

Would the steps be like this: convert world coordinates of the center line to voxel coordinates => calculate distance map for surrounding voxels with fast marching algorithm => obtain binary mask with threshold?

Is it the method of how tubular shape is segmented in Slicer with draw tube in segment editor extra effects?

Thank you for your suggestion! However, I am using deepDRR to simulate catheters by using a volume mask which looks like below:

I am trying to create synthetic Xray images of catheter insertion by sampling volume mask along the centerline.

Thank you.