seung-lab / dijkstra3d

Dijkstra's Shortest Path for 6, 18, and 26-Connected 3D (Volumetric) Image Volumes
GNU General Public License v3.0
71 stars 13 forks source link

feat: adds dijkstra.railroad #33

Closed william-silversmith closed 3 years ago

william-silversmith commented 3 years ago

A "rail road" (a term defined by us) is the shortest last-mile path (the "road") from a target point to a "rail network" that includes the source point. A "rail" is a zero weighted path that acts as a strong attractor for the search algorithm. In the context of the skeletonization problem, such networks are assembled as a matter of course. It becomes more and more efficient to search for the rail network than for the target point.

path = dijkstra.railroad(field, source=(0,0,0)) # the path will be to the nearest 0 valued voxel