.SLD Bio-Formats Errors


I am trying to open an .SLD file in python bioformats but to no avail. The .SLD I am testing my programme on has two series, and in each series there are 50 time point images, each of which is a 100-frame Zstack.

This is the code I use:

file_path = '/file/path/to/file.SLD'
javabrdige.start_vm(class_path=bioformats.JARS, run_headless=True)
im = bioformats.ImageReader(file_path)

and this is the output i get:

Exception in thread "Thread-1" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:659)
	at java.util.ArrayList.get(ArrayList.java:435)
	at loci.formats.in.SlidebookReader.initFile(SlidebookReader.java:654)
	at loci.formats.FormatReader.setId(FormatReader.java:1392)

please note that I have tried to run this with headless=False and I get a similar output.
Also it might be worth mentioning that I can load single TIFs in just fine!

I have also tried to move my project to Matlab, using Bioformats in Matlab. I get the same error using bfopen(‘file_path_to_.SLD’).

Am i right in thinking the additional Slidebook update site in Fiji installs somethign important to get Bio-Formats working and this is missing in Python/Matlab hence these errors?

Any help would be greatly appreciated.


@u2056710 your last intuition about the value of the Slidebook update site is absolutely correct.

The SlideBookReader shipped with Bio-Formats only supports a limited range of .sld variants.

3i has worked on a Bio-Formats reader based on their native library and has worked with OME a few years ago to integrate this reader with Bio-Formats - see Building open collaborations for the sustainable support of proprietary file formats · The OME Blog for more details.

For various reasons notably licensing, Bio-Formats can not ship this reader and this is the reason why the Slidebook update site maintained by 3i exists as it allows to distribute this reader to the Fiji community.
To enable the native reader in Bio-Formats, the 3i Slidebook JAR should be simply be available on the CLASSPATH and the 3i reader should take precedence over the legacy Bio-Formats reader to read .sld files. I would expect this workflow to also work under the MATLAB and Python environment but we have not tested it on our side.

I’ll leave 3i developers to follow-up and complete my answer if they have additional information.


@s.besson thank you very much for your quick and thorough reply.

I have managed to get it working in Bioformats by adding a bfmatlab folder to my path. This folder includes a bioformats package (JAR) as well as some matlab scripts. I am pleased it is now wokring in Matlab, but would love to also be able to work it in Python.

I am new to programming, and especially new to Javabridge as well, so any advice on how I would go about adding a 3i Slidebook JAR to the classpath for Python would be massively appreciated!

Thanks again,

Glad to hear the MATLAB Bio-Formats interface is working with the 3i Slidebook reader @u2056710.

For Python, I suspect the additional JARs needs to be passed to the class_path argument in the javabridge.start_vm invocaion. The @CellProfilerTeam develops and maintains the python-bioformats package so they are the authority here and might suggest another another way to extend the default behavior to include third-party JARs.