-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLAHE #306
Comments
Hi @haesleinhuepf , I have made a pyopencl kernel for 3D clahe: https://github.com/HugoRaveton/pyopencl_clahe, it only works for 8-bit 3D stacks for now. |
Hi @HugoRaveton , oh fantastic! If you're interested, we can make it part of pyclesperanto! Either you send a pull-request like this one or you add an open source license to your code (BSD, MIT, Apache or similar) formally allowing otgers to copy and reuse your code. As you wish! After some testing and modifications, we would also incorporate your code into the next incarnation of pyclesperanto, which requires writing some C++ code here. That's not necessarily a task you. I'm just saying @StRigaud and me are highly interested in getting smart algorithms such as CLAHE into our code base. Thus, big thanks for reaching out! Let us know how to proceed. |
Hi @HugoRaveton, that looks really great! You can test your pure OpenCL kernel with the new Like @haesleinhuepf said, we can integrate it to the library or, if you prefere, we can guide and help you to do it 😄 .
The |
Hi @StRigaud and @haesleinhuepf, I have added an MIT open license to the repo so you are free to integrate it into pyclesperanto. I will try to get it to work with any bit depth soon. I would also be interested in contributing directly to the library, let me know if I can help! |
No need for that, we will do this when integrating it in pyclesperanto. It's a no-brainer within our infrastructure. We'll show you. Big thanks! Best, |
Ok nice thanks! Excited to see it work in pyclesperanto.
On June 16, 2024 7:25:18 PM GMT+02:00, Robert Haase ***@***.***> wrote:
> I will try to get it to work with any bit depth soon.
No need for that, we will do this when integrating it in pyclesperanto. It's a no-brainer within our infrastructure. We'll show you.
Big thanks!
Best,
Robert
--
Reply to this email directly or view it on GitHub:
#306 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
Hugo Raveton
|
Hi @HugoRaveton FYI i made a fork of your repo and i updated your kernel using clesperanto opencl keywords. I let you have a look, if you wanna do more kernel 😉 . Very minimal work here, simply replacing how we read/write in the images and update the input parameters not needed (width, height, depth. etc.). This enable the kernel to be directly called in pyclesperanto which I demonstrate this notebook. Seems to work like a charm 🚀 ! I still need to see how to manage the bit depth but otherwise, it can be integrated easily in clesperanto |
It would be great if we could get an OpenCL-Version of the CLAHE algorithm
https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE
Therefore, we might need to do a local histogram for every pixel. The entropy kernel does that too:
https://github.com/clEsperanto/clij-opencl-kernels/blob/master/kernels/entropy_3d_x.cl
This Metal kernel might be translatable to OpenCL (license: MIT):
https://github.com/MetalPetal/MetalPetal/blob/master/Frameworks/MetalPetal/Shaders/CLAHE.metal
See also:
The text was updated successfully, but these errors were encountered: