Problem with Image Writer Node

Dear All,

I am a beginner user of KNIME. This platform seems perfectly suitable for the image processing that I am planning to do, so I am very excited about trying to learn it more thoroughly.

However, so far I haven't been successfull in carrying out very basic operations.... I am trying to read an image, threshold it on multiple levels, and then save the thresholded file as a .tiff file. To do this, I used the Image Reader node, the Multilevel Thresholding node, followed by the Image writer node. 

The workflow seems to work without errors, however, the resulting 'images' are completely black. In the Multlevel Thresholding node I checked the images using 'Image viewer' (in the right-click menu), which shows a 2-column table with left the filename and right "Image"column displaying the the black images. When I double-click the on one of the black images, a new window opens, showing the correct, thresholded image. Therefore, it appears as though this node is carrying out the work OK. I noticed that within this window the file type is denoted as 'UnsignedByteType'. I have no clue what that means though.

I guess I am missing a file conversion node, or that I am doing something wrong with the Image Writer node....however, I have tried a lot of different things, without succes. 

Can anybody help me solving this (possible very simple) problem?

thanks in advance,
bart

 

Hi Bart,

I am very happy that you have found KNIME and are excited to use it for image processing.

The cause for your problem is that your image needs normalization. The output of the Multilevel Thresholding node is not normalized, you can see this in the image viewer when you unckeck the Normalize checkbox. You can perform a normalization with the Image Normalizer node.

best,

Gabriel Einsdorf

Hi Gabriel,

this indeed solves the problem with writing the file, but it doesn't make a difference for the thumbnail output of the Multilevel Thresholding, which still shows a fully back image until someone double-clicks on it and goes into the detailed view.

Shouldn't the preview normalize the output by default, like in the detailed view, so the thumbnails are actually useful and don't appear just black? Normalizing the input to the Multilevel Thresholding node doesn't seem to make a difference.

Or am I missing something here?

Cheers,
Marco.

 

 

Hi Bart,

I believe this is a known bug (last finding where only the minimum/maximum levels are brought to the output):

https://github.com/knime-ip/knip/issues/325

Hopefully it will be solved soon.

Apparently the output of the Multilevel Thresholding node requires normalization in order to be written correctly to an output file with the Image Writer node. I would suggest this important remark to be added to the node documentation.

Cheers,
Marco.

Hi Marco,

There is currently no normalization for thumbnails in KNIP at all. It is something to consider though, you can follow our discussion on that topic here: https://github.com/knime-ip/knip/issues/396

best,

Gabriel

Hi all,

Just to avoid any misunderstanding: The Image Writer doesn't need any "Normalization" prior to writing images. Sometimes the images which should be written by the image writer have to be converted to a supported image type (e.g. UnsignedByteType, FloatType etc), but `Normalization` only changes what will be written!!

The normalization is a different problem (in addition to what gab1one wrote): If you have an image with let's say `UnsignedByteType` which means, that each pixel can take values from 0-255 and you only have three values (`0`, `1` and `2`), then the image will be displayed as black as the minimum value is interpreted as black and the maximum is interpreted as white. To visualize the image you have to use the `Image Normalizer` prior the the `Image Viewer` or just check the `normalize` image button the `Image Viewer`.

Three more notes:

* Most of the KNIME Image Processing nodes has a Image Viewer component attached (Right Click -> Image Viewer).

* We have > 35 example workflows and tutorials explaining some of the priniciples I described in my post. If you want to understand more about the topics, you can log into the Example Server / Community / 01_Image Processing :-)

* We have a KNIME Image Processing Tutorial preprint. I can send it to you via E-Mail. Just send me a message to christian.dietz@uni-konstanz.de and I will reply!

I hope this helps,

Christian

Christian,

many thanks for the additional explanation. I think this makes it much clearer, at least to me.

I believe part of the misunderstanding comes from the fact that the Multilevel Thresholder does not simply determine the best cut point in the orignal histogram as I assumed, but also remaps the value of the pixels in the image to the specified number of levels (say from 256 to 3), with 0 being the black and 2 being the white (levels compression).

Since the thumbnail viewer does not normalize the image but looks at the original number of levels depending on the image type, the three new levels appear as black because they are indeed close to black in the original 0-255 level pixel scale. Once you move into the Image Viewer and click Normalize, the levels are brought back to the 0-255 range and the white/gray/black are visible.

I may be a bit picky, but seen from a user stand-point it would be useful if the description of the node contained a brief explanation of what was just clarified. I believe this would flatten a bit the learning curve.

I would love to receive a copy of the tutorial, I will write to you separately.

Cheers,
Marco.

 

Hi all,

I agree that the current behavior isn't the easiest to get for new users. Improving both image viewer and thumbnail creator to offer reasonably normalized views (also for multi-dimensional data) will definitely help.

On the other hand, I'd like to suggest adding an option to the Multilevel Thresholding node to fill regions with their mean intensity, similar to the option in the option "showAverages" in the Statistical Region Merging plugin for ImageJ (see image attached).

What do you think?

 

Christian, if you could send me a copy of the preprint tutorial as well, I'd appreciate it :)

 

Cheers,

Jan

PS: when will KNIME finally switch to a usable forum software? The current forum is such a pain when it comes to searching old replies, or pasting images into posts...

PS: when will KNIME finally switch to a usable forum software? The current forum is such a pain when it comes to searching old replies, or pasting images into posts...

It's on the list!

About the normalization of thumbnails:

https://github.com/knime-ip/knip/issues/359

also on the list :-)