masadcv / FastGeodis

Fast Implementation of Generalised Geodesic Distance Transform for CPU (OpenMP) and GPU (CUDA)
https://fastgeodis.readthedocs.io
BSD 3-Clause "New" or "Revised" License
90 stars 14 forks source link

Fix bug in local Euclidean distance calculation for fast implementation #41

Closed masadcv closed 1 year ago

masadcv commented 1 year ago

As reported in #40 , the only Euclidean case appeared to be computing taxicab distance.

On closer look, it came down to bug in local distance calculation

This PR attempts to fix this.

masadcv commented 1 year ago

Using the code from #40 with modification to add GeodisTK results, here is comparison of 3d Euclidean distance with the bug: fig

And here are results with fixes from this PR: figa

With the PR, the Euclidean distances improve and is in-line with Euclidean distance from previous raster scan methods (e.g. using GeodisTK). It, however, is an approximation and unavoidable artifacts are present which are due reliance of these methods on iterative raster scans for distance transform computation