Problems with Image Cropper using recent version of KNIME

Within a workflow I am using the Image Cropper node controlled via a variable. After installing a recent version of KNIME including KNIME Image processing on a new computer, the Image Cropper gives me either wrong crops or no image at all. A short example of the problem is: workflow
Output correct:
table_correct
KNIME version producing correct table:

Output incorrect:
table_problem
KNIME version producing incorrect table:

Example KNIME workflow and table: example data.zip (27.7 KB)

Thank you for your help.

Good catch, @aklemm!

I think the issue here is actually not in the Image Cropper, but with both the thumbnail generation and the image viewer: when I click the ? cells in the image viewer table, the correct dimensions are shown in the sliders (X and Z, or Y and Z, respectively), but no image is rendered.

@dietzc, @gab1one any idea?


EDIT: The problem might also be related to offsets. Using the Image Properties, I just noticed that your input image has offsets [424,155,0], and the resulting cropped image (xz) has [424,0]. When I uncheck the Adjust dimensionality option in the Image Cropper, the offsets are [424,29,0] as expected, whereas you could expect [424,184,0], i.e. adding 29 to the current offset. So maybe something has changed in how the image viewer handles non zero-min images??

2 Likes

Confirmed.

@aklemm, I was able to work around the issue by resetting the offsets of your input image to zero (using the Set Image Metadata node with negated current offsets).

Here’s the adjusted workflow:
image_cropper.knwf (36.6 KB)

@aklemm: Note that you can ship any auxiliary file with your knwf file by creating a subdirectory in your local copy of the workflow and placing any files there. You can use a knime://knime.workflow relative URL in the Table Reader to access these files. I did so for the uploaded workflow file and your Problem ImageCropper.table input.

4 Likes

Thank you, @imagejan! The work-around gives me the desired table and the offset is the problem. The input image (image_cropped) had been generated by Image Cropper. In the older KNIME/Image Processing version the output of Image Cropper was a cropped image without offset, whereas in the recent version it is a cropped image with offset.

4 Likes