Image Reader: The first image in list is loaded n times unless Image Factory = Cell Image Factory

Hello!

I would like to better understand the Image Factory parameter in Image Reader. I do not get expected results unless I choose Cell Image Factory, which gives warnings but seems to do the right thing. 

My workflow consists of File Reader -> Image Reader -> Image Features.

File reader reads a list of 100 image paths. If Image Factory ~= Cell I.F., image features are identical for all images. If I.F. == Cell I.F. image features are unique for each image, as expected.

I am running KNIME v2.10.2.0044326, and checked for updates today. I can't figure out how to know what version of I.P. ext. I'm running so I'd love to know that too!

Thanks in advance,

Lorena

 

 

Hi Lorena,

the image factory parameter determines the internal data-structure of the loaded, this means the internal representation of an image in the memory. If your images aren’t too big, I always recommend ArrayImgs as this representation allows the fastest iterative pixel access. CellImgs are use-ful if you have super large images.

Concerning your workflow: I’m not sure if I understand correctly. You can use the Image Reader directly to select the images you want to read in or you use the “List Files” to list some paths. If you choose the latter, you have to configure the Image Reader (Tab “Advanced”) and select the column with the images paths. Anyway, the behaviour you describe in your workflow is strange and really not what the workflow should do. Could you upload an example with one or two images (or send me an email?)? Then I can see what’s going wrong and maybe fix it.

The version of KNIME Image Processing you find at Help -> About KNIME -> Installation Details.

Have a nice weekend,

Christian

Hi Christian,

Regarding the File Reader node, I use this to read a list of file paths because this is the most convenient way for me to do it. The folder containing these images contains a lot of other images and there is no easy filter to apply that picks the right ones. It is based on the content of the images. I figure it should not matter how the list of files is determined, in the end Image Reader loads a list of files right?

In trying to build a little example I could send you I think I found what the problem is! It's the switch "Check file format for each file (may be slower)". If you uncheck this box, the first image is duplicated across remaining images in the list. This can be easily exposed through the "Image Features" node. For Image Factory = "Cell Image Factory" the bug is not there. If I keep the box checked, meaning always check the file format, then it works properly for all Image Factories. It took a little while to find because unchecking that box is an optimization chosen later - it's easier to leave it checked (and this is the work-around) which is what I did for a while and everything worked as expected. I can still prepare a demo workflow with data if you want. It happens with or without the "File Reader" node.

Here is my Image Processing Ext. version info:

  KNIME Image Processing    1.2.1.201409141752    org.knime.knip.feature.feature.group    University of Konstanz / KNIME
  KNIME Image Processing - ImageJ 3D Viewer Integration    1.0.1.201407091125    org.knime.knip.imagej3d.feature.feature.group    KNIME / FIJI (http://3dviewer.neurofly.de/)
  KNIME Image Processing - ImageJ Integration (Beta)    0.9.0.201409131649    org.knime.knip.imagej.feature.feature.group    KNIME / LOCI
  KNIME Image Processing - OMERO Integration    0.8.2.201407092003    org.knime.knip.omero.feature.feature.group    KNIME / OME

Cheers!

Lorena

Thanks Lorena! This is great feedback. If you could tell me which kind of images (jpeg, tiff, png,…?) you are reading in, then I can try to reproduce and fix the bug.

Thank you again,

Christian

PS: Besides that bug, the rest works fine?

I was loading 16-bit .tif images. 

So far everything else is great. I haven't done very much yet because I'm slow and still coming up to speed, but already KNIME is becoming very useful.

Thanks for the quick replies!

Great. Thanks. Could you send me a few example images to reproduce the bug?

Attached:

  • demoImageReader_wData.zip - this is my workflow saved in a state where the Image Features table is showing identical statistics, and the Image Normalizer node shows the 3 images look the same despite having different filenames.
  • imagereaderdata.zip - includes: test1.tif, test2.tif, test3.tif

These are very uninteresting images, but they serve the purpose. If you reconfigure the Image Reader node to check the file format, and run with these 3 images, you'll see they are all different.

Thanks for looking into this!

Cheers,

Lorena
 

 

Hi Lorena,

I solved the problem. The solution will be available with our next release (probably in 2 weeks).

Thank you again for reporting the bug and providing the datasets,

Christian

 

I'm using KNIME 2.10.4 with the most current KNIP-plugins for that KNIME version.
I have the same problem with PNG-files. I have a big list to read in and if I uncheck "Check file format for each file", the node just reads in the first image for all of the different file paths. Checking that option makes it very slow but the images are read correctly.

hi niederle,

we didn't release since then (some changes in the libraries we use forced us to postpone the release). However, the fix is available in the nightly build already!

Hope this helps,

Christian