We chose to use 4 bands (red, green, blue, Near infrared), which means that for our analysis I have to stack those 4 images (merge them into 1 image). The way how I did that was to use the GroupBy node. The 4 images are in a table and then the images are grouped together using the aggregation method ‘merge image’. The result is 1 image. So far so good I thought, but when I compared this image with earlier research which we conducted in Python (using Rasterio), the image is different. Whereas the image in python looks much more like a combination of the 4 images, the image that KNIME produces looks very much identical to images nr. 1 and 2, but very different from images nr. 3 and 4.
This leads me to wonder if I did something wrong in KNIME. It seems like a easy operation that is very suitable for the groupby node. The goal thus is to stack images of different wave lengths in KNIME.
I also experimented with the merger node. I transposed the table (rows to columns), but then in the merger node I got confused about what to fill in as the result dimensions and the result dimension names. What I did was X,Y as result dimension and X,Y as result dimension name, but after reading the documentation I did not quite understand what this means in the context of merging images The resulting images will have more dimensions as X and Y I presumed, but how to notate this I do not know.
Anyway, with X and Y as values I got a similar result as the groupby node (by similar I mean when I looked at the image in the image viewer), which is very different from the Python result. Perhaps this is due to me using the wrong result dimensions?
For the Result dimension names you’ll basically have to add the name of the dimension into which the individual images should be merged. In general, you can call the dimension anyway you like, for instance Frequency. But Channel is used for visualization purposes implicitly, so you should give that a try for starters.
In the Result dimensions, you have to define the first few dimensions of the output stack. If you know, for instance, that your individual images are 1024px * 2048px and you have 3 of those, you can say 1024,2048 and the resulting image will be 1024px * 2048px * 3channels. If you are certain that all your input images have the same size, you can also define it as X,Y and KNIME will automatically figure out the numbers and insert it for you:
Thanks for very much for your reply. Turned out that in a node before I used the wrong pixel type, which led to a conversion of all pixel values. That is why the comparison with Python did not go well. It is solved, this topic can be closed.