How to open CZI file in imagej

Hi all,

I am having trouble opening CZI files in imagej. I have included a screenshot of the message I receive when I try to open the file. The bio-format release is 6.0.0. Can any one please help me with that.

Here is the message if the screenshot is not clear:

 "(Fiji Is Just) ImageJ 2.0.0-rc-69/1.52i; Java 1.8.0_172 [64-bit]; Mac OS X 10.12.6; 676MB of 5461MB (12%)
java.lang.IllegalArgumentException: Array size too large: 155838 x 111456 x 1
	at loci.common.DataTools.safeMultiply32(DataTools.java:1286)
	at loci.common.DataTools.allocate(DataTools.java:1259)
	at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:160)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:334)
	at loci.formats.DimensionSwapper.openBytes(DimensionSwapper.java:233)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:334)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:334)
	at loci.plugins.util.ImageProcessorReader.openProcessors(ImageProcessorReader.java:186)
	at loci.plugins.in.ImagePlusReader.readProcessors(ImagePlusReader.java:422)
	at loci.plugins.in.ImagePlusReader.readPlanes(ImagePlusReader.java:387)
	at loci.plugins.in.ImagePlusReader.readImage(ImagePlusReader.java:282)
	at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:243)
	at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:221)
	at loci.plugins.in.ImagePlusReader.openImagePlus(ImagePlusReader.java:116)
	at loci.plugins.in.Importer.readPixels(Importer.java:149)
	at loci.plugins.in.Importer.run(Importer.java:86)
	at loci.plugins.LociImporter.run(LociImporter.java:78)
	at ij.IJ.runUserPlugIn(IJ.java:228)
	at ij.IJ.runPlugIn(IJ.java:192)
	at ij.IJ.runPlugIn(IJ.java:181)
	at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:499)
	at HandleExtraFileTypes.run(HandleExtraFileTypes.java:72)
	at ij.IJ.runUserPlugIn(IJ.java:228)
	at ij.IJ.runPlugIn(IJ.java:192)
	at ij.IJ.runPlugIn(IJ.java:181)
	at ij.io.Opener.openWithHandleExtraFileTypes(Opener.java:516)
	at ij.io.Opener.openImage(Opener.java:370)
	at ij.io.Opener.openImage(Opener.java:242)
	at ij.io.Opener.open(Opener.java:109)
	at ij.io.Opener.openAndAddToRecent(Opener.java:291)
	at ij.plugin.DragAndDrop.openFile(DragAndDrop.java:192)
	at ij.plugin.DragAndDrop.run(DragAndDrop.java:159)
	at java.lang.Thread.run(Thread.java:748) "

Thanks in advance,
Ghazi

Hi, what kind of CZI was it and does it work with BioFormats 5.9.2?

Thanks for the reply, it is virtual slides. I am not sure if it works with BioFormats 5.9.2!

Hi Ghazi,

that’s probably not a sufficient description of the type of CZI file (at least it doesn’t mean anything to me…) - could you please give some more details on the system and ZEN version the CZI was created with?

You can try to disable the Bio-Formats update site in your Fiji installation, which will currently downgrade Bio-Formats to version 5.9.2 and try again to answer @sebi06’s question.

Cheers,
Niko

Sorry, I just realized this is not true any more since the Java-8 update site now also ships with Bio-Formats 6. The you’d need to manually downgrade (unfortunately) for testing.

Maybe @dgault can provide some details on how to debug this?

Cheers,
Niko

From the error message it appears as though the dimensions of the plane are too large. What are the expected X and Y sizes for the image? If you try to crop the image using the Importer options does that allow you to open it successfully?

I believe they are too large because they are mega-slides. I tried to crop the image from the importer options but I received the same message. I attached a screenshot of one of the images from another software if that would help.
thanks

Hi @dgault I attached a screenshot of the options I get before the error message when I try to open the files if that would be helpful.

Thanks

What you see is all correct. BioFormats interpretes image pyramid levels as image series. See also here:

https://forum.image.sc/t/opening-multiscene-czi-files-with-fiji/19075/5

Sebi

Since you are already working with QuPath I thought you might like to know that it has some nice inter-operability with ImageJ which @petebankhead has detailed in the below links. I thought that maybe if you look at what he’s demonstrating here then you might be able to bypass the need to open the whole image in ImageJ?



1 Like

Hi @sebi06
Thanks for the reply. I can open the image when I chose series number 4 as you can see in the attachment. However, The quality and colour is not good. I am not sure if the size is the issue here?

BioFormats interprets your 24bit RGB as 3 single channels with 8bit each. This is why it looks like this.

Ok! is there a way to solve that?

Selecting one of the later series will allow you to open the file in ImageJ, using the higher resolutions (in which you are seeing the exceptions) you will need to crop the image to a smaller size.

Regarding the channels, in the importer options if you change colour mode to composite it should combine the 3 channels.

Thanks @dgault
I managed to solve that. I really appreciate your help.

Regards,