build topograph network from skeleton
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
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, imagepy@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
Hi, I wrote some time ago: http://dip4fish.blogspot.fr/2014/05/construct-graph-from-skeleton-image-of.h... http://dip4fish.blogspot.fr/2014/06/graph-again.html http://dip4fish.blogspot.fr/2015/11/prune-iteratively-leaves-of-toy-graph.ht... https://gist.github.com/jeanpat/aac681d6b56932941281 hope this help 2017-05-18 9:12 GMT+02:00 Juan Nunez-Iglesias <jni.soma@gmail.com>:
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, imagepy@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
-- http://dip4fish.blogspot.fr/ Dedicated to Digital Image Processing for FISH, QFISH and other things about the telomeres.
participants (3)
-
imagepy@sina.com
-
Jean-Patrick Pommier
-
Juan Nunez-Iglesias