Calculate total length of 3d skeleton

Hello,

I have hundreds of images with different z-dimensions and have generated 3d skeletons for each via skimage.morphology. skeletonize_3d

I’d like to extract the total path length of these skeletons and was wondering if anyone could provide any help or guidance on how to go about performing this analysis that accounts for z-anisotropy? Once I have the total lengths for each skeleton I will normalize to the volume of the images.

I apologize if this is a super basic question, but thank you nevertheless.

Happy holidays!

Have a look at https://jni.github.io/skan/, in particular skan.Skeleton which has a spacing parameter. For each image, you would do:

path_length_table = skan.summarize(
        skan.Skeleton(skeleton_array, spacing=[5, 0.48, 0.48])  # for example
)

for example. The table is a pandas dataframe and contains the path length for each skeleton branch, so you can simply take the sum of that column.

It’s not super basic, skan isn’t that well known yet. It’s not in scikit-image because we didn’t want to depend on numba and pandas. It’s also a lot less polished. Contributions are super welcome at github.com/jni/skan!

2 Likes

Great, thank you! I’ll have a look at it.

Totally understandable that it is not in scikit-image. I think something similar to these functions in your package would be nifty and extremely useful to have in skimage to build off of its skeletonize functions. Similar to Analyze Skeleton in Fiji I guess.

Nevertheless, thanks a bunch!