ArrayIndexOutOfBoundsException encountered opening .svs files


i have some problems using the bio formats library for fijii: i can successfully open most of the .svs images i have with this awesome library but some of it gives me this stacktrace:

	at java.lang.System.arraycopy(Native Method)
	at loci.formats.ChannelSeparator.openBytes(
	at loci.formats.ReaderWrapper.openBytes(
	at loci.formats.DimensionSwapper.openBytes(
	at loci.formats.ReaderWrapper.openBytes(
	at loci.formats.MinMaxCalculator.openBytes(
	at loci.formats.MinMaxCalculator.openBytes(
	at loci.formats.ReaderWrapper.openBytes(
	at loci.formats.ReaderWrapper.openBytes(
	at loci.formats.ReaderWrapper.openBytes(
	at loci.formats.gui.BufferedImageReader.openImage(
	at loci.formats.gui.BufferedImageReader.openImage(
	at DS4H.ImageFile.getImage(
	at DS4H.BufferedImagesManager.getImage(
	at DS4H.BufferedImagesManager.get(
	at DS4H.ImageAlignment.lambda$onMainDialogEvent$8(
	at DS4H.Utilities.lambda$setTimeout$0(
java.lang.NullPointerException is a class i created to handle all the images opened by the user.
The getImage() method can be summerized like this:

public void Initialize() {
   ImporterOptions options = new ImporterOptions();
   options.setSeriesOn(0, true);
   ImportProcess process = new ImportProcess(options);
   BufferedImageReader bufferedEditorImageReaderWholeSlide = BufferedImageReader.makeBufferedImageReader(importProcess.getReader());
   // Open the biggest image possible

public BufferedImage getImage(index) {
   return this.bufferedEditorImageReaderWholeSlide.openImage(index);

The images i have troubles opening are the one stored here:

What can i do to resolve this issue? is it a bug of Bio-formats?
I can succesfully open images of about ~200mb.


Are you dragging and dropping the files into Fiji or using the BioFormats importer (better option, sometimes only option)?

I am developing a custom ImageJ plugins that uses pom-bio-formats 6.1.1 to import the images.

Specifically, my plugins starts and asks the user to select a file image, and then specify the image file path via options.setId(pathFile); (as shown in my code snippet above).

The issue with those files is that the dimension sizes are so large, which means that a single plane will be larger than the max size for a Java array. To get around this you will have to read a cropped region of the image, or read the images one region at a time. You can do this by using openImage(int no, int x, int y, int width, int height) instead of openImage(int no)

1 Like