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

Path from parents does not work for 2d data #24

Closed yanlend closed 3 years ago

yanlend commented 3 years ago

path_from_parents implicitly assumes 3d input data and fails for 2d data. The code access shape[2] argument even though ndim is only 2.

This might be an easy fix to check for the dimensionality of the input array, and the related functions seem to support both 2d and 3d input.

william-silversmith commented 3 years ago

Hi, I wrote a fix for this issue. Thanks for reporting! Would you mind taking a look and checking that it performs the way you expect? Thanks!

yanlend commented 3 years ago

Sorry did not have time on short notice to compile and test it.

Thank you for the quick fix!