knime-ip / knip

KNIME Image Processing Extension
https://www.knime.com/community/image-processing
49 stars 11 forks source link

Offsets are multiplied by 2 when setting image dimension metadata #502

Open imagejan opened 6 years ago

imagejan commented 6 years ago

When using the Set Image Metadata node to set the dimension name (and nothing else), e.g. Dimension 2 to "Z" (as is required for bitmasks after the Feature Calculator (BETA) node currently - another bug?), the image offsets get multiplied by 2, as illustrated by this workflow:

image Set Metadata Offsets Bug.zip

I suspect the issue somewhere in these lines, where the min gets set correctly first, but later the image gets translated by the very same min again:

https://github.com/knime-ip/knip/blob/8aa1488e09dafcbdfca903fd9ed4ed67d24e5efd/org.knime.knip.base/src/org/knime/knip/base/nodes/metadata/setimgmetadata/SetImgMetadataNodeModel.java#L242-L248

https://github.com/knime-ip/knip/blob/8aa1488e09dafcbdfca903fd9ed4ed67d24e5efd/org.knime.knip.base/src/org/knime/knip/base/nodes/metadata/setimgmetadata/SetImgMetadataNodeModel.java#L263-L264

Not sure if my guess is correct, though... I only quickly looked at the code.

(Tested with KNIME 3.5.3 and the nightly-built KNIME Image Processing 1.6.1.201806190602)

imagejan commented 5 years ago

(as is required for bitmasks after the Feature Calculator (BETA) node currently - another bug?)

I opened an issue for this one: https://github.com/knime-ip/knip/issues/506