measuring the longest thread of a skeleton

Juan Nunez-Iglesias jni.soma at gmail.com
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:
http://ilovesymposia.com/2014/06/24/a-clever-use-of-scipys-ndimage-generic_filter-for-n-dimensional-image-processing/

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:
https://networkx.github.io/documentation/latest/reference/generated/networkx.algorithms.distance_measures.diameter.html

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.

Juan.

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

> Hello,
> Anyone has suggestions for an algorithm to measure the length of a
> skeleton line/thread(e.g
> http://scikit-image.org/docs/dev/auto_examples/plot_skeleton.html)?
> 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 googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20151118/406ca009/attachment.html>


More information about the scikit-image mailing list