Series 2 does not exist with bioformats2raw but exists using Fiji's bioformats
Closed this issue · 3 comments
Dear all,
I have successfully converted over 300 .vsi files, however one of them is causing issues.
The file can be opened using BioFormats in Fiji, where there are 3 series inside it. A Label, an Overview and an actual image. The actual image is the series with index 2. This is confirmed in QuPath as well, which also uses BioFormats
however the command bioformats2raw ImageY2R_D45.vsi "ImageY2R_D45 (20x)" --series 2
causes a Java error:
Exception in thread "main" picocli.CommandLine$ExecutionException: Error while calling command (com.glencoesoftware.bioformats2raw.Converter@25fb8912): java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 1
at picocli.CommandLine.executeUserObject(CommandLine.java:1792)
at picocli.CommandLine.access$900(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2150)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2144)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2108)
at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:2349)
at picocli.CommandLine.parseWithHandler(CommandLine.java:2284)
at picocli.CommandLine.call(CommandLine.java:2560)
at com.glencoesoftware.bioformats2raw.Converter.main(Converter.java:1605)
Caused by: java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 1
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:458)
at loci.formats.MetadataList.get(MetadataList.java:121)
at loci.formats.SubResolutionFormatReader.getCurrentCore(SubResolutionFormatReader.java:238)
at loci.formats.FormatReader.getSizeX(FormatReader.java:656)
at loci.formats.ReaderWrapper.getSizeX(ReaderWrapper.java:201)
at loci.formats.ReaderWrapper.getSizeX(ReaderWrapper.java:201)
at com.glencoesoftware.bioformats2raw.Converter.saveResolutions(Converter.java:1000)
at com.glencoesoftware.bioformats2raw.Converter.write(Converter.java:603)
at com.glencoesoftware.bioformats2raw.Converter.convert(Converter.java:558)
at com.glencoesoftware.bioformats2raw.Converter.call(Converter.java:391)
at com.glencoesoftware.bioformats2raw.Converter.call(Converter.java:89)
at picocli.CommandLine.executeUserObject(CommandLine.java:1783)
... 9 more
I have attached the file here, so that it may help check what the issue might be... Again it opens just fin ein BioFormats
https://drive.google.com/file/d/1TSxAvJ_gOFESvvGLDtvzRkJ6O_yG-hBc/view?usp=sharing
Kind regards
Oli
Thank you for reporting this @lacan, and for providing a sample dataset. I can reproduce the error; adding --extra-readers
to the end of the bioformats2raw
command should fix it.
bioformats2raw
includes an additional pyramid TIFF reader (https://github.com/glencoesoftware/bioformats2raw/blob/master/src/main/java/com/glencoesoftware/bioformats2raw/PyramidTiffReader.java) which is picking up this particular .vsi dataset. Adding --extra-readers
turns off that pyramid TIFF reader and allows the correct reader to be used instead.
Dear @melissalinkert
Thank you for the information. I will try this as a workaround. All the best
Closing as this isn't something we can address with a code change. If you still see errors with --extra-readers
, feel free to reopen.