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

[BUG] Clean up and improve pixel queue code #46

Open masadcv opened 1 year ago

masadcv commented 1 year ago

Describe the bug

Clean up and improve code for pixel queue method as described in the comment here:

For clarity, it may be good to clean up a bit the pixel queue implementation. Maybe adding some comments to refer back to the algorithm described in https://doi.org/10.1016/j.patrec.2006.10.010

Also, I would replace the hand-crafted heaps by a standard use of a std::priority_queue: https://en.cppreference.com/w/cpp/container/priority_queue

tvercaut commented 1 year ago

The state values should also be changed to enum for clarity: https://github.com/masadcv/FastGeodis/blob/c8c51a9e122b40e86ee4bd908047d38a82f5247f/FastGeodis/geodis_fastmarch.cpp#L178-L180

masadcv commented 1 year ago

Also add better unittests as indicated here: https://github.com/masadcv/FastGeodis/issues/42#issuecomment-1495002424 And also include pixelqueue method in all sample code provided.