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
213 stars 46 forks source link

Read 0 outside image (instead of clamp-to-edge) #302

Open haesleinhuepf opened 1 year ago

haesleinhuepf commented 1 year ago

We should be able to read pixels outside the image as 0 . Problem: This is not officially defined by the opencl standard. Furthermore, a code section relevant for this is commented out. I think I remember that this didn't work on specific hardware: https://github.com/clEsperanto/pyclesperanto_prototype/blob/efb38e99984b38ecf3141a63372989cee154958b/pyclesperanto_prototype/_tier0/preamble.cl#L36

Anyway, it would be great to have some specific kernels read 0 outside the image.

StRigaud commented 1 year ago

I think this should be an Issue for the kernel repo and be addressed in the preamble / OpenCL management, with possible an option defined at runtime.

Right now, the border effect correspond to the nearest mode ( aaaa | abcd | dddd ).