clij / clicy

GPU-accelerated Image Processing using CLIJ in Icy
https://clij.github.io/clicy
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Gaussian Blur 2D/3D blur between channels #10

Open marionlouveaux opened 4 years ago

marionlouveaux commented 4 years ago

Hi Robert!

I noticed a few things when trying the blur 2D and blur 3D processes:

Cheers, Marion

haesleinhuepf commented 4 years ago

Hey Marion @marionlouveaux ,

I'm not sure if I understand the issue correctly. First of all, no operation has a sigma_c parameter. Actually, CLIJ doesn't know what channels are. However, if you you push a 2D 3-channel image to the GPU, it will be interpreted as 3D image. If sigma_z is then set to any value > 0, blurring between channels will happen. I'm now wondering what exactly happened. Can you share the protocol you applied?

Thanks!

Cheers, Robert

marionlouveaux commented 4 years ago

Hi Robert,

Regarding the CLIJ2 GaussianBlur2D, I applied the following protocol on the image mentionned above (image_1.tif). This image has 3 channels, but red and blue channels are "empty" (all pixel values = 0). The blurred image is "no name003" and has only one channel containing only black pixels (all pixel values = 0). Blur2D Histogram in the green channel for image_1.tif: Image1_GreenChannel Histogram in the red channel for image_1.tif: Image1_RedChannel

I also tried running the "simple_pipeline.js" JavaScript, which also performs a 2D Gaussian blur. It gives the same result (black output image, all pixel values = 0, one single channel). simplePipeline

On the contrary, when I run the Gaussian blur process from the Filter Toolbox plugin of Icy, the output image has still 3 channels and the green one is blurred. Blur2D_Icy

I also tried the "blur_frame_by_frame.js" JavaScript. It gives a blurred output image slightly more blurred than the one obtained with the Filter Toolbox plugin. BlurFrameByFrame

The function used in the "blur_frame_by_frame.js" is clij2.gaussianBlur3D(): clij2.gaussianBlur3D(inputBuffer, blurredBuffer, blur_sigma_x, blur_sigma_y, blur_sigma_c); with blur_sigma_x = blur_sigma_y = 2, and blur_sigma_c =0 in the "blur_frame_by_frame.js".

Following this and considering that the input image has only one single frame, I also tried the following protocol using the CLIJ2_GaussianBlur3DBlock with sigma_x = sigma_y =2 and sigma_z = 0, but the output is also a black image. Blur3D

Cheers, Marion

haesleinhuepf commented 4 years ago

Hey Marion @marionlouveaux ,

I think I found the issue. pushSequence was only pushing the first channel of any image to GPU memory. I just fixed that. The new version (available around Friday) reduces slices and channels in one dimension as 4D images are not supported yet. Is there a function / block in Icy like "Image>HyperStacks>Stack to HyperStack" in ImageJ?

Thanks again for your support!

Cheers, Robert