measuring the longest thread of a skeleton

Juan Nunez-Iglesias jni.soma at
Wed Nov 18 01:26:30 EST 2015

Hey Arctic! =)

This is probably overkill, but you could build a networkx graph of the
pixels of the skeleton using a variation of this recipe:

You will need every pixel of the skeleton to be its own label. You can get
this by using the np.arange function and setting to zero every pixel not in
the skeleton.

and then use networkx's diameter function to find the length of the longest
path in the graph:

I hope that's a good enough outline to get you where you want to go! But
post back to the list if you need more detail... Just a bit stretched for
time right now.


On Wed, Nov 18, 2015 at 2:22 PM, Arctic_python <ejsaiet at> wrote:

> Hello,
> Anyone has suggestions for an algorithm to measure the length of a
> skeleton line/thread(e.g
> The context- I skeletonize a shape to infer its length.
> Thanks
> --
> You received this message because you are subscribed to the Google Groups
> "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scikit-image+unsubscribe at
> For more options, visit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the scikit-image mailing list