# DoG Filter

I wanted to build a 3D DoG Filter in KNIME just by using the Gaussian Convolution and Image Calculator Nodes. So I connected the inputs of two Gaussian Convolution Nodes (each with a different sigma value) to the output of an Image Normalizer Node. The next step would be to just substract both images but the image calculator node has just one input. How can I substract two images in KNIME?

Best,

Christian

Hi Christian,

the input of the Image Calculator Node in KNIME is a table and therfore if you want to do some calculations on images they have to be in the same row of the table. That's why we have only one in-port in the Image Calculator.

What I would suggest: Convolve the Image and append the results with a correct name. (Column selection -> append option with correct column suffix). The last node would be the image calculator. Or you could also use the joiner. Take care that you use the right output format in the image calculator (as some values may be negative due to the substraction).

Maybe the node "Convoluton kernel creator" and "convolver" could be interesting for you as well. There you can simply specify one (or more) kernels (which are only images as well) and use them as the input of the convolver. There you have several options:

Fourier Space vs discrete space (it separates the kernel if possible),
apply kernels iterative or just add a dimension,... etc.

I have put all three variants in an example workflow and attached it to this post.

Best,
Christian

Hi Christian,

Thanks for your example workflow. It was very helpful. But I've noticed that the result of the DoG filter in KNIME looks totally different then when I do the same operation with the same input picture in Fiji (I've attached a file so that you can check). First I assumed that the Gaussian Filters that are used must be different. In Fiji I use the Gaussian Blur 3D. But then I used the ImageJ Macro Node to do the Filtering in KNIME also with the Gaussian Blur 3D Filter and the result was still the same. After the Image Calculator Node where the subtraction is done the result looks different. I've also tried different settings in the Convert Image node that you used in your example workflow but I couldn't get a consistent result. Any idea why there is this difference?

Best

Christian

Hi Christian,

I just had a look at FIJI. The Smoothing is the same, but the Image Calculator differs. Actually not the Image Calculation, but the way the result is stored. If you select "FloatType" as result type from the image calculator in FIJI then you get the same results. The reason is, that without checking "FloatResult" seems to clip the values below zero or greater than the maximum value of your image type (mostly 128 for bytetype or 255 for unsignedbytetype).

You could reproduce this behaviour if you convert your image to "unsignedbytetype" but select "clip" as conversion method in the image converter (the one right after the image calcualtor in KNIME).

In KNIME we can handle negative pixel values (which may result because of the substraction) per default, as we use ImgLib2 in the background and select a appropriate outputformat in the image calculator. That's why the image appears to be different, but actually the information you get is the same. In the case of ByteType for example, the value -128 is mapped to black, zero to somehow grey and 127 to white.

Have a nice sunday,

Christian

You guys are nice here.

I'm agreen hand, so maybe I would ask you for help later.

BTW, who knows something about the image processing?

A friend online told me to download a free trial of its image converter first. But I don't know how to choose.

But if you have no idea, it doesn't matter. I will try it by myself later.

I should use a SDK or a program?

However, I prefer the former one which is simpler and faster in its way of processeing.

Best regards,

Arron

Hi Arron,

unfortunately I don't know the yiigoo Software, so I can't help you out with this. But if you have any questions related to the KNIME Image Processing Extension or you need some advice how to analyze your data, we would be happy to help you!

Cheers,

Christian

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.