clEsperanto / pyclesperanto_prototype

GPU-accelerated bio-image analysis focusing on 3D+t microscopy image data
http://clesperanto.net
BSD 3-Clause "New" or "Revised" License
208 stars 44 forks source link

Morph snake smoothing #296

Open grahamross123 opened 1 year ago

grahamross123 commented 1 year ago

Hi, I've added superior_inferior and inferior_superior functions as used in the smoothing process in scikit-image morphsnakes.

There's one issue with the tests for both 2D and 3D:

If there are pixels adjacent to the image boundaries, the scikit-image implementation and my implementation differ. I think this is due to the opencl kernel taking pixels outside the image boundary as 1, whereas it should be 0.

You can see this in the final example in the notebook.

Is there an easy way to fix this problem in the opencl kernel?

Thanks, Graham

grahamross123 commented 1 year ago

@haesleinhuepf Here's the pull request I mentioned!