Fiji and .czi file - array size too large

czi
Tags: #<Tag:0x00007fa30d3b7ab0>

#1

Hello,
My numerous attempts to open a 2GB .czi file(s) failed. I’m receiving the following error message (see below). Could anyone help me?
Cheers,
Lech

(Fiji Is Just) ImageJ 2.0.0-rc-59/1.51n; Java 1.8.0_66 [64-bit]; Linux 4.13.0-45-generic; 152MB of 15795MB (<1%)
 
java.lang.IllegalArgumentException: Array size too large: 63575 x 36874 x 1
	at loci.common.DataTools.safeMultiply32(DataTools.java:949)
	at loci.common.DataTools.allocate(DataTools.java:922)
	at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:158)
	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.util.ImageProcessorReader.openProcessors(ImageProcessorReader.java:83)
	at loci.plugins.util.ImageProcessorSource.getObject(ImageProcessorSource.java:72)
	at loci.formats.cache.Cache.recache(Cache.java:204)
	at loci.formats.cache.Cache.recache(Cache.java:224)
	at loci.formats.cache.Cache.<init>(Cache.java:88)
	at loci.plugins.util.BFVirtualStack.<init>(BFVirtualStack.java:126)
	at loci.plugins.in.ImagePlusReader.createVirtualStack(ImagePlusReader.java:327)
	at loci.plugins.in.ImagePlusReader.readImage(ImagePlusReader.java:272)
	at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:234)
	at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:212)
	at loci.plugins.in.ImagePlusReader.openImagePlus(ImagePlusReader.java:107)
	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:217)
	at ij.IJ.runPlugIn(IJ.java:181)
	at ij.IJ.runPlugIn(IJ.java:170)
	at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:499)
	at HandleExtraFileTypes.run(HandleExtraFileTypes.java:72)
	at ij.IJ.runUserPlugIn(IJ.java:217)
	at ij.IJ.runPlugIn(IJ.java:181)
	at ij.IJ.runPlugIn(IJ.java:170)
	at ij.io.Opener.openWithHandleExtraFileTypes(Opener.java:515)
	at ij.io.Opener.openImage(Opener.java:369)
	at ij.io.Opener.openImage(Opener.java:243)
	at ij.io.Opener.open(Opener.java:110)
	at ij.io.Opener.open(Opener.java:73)
	at ij.plugin.Commands.run(Commands.java:27)
	at ij.IJ.runPlugIn(IJ.java:187)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:745)

#2

Hi,

I think that your image can not be opened using bio-formats…

I read bio-formats code.
The method of safeMultiply32 check the size of image.
In this method, it check the size compare to integer max value (Integer.MAX_VALUE, = 2147483647).
So, your image is decided large image by bio-formats.
I think that the max value for checking should be change to twice size of Integer.MAX_VALUE.
If you can compile bio-formats yourself, the image can be opened using it.

hwada


#3

Hi,

I may have misunderstood.
I am checking about ImageJ.
Please wait for my new opinion…

hwada


#4

I have understood…
Java dose not have unsigned int. (It is common sense)
In ImageJ, the image is stored in a 1D array.
So, width × height must be less than the maximum int value which is Integer.MAX_VALUE.
(However, there is a description that is restricted by the VM)
In other words, the size check before opening the image by bio-formats is a necessary process.

When opening an image using ImageJ, you need to pay attention to the size of the image to be saved.

hwada


#5

A lot depends on the origin of the file.

If it’s from a whole slide scanner, then it’s likely in a pyramidal format and should be readable with QuPath + the Bio-Formats extension.

But if from another source, this may not work. In that case, if when attempting to open the image if you see the Bio-Formats options appear you may be able to crop the image during import - which may help you access at least some, if not all.