Issues opening large .czi files

Hi all,

I’m having some issues opening a number of .czi files in fiji, this is a 2gb file with approx 700 scenes 2 channels.
As far as I’m aware everything is updated including the bioformats plugin, and I can open smaller czi files with less scenes.

Here is the error I get, any suggestions?

Thanks!

(Fiji Is Just) ImageJ 2.1.0/1.53c; Java 1.8.0_172 [64-bit]; Windows 10 10.0; 337MB of 195337MB (<1%)

java.lang.IllegalArgumentException: Negative position
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:718)
at loci.common.NIOByteBufferProvider.allocateDirect(NIOByteBufferProvider.java:127)
at loci.common.NIOByteBufferProvider.allocate(NIOByteBufferProvider.java:112)
at loci.common.NIOFileHandle.buffer(NIOFileHandle.java:647)
at loci.common.NIOFileHandle.seek(NIOFileHandle.java:330)
at loci.common.RandomAccessInputStream.seek(RandomAccessInputStream.java:203)
at loci.formats.in.ZeissCZIReader.readSegment(ZeissCZIReader.java:3473)
at loci.formats.in.ZeissCZIReader.readSegments(ZeissCZIReader.java:1631)
at loci.formats.in.ZeissCZIReader.initFile(ZeissCZIReader.java:626)
at loci.formats.FormatReader.setId(FormatReader.java:1421)
at loci.plugins.in.ImportProcess.initializeFile(ImportProcess.java:499)
at loci.plugins.in.ImportProcess.execute(ImportProcess.java:142)
at loci.plugins.in.Importer.showDialogs(Importer.java:140)
at loci.plugins.in.Importer.run(Importer.java:76)
at loci.plugins.LociImporter.run(LociImporter.java:78)
at ij.IJ.runUserPlugIn(IJ.java:235)
at ij.IJ.runPlugIn(IJ.java:198)
at ij.IJ.runPlugIn(IJ.java:187)
at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:503)
at HandleExtraFileTypes.run(HandleExtraFileTypes.java:76)
at ij.IJ.runUserPlugIn(IJ.java:235)
at ij.IJ.runPlugIn(IJ.java:198)
at ij.IJ.runPlugIn(IJ.java:187)
at ij.io.Opener.openWithHandleExtraFileTypes(Opener.java:512)
at ij.io.Opener.openUsingHandleExtraFileTypes(Opener.java:369)
at ij.io.Opener.openImage(Opener.java:359)
at ij.io.Opener.openImage(Opener.java:243)
at ij.io.Opener.open(Opener.java:109)
at ij.io.Opener.open(Opener.java:72)
at ij.plugin.Commands.run(Commands.java:27)
at ij.IJ.runPlugIn(IJ.java:204)
at ij.Executer.runCommand(Executer.java:150)
at ij.Executer.run(Executer.java:68)
at java.lang.Thread.run(Thread.java:748)

I suspect this may possibly be memory related, the first steps I would recommend:

  • In the Importer Options try to use Virtual Stack
  • Try to increase the amount of memory available: Edit > Options > Memory and threads

After that I would try downloading the Bio-Formats command line tools from Bio-Formats Downloads | Open Microscopy Environment (OME) and seeing if the below command runs without the same exception:

  • showinf -nopix path/to/myFile.czi

Tried those but no joy. The settings was already setup to use 200gb ram (yes I have that much on this workstation). But raising it or lowering it had no effect.

running the showinf command gave this

Unknown segment type: ?/}???Y*Ua??)Cj?
Exception in thread “main” java.lang.IllegalArgumentException: Negative position
at sun.nio.ch.FileChannelImpl.read(Unknown Source)
at loci.common.NIOByteBufferProvider.allocateDirect(NIOByteBufferProvider.java:127)
at loci.common.NIOByteBufferProvider.allocate(NIOByteBufferProvider.java:112)
at loci.common.NIOFileHandle.buffer(NIOFileHandle.java:647)
at loci.common.NIOFileHandle.seek(NIOFileHandle.java:330)
at loci.common.RandomAccessInputStream.seek(RandomAccessInputStream.java:203)
at loci.formats.in.ZeissCZIReader.readSegment(ZeissCZIReader.java:3473)
at loci.formats.in.ZeissCZIReader.readSegments(ZeissCZIReader.java:1631)
at loci.formats.in.ZeissCZIReader.initFile(ZeissCZIReader.java:626)
at loci.formats.FormatReader.setId(FormatReader.java:1421)
at loci.formats.ImageReader.setId(ImageReader.java:849)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
at loci.formats.tools.ImageInfo.testRead(ImageInfo.java:1035)
at loci.formats.tools.ImageInfo.main(ImageInfo.java:1121)

I’m actually starting to suspect the czi files as testing different ones it seems all the >1gb ones generated since about july last year wont open but the earlier ones do… at least its narrowing down the problem so it shouldnt be memory then as there a 4gb files similar scene numbers from early last year that work fine.

Solved my own problem in the end. So about 6 months of the files are corrupted, so restoring originals from the pc that generated them has fixed the issues.

1 Like