IllegalArgumentException on opening tif-images (using SCIFIO)

Hi,
When using the SCIFO (Beta) in FIJI, I encountered a problem when opening certain .tif images via drag&drop, as well as with the Bio-Formats Importer directly.
This problem does not occur when the SCIFO (Beta) option is not selected.

The .tif files in question, were saved using Olympus CellSense (4 channels, single plane). Image info:

DateTime: 2017:12:13 19:17:23
Artest: Olympus

------------------------------------------------------

(Fiji Is Just) ImageJ 2.0.0-rc-71/1.52i; Java 1.8.0_66 [64-bit]; Mac OS X 10.14.3; 398MB of 10667MB (3%)

Title: 4D_#11_Vehicle_(67)_SCID_011217_M1GCL_N1_1.tif
Width:  1360 pixels
Height:  1024 pixels
Depth:  4 pixels
Size:  11MB
Voxel size: 1x1x1 pixel^3
ID: -4
Bits per pixel: 16 (unsigned)
Display range: 0 - 15879
Image: 1/4
No threshold
ScaleToFit: false
Uncalibrated

Error log when using DragAndDrop:

Exception in thread "DrawAndDrop" java.lang.IllegalArgumentException: Negative position
 at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:717)
 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.SISReader.initStandardMetadata(SISReader.java:148)
 at loci.formats.in.BaseTiffReader.initMetadata(BaseTiffReader.java:97)
 at loci.formats.in.BaseTiffReader.initFile(BaseTiffReader.java:584)
 at loci.formats.FormatReader.setId(FormatReader.java:1395)
 at loci.formats.ImageReader.setId(ImageReader.java:842)
 at io.scif.bf.BioFormatsFormat$Parser.typedParse(BioFormatsFormat.java:434)
 at io.scif.bf.BioFormatsFormat$Parser.typedParse(BioFormatsFormat.java:416)
 at io.scif.AbstractParser.parse(AbstractParser.java:252)
 at io.scif.AbstractParser.parse(AbstractParser.java:335)
 at io.scif.AbstractParser.parse(AbstractParser.java:51)
 at io.scif.AbstractReader.setSource(AbstractReader.java:269)
 at io.scif.services.DefaultInitializeService.initializeReader(DefaultInitializeService.java:89)
 at io.scif.img.ImgOpener.createReader(ImgOpener.java:419)
 at io.scif.img.ImgOpener.openImgs(ImgOpener.java:145)
 at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:125)
 at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:110)
 at io.scif.io.DatasetIOPlugin.open(DatasetIOPlugin.java:74)
 at io.scif.io.DatasetIOPlugin.open(DatasetIOPlugin.java:49)
 at net.imagej.legacy.plugin.DefaultLegacyOpener.open(DefaultLegacyOpener.java:136)
 at net.imagej.legacy.DefaultLegacyHooks.interceptDragAndDropFile(DefaultLegacyHooks.java:362)
 at ij.plugin.DragAndDrop.openFile(DragAndDrop.java)
 at ij.plugin.DragAndDrop.run(DragAndDrop.java:159)
 at java.lang.Thread.run(Thread.java:745)

Error log when using the Bio-Formats Importer (same error):

(Fiji Is Just) ImageJ 2.0.0-rc-71/1.52i; Java 1.8.0_66 [64-bit]; Mac OS X 10.14.3; 352MB of 10667MB (3%)

java.lang.IllegalArgumentException: Negative position
 at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:717)
 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.SISReader.initStandardMetadata(SISReader.java:148)
 at loci.formats.in.BaseTiffReader.initMetadata(BaseTiffReader.java:97)
 at loci.formats.in.BaseTiffReader.initFile(BaseTiffReader.java:584)
 at loci.formats.FormatReader.setId(FormatReader.java:1395)
 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:228)
 at ij.IJ.runPlugIn(IJ.java:192)
 at ij.Executer.runCommand(Executer.java:137)
 at ij.Executer.run(Executer.java:66)
 at java.lang.Thread.run(Thread.java:745)

The example image that throws the exception at the end.

I know that SCIFIO is still being developed, but I wanted to report this potential bug.
Thank you!

Reattached image:
4D_#11_Vehicle_(67)_SCID_011217_M1GCL_N1_1.tif (11.3 MB)

Hey @loicsauteur

We’re having trouble downloading your attachment. Can you re-attach or send to QA?

Cheers,
~Josh

Hi Josh @joshmoore

Thanks! I reattached it and works for me now.
Bests,
Loïc

Thanks, @loicsauteur. That did the trick. I can certainly reproduce with 5.9.2 and 6.0.1. Are you seeing the same thing with all exported files or just this one? ~J

It happens with old images acquired with the Olympus software (in 2017), all of them.
I guess meanwhile we had a software update to Olympus cellSens Dimensions 1.15. Images acquired with this software version do not trigger this exception.
Unfortunately, I cannot tell you which cellSens version we were running back in 2017, since this was before my time here.
Also, when SCIFIO beta is off, trying to open the images Bio-Formats gives the same exception. Hence, it appears to be a problem with Bio-Formats…

Hope this helps.
Thanks,
Loïc

Understood. Thanks for the info.

Definitely. Both stacktraces in your original message are within Bio-Formats.

~Josh