seung-lab / euclidean-distance-transform-3d

Euclidean distance & signed distance transform for multi-label 3D anisotropic images using marching parabolas.
GNU General Public License v3.0
234 stars 37 forks source link

Bug in simple 2x2 input #41

Closed M-Wieler closed 2 years ago

M-Wieler commented 2 years ago

This package looks very helpful, but I think I found a bug with my first example:

>>> edt.edt(np.array([[1,1], [2,1]]))
array([[      inf, 1.4142135],
       [1.       , 1.       ]], dtype=float32)

Version 2.1.2 Installed from .whl Windows 10

william-silversmith commented 2 years ago

Thanks for reporting! I'll look into this.

william-silversmith commented 2 years ago

I think I found the issue. There was an off by one error when considering the very last pixel in a column. Just when I was starting to think this library was totally bug free. Ha. I'll release a fix tomorrow.

william-silversmith commented 2 years ago

Here's the fix: https://github.com/seung-lab/euclidean-distance-transform-3d/commit/b06636dc50d7a8d90144910240eedab5c1bedab6

M-Wieler commented 2 years ago

Thanks a lot. Will you release it as version 2.1.3?

william-silversmith commented 2 years ago

Yes, 2.1.3 is building now. It'll be released in an hour or so!