Exception Issue when opening .nd2 files with Bio-Formats

I write because I have an issue when opening a specific .nd2 file with Fiji. I am using Bio-Formats Plugins release 6.5.1-SNAPSHOT (installed through Update command in Fiji). The error that I get is the following one:

(Fiji Is Just) ImageJ 2.0.0-rc-69/1.52p; Java 1.8.0_172 [64-bit]; Windows 10 10.0; 247MB of 48823MB (<1%)

java.lang.IllegalArgumentException: 0 must be non-null and strictly positive.
at ome.xml.model.primitives.PositiveInteger.(PositiveInteger.java:48)
at loci.formats.MetadataTools.populatePixelsOnly(MetadataTools.java:311)
at loci.formats.MetadataTools.populateMetadata(MetadataTools.java:262)
at loci.formats.MetadataTools.populatePixels(MetadataTools.java:151)
at loci.formats.MetadataTools.populatePixels(MetadataTools.java:116)
at loci.formats.in.NativeND2Reader.populateMetadataStore(NativeND2Reader.java:2015)
at loci.formats.in.NativeND2Reader.initFile(NativeND2Reader.java:1611)
at loci.formats.FormatReader.setId(FormatReader.java:1392)
at loci.formats.DelegateReader.setId(DelegateReader.java:291)
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:230)
at ij.IJ.runPlugIn(IJ.java:193)
at ij.IJ.runPlugIn(IJ.java:182)
at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:499)
at HandleExtraFileTypes.run(HandleExtraFileTypes.java:72)
at ij.IJ.runUserPlugIn(IJ.java:230)
at ij.IJ.runPlugIn(IJ.java:193)
at ij.IJ.runPlugIn(IJ.java:182)
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)

The strange thing is that I get this issue just for one file of the same experimental set (the other .nd2 files in the same folder are opened correctely). The file doesn’t seem to be damaged because I am able to reopen it from Nikon acquisition software. Do you have any suggestions/experience with this issue?

Thanks a lot for any help and if you need more information please tell me.


Unless you can find someone else posting the same error message, I am not sure that will be enough to go off of. You would probably need to host the problematic image somewhere for the bioformats team to download, or submit it through their website (to keep the data private).

Hi Chiara, it might be worth checking to see if you still get the issue when the option to use the chunkmap table is turned on and off. You can set it using:

Plugins > Bio-Formats Plugins Configuration > Formats > Nikon ND2 > Chunkmap

If that does not help then we would probably need to take a look at the file to debug further. If it is smaller than 2GB then you can upload it https://www.openmicroscopy.org/qa2/qa/upload/

Hi David,

thanks for the reply. I tried to check/uncheck the option Chunkmap, but unfortunately I’m still not able to open the .nd2 file. I uploaded one of the files for which I got the issue at the link you sent me.

Thank you for any help.

Thanks Chiara, we received the file ok. I will update this thread once I have had a chance to test it further.

1 Like

As a follow up, I have been able to reproduce the issue with the sample file provided and carry out some initial debugging of the file today. I have created a GitHub Issue to track this bug at https://github.com/ome/bioformats/issues/3589