Image Reader node unable to read tiff images generated by Micromanager software

hi,

I am trying to open tiff images that were generated by a microscope operated by the Micromanager software. However, the “Image Reader” node from KNIME Image Processing is unable to read the images.

It gives me the following error:

2018-07-17 18:11:40,930 : WARN  : KNIME-Worker-10 : ImgReader2NodeModel : Image Reader : 0:1 : Encountered exception while reading image: img_000000000_Trans_003.tif! view log for more info.
2018-07-17 18:11:40,931 : DEBUG : KNIME-Worker-10 : ImgReader2NodeModel : Image Reader : 0:1 : Encountered exception while reading image:
java.lang.ArrayIndexOutOfBoundsException: 1
	at io.scif.formats.MicromanagerFormat$Position.getFile(MicromanagerFormat.java:883)
	at io.scif.formats.MicromanagerFormat$Reader.openPlane(MicromanagerFormat.java:761)
	at io.scif.formats.MicromanagerFormat$Reader.openPlane(MicromanagerFormat.java:725)
	at io.scif.AbstractReader.openPlane(AbstractReader.java:166)
	at io.scif.filters.ChannelFiller.openPlane(ChannelFiller.java:163)
	at io.scif.filters.ChannelFiller.openPlane(ChannelFiller.java:146)
	at io.scif.filters.PlaneSeparator.openPlane(PlaneSeparator.java:303)
	at io.scif.filters.PlaneSeparator.openPlane(PlaneSeparator.java:209)
	at io.scif.filters.AbstractReaderFilter.openPlane(AbstractReaderFilter.java:225)
	at io.scif.filters.AbstractReaderFilter.openPlane(AbstractReaderFilter.java:193)
	at io.scif.img.ImgOpener.read(ImgOpener.java:691)
	at io.scif.img.ImgOpener.read(ImgOpener.java:675)
	at io.scif.img.ImgOpener.read(ImgOpener.java:656)
	at io.scif.img.ImgOpener.readPlanes(ImgOpener.java:643)
	at io.scif.img.ImgOpener.openImgs(ImgOpener.java:358)
	at io.scif.img.ImgOpener.openImgs(ImgOpener.java:769)
	at io.scif.img.ImgOpener.openImg(ImgOpener.java:884)
	at org.knime.knip.io.ScifioImgSource.getImg(ScifioImgSource.java:299)
	at org.knime.knip.io.nodes.imgreader2.AbstractReadImgFunction.readImageAndMetadata(AbstractReadImgFunction.java:138)
	at org.knime.knip.io.nodes.imgreader2.readfromdialog.ReadImg2Function.lambda$0(ReadImg2Function.java:69)
	at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:110)
	at java.util.stream.IntPipeline$Head.forEachOrdered(IntPipeline.java:567)
	at org.knime.knip.io.nodes.imgreader2.readfromdialog.ReadImg2Function.apply(ReadImg2Function.java:67)
	at org.knime.knip.io.nodes.imgreader2.readfromdialog.ImgReader2NodeModel.execute(ImgReader2NodeModel.java:166)
	at org.knime.core.node.NodeModel.execute(NodeModel.java:733)

Software versions:

  • MacOS (10.11.6)
  • KNIME Analytics Platform (version 3.6.0)
  • KNIME Image Processing (1.7.0.201807120614)
  • Fiji/ImageJ (version 1.48v)

This maybe a machine dependent error since my colleague can read the image without any issues. Thanks for your help.

Svetlana

Hi @maltseva,

Are you able to open the images with a recent version of Fiji (please download a fresh copy from http://fiji.sc)? Please don’t drag and drop the image like you’d usually do but use the File > Import > Image command and leave the default settings. This will trigger a very similar import process to the one in KNIME Image Processing and we can double-check if it’s the underlying library (SCIFIO) or not.

Are you saying that your colleague can open the images with the same versions of KNIME Analytics Platform and KNIME Image Processing?

Best,
Stefan

Dear Stefan,

Thank you for your recommendations. I can’t open the images with Import function of Fiji. When I try to open the images I get the following error:

[INFO] Reading metadata file
[INFO] Populating metadata
[INFO] Finding image file names
[INFO] Building list of TIFFs
[ERROR] Module threw exception
java.lang.ArrayIndexOutOfBoundsException: 0
	at io.scif.formats.MicromanagerFormat$Position.getFile(MicromanagerFormat.java:883)
	at io.scif.formats.MicromanagerFormat$Reader.openPlane(MicromanagerFormat.java:761)
	at io.scif.formats.MicromanagerFormat$Reader.openPlane(MicromanagerFormat.java:725)
	at io.scif.AbstractReader.openPlane(AbstractReader.java:166)
	at io.scif.filters.ChannelFiller.openPlane(ChannelFiller.java:163)
	at io.scif.filters.ChannelFiller.openPlane(ChannelFiller.java:146)
	at io.scif.filters.PlaneSeparator.openPlane(PlaneSeparator.java:303)
	at io.scif.filters.PlaneSeparator.openPlane(PlaneSeparator.java:209)
	at io.scif.filters.AbstractReaderFilter.openPlane(AbstractReaderFilter.java:225)
	at io.scif.filters.AbstractReaderFilter.openPlane(AbstractReaderFilter.java:193)
	at io.scif.img.ImgOpener.read(ImgOpener.java:691)
	at io.scif.img.ImgOpener.read(ImgOpener.java:656)
	at io.scif.img.ImgOpener.readPlanes(ImgOpener.java:643)
	at io.scif.img.ImgOpener.openImgs(ImgOpener.java:358)
	at io.scif.img.ImgOpener.openImgs(ImgOpener.java:245)
	at io.scif.img.ImgOpener.openImgs(ImgOpener.java:146)
	at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:125)
	at io.scif.commands.OpenDataset.run(OpenDataset.java:157)
	at org.scijava.command.CommandModule.run(CommandModule.java:199)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

And yes, my colleague can open images with the same versions of KNIME Analytics Platform and KNIME Image Processing.

Thank you for help!

Best,
Svetlana

Hi @maltseva,
Are you reading the image files from a remote file system or folder with a somehow uncommon path?
The MicromanagerFormat sensitive to file paths so this could be cause. Can you try copying the pictures to your desktop and test if reading from there works?

best,
Gabriel

1 Like

Hi @gab1one,

Thanks for your advice!
I tried to read files from my Desktop but I still have the same problem.

Best,
Svetlana

Maybe the images got corrupted somehow? Can you try to calculate a hash of the image data with something like sha256sum on Linux or a tool like http://code.kliu.org/hashcheck/ on windows to make sure these are really the same images.

If these are the same try with a clean install of KNIME + KNIME Image Processing, maybe something weird happened during the update.

Thanks for your responses.
We came up with the solution to remove metadata.txt file from the folder. It seems that Import command is getting confused with MicroManager metadata.txt file.

1 Like

Hi @maltseva,

I’d say this is a workaround but not a solution since you are losing a lot of information/metadata when deleting Micro-Manager’s metadata.txt.

If you can spare the time, it would be great to find a proper solution for your issue: how did you save the images from Micro-Manager, i.e. “Save as separate image files” or “Save as image stack file”? Also, what’s the file extensions of your images tif or ome.tif (or something entirely different) and which Micro-Manager have you used for image acquisition?

Hi @stelfrich,

I save the images as “Save as separate image files” and images have tif extension. We use Micro-Manager 1.4.15 and Image J 1.48v for image acquisition.

That’s a fairly old version. Would you be able to provide some sample data? If you don’t mind and the files are not too large, you can create a ZIP file and upload them here to the forum. Otherwise, I can provide login details for an SFTP server, where you can upload the files, via email.

I created a cloud folder with the images.
Here is the link:

Thank you for the sample files, @maltseva!

I was able to find the issue and implement a fix for the underlying library (which is called SCIFIO): https://github.com/scifio/scifio/pull/378. Once this has been integrated, we can release a new version of KNIME Image Processing (that includes the fix) which should enable you to open the files that you have provided.

Best,
Stefan

3 Likes

Thank you, @stelfrich!

It is great that you can fix it. I am very grateful for your efforts on improving the software environment and timely users support.

Best,
Svetlana

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.