Hi YXDragon!

Coincidentally, I have been working on a package to do just that, which I have 
imaginatively-called “skan” (for SKeleton ANalysis). It runs lightning quick 
using Numba, and works with n-D skeletons. It’s available on pip (pip install 
skan) and conda-forge (conda install -c conda-forge skan). The source code is 
on github (github.com/jni/skan).

The interface is a little fiddly currently but you should be able to figure it 
out. The functions you want are skan.csr.skeleton_to_csgraph (produces a 
pixel-to-pixel graph in scipy.sparse.csr_matrix format) and skan.csr.summarise 
(produces a pandas DataFrame with nodes and arcs, including coordinates in the 
image, arc distances, and euclidean distances). You just need to provide the 
skeleton.

I hope this helps! Feedback on the API is much appreciated!

Juan.

PS: Oh yeah, you might want to look at my Numba post, which described part of 
the development of this library: 
https://ilovesymposia.com/2016/12/20/numba-in-the-real-world/

On 18 May 2017, 1:08 PM +1000, imag...@sina.com, wrote:
>  Hi everyone:
>     I saw the newest version, require the networkx module. I find some 
> function to find shortest path from image. But I want to know if there is a 
> method to build a network from a skeleton image(2D/3D with arcs and nodes). I 
> wrote one, but in python. it runs very slowly...
>                                        yxdragon-imagepy
> _______________________________________________
> scikit-image mailing list
> scikit-image@python.org
> https://mail.python.org/mailman/listinfo/scikit-image
_______________________________________________
scikit-image mailing list
scikit-image@python.org
https://mail.python.org/mailman/listinfo/scikit-image

Reply via email to