Image data handling and conversion


I'm new to knime and currently I'm trying to develop an image processing pipeline but I'm unsure how to handle the actual image data in KNIME. The images are extracted from MATLAB, so I've used the MATLAB Snippet node to transfer the actual image matrix into KNIME, which works well. After the snippet execution I'm having a data table with x*y rows and numImages columns available in KNIME (so each column hold the intensity values of all pixels for one image). The data type of each column is double. Unfortunately I'm now unable to convert this data table back to an actual image data type in KNIME. I've tried to transpose the matrix and connected the result to the Data Row to Image node, but this does not work, the console output is:

"No columns of type CollectionDataValue available!"

Furthermore I'm running into trouble after transposing, since KNIME seems to have difficulties to handle data tables with many columns (in my case after transposing x*y, so 640*480). Each time I'm trying to have a look at the transposed result, the cpu usage is at 100% and KNIME hangs and has to be killed.

So the question is, is there a way to convert the actual 2D image matrix (double format) back to an image format? And what would be the appropriate image data handling? I want to avoid the extraction of each single image in matlab since this would slow down the whole process due to the large number of file (accesses). Any help would be appreciated!

Hi Mo,

I got good news for you, this is easily possible to do in KNIME. First the error "No columns of type CollectionDataValue available!", it indicates that the Data Row to Image node works with CollectionColumns instead of rows (the name is sadly a bit missleading), the reason is the fact that creating many columns slows down KNIME very much, as you have noticed.

So we need to turn each image column into a CollectionCell, this can be done with the GroupBy node, I have attached an example workflow that shows how this can be done.

I do not fully understand your last question, what do you mean exactly with "Image Extraction" do you want to know how you can read images into KNIME directly? Have you tried the Image Reader node? It can read a wide range of file formats.