glencoesoftware / bioformats2raw

Bio-Formats image file format to raw format converter
GNU General Public License v2.0
77 stars 35 forks source link

Unable to convert slides with PNG images #124

Closed xkacenga closed 2 years ago

xkacenga commented 2 years ago

Hello, I managed to convert Mirax slides from various sources (all of them used JPEG compression) without any issue, but I am struggling with PNG Mirax slides. After I start the conversion, I get the following warning:

OpenJDK 64-Bit Server VM warning: You have loaded library /tmp/opencv_openpnp7320568727722482987/nu/pattern/opencv/linux/x86_64/libopencv_java342.so which might have disabled stack guard. The VM will try to fix the stack guard now. It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.esotericsoftware.kryo.util.UnsafeUtil (file:/home/mkacenga/bioformats2raw-0.3.0/lib/kryo-2.24.0.jar) to constructor java.nio.DirectByteBuffer(long,int,java.lang.Object) WARNING: Please consider reporting this to the maintainers of com.esotericsoftware.kryo.util.UnsafeUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

Then the conversion starts, but the program throws error after error while the conversion is running:

2022-01-02 20:07:25,356 [pool-1-thread-3] ERROR c.g.bioformats2raw.Converter - Failure processing chunk; resolution=0 plane=2 xx=9216 yy=0 zz=0 width=1024 height=1024 depth=1 java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 86007 out of bounds for byte[85852] at java.base/java.lang.System.arraycopy(Native Method) at com.glencoesoftware.bioformats2raw.MiraxReader.openBytes(MiraxReader.java:304) at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:348) at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:229) at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:161) at com.glencoesoftware.bioformats2raw.Converter.getTile(Converter.java:961) at com.glencoesoftware.bioformats2raw.Converter.processChunk(Converter.java:1072) at com.glencoesoftware.bioformats2raw.Converter.lambda$saveResolutions$4(Converter.java:1286) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) 2022-01-02 20:07:25,363 [pool-1-thread-2] ERROR c.g.bioformats2raw.Converter - Failure processing chunk; resolution=0 plane=1 xx=9216 yy=0 zz=0 width=1024 height=1024 depth=1 java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 86120 out of bounds for byte[85852] at java.base/java.lang.System.arraycopy(Native Method) at com.glencoesoftware.bioformats2raw.MiraxReader.openBytes(MiraxReader.java:304) at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:348) at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:229) at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:161) at com.glencoesoftware.bioformats2raw.Converter.getTile(Converter.java:961) at com.glencoesoftware.bioformats2raw.Converter.processChunk(Converter.java:1072) at com.glencoesoftware.bioformats2raw.Converter.lambda$saveResolutions$4(Converter.java:1286) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) 2022-01-02 20:07:25,381 [pool-1-thread-3] ERROR c.g.bioformats2raw.Converter - Failure processing chunk; resolution=0 plane=1 xx=10240 yy=0 zz=0 width=1024 height=1024 depth=1 java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 86077 out of bounds for byte[85852] at java.base/java.lang.System.arraycopy(Native Method) at com.glencoesoftware.bioformats2raw.MiraxReader.openBytes(MiraxReader.java:304) at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:348) at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:229) at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:161) at com.glencoesoftware.bioformats2raw.Converter.getTile(Converter.java:961) at com.glencoesoftware.bioformats2raw.Converter.processChunk(Converter.java:1072) at com.glencoesoftware.bioformats2raw.Converter.lambda$saveResolutions$4(Converter.java:1286) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) 2022-01-02 20:07:25,399 [pool-1-thread-2] ERROR c.g.bioformats2raw.Converter - Failure processing chunk; resolution=0 plane=2 xx=10240 yy=0 zz=0 width=1024 height=1024 depth=1 java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 85964 out of bounds for byte[85852] at java.base/java.lang.System.arraycopy(Native Method) at com.glencoesoftware.bioformats2raw.MiraxReader.openBytes(MiraxReader.java:304) at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:348) at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:229) at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:161) at com.glencoesoftware.bioformats2raw.Converter.getTile(Converter.java:961) at com.glencoesoftware.bioformats2raw.Converter.processChunk(Converter.java:1072) at com.glencoesoftware.bioformats2raw.Converter.lambda$saveResolutions$4(Converter.java:1286) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

Is there anything I can try to make it work?

Thank you, Martin

melissalinkert commented 2 years ago

Thanks for reporting this @xkacenga. The first warnings you see are safe to ignore, but the subsequent errors indicate a problem with reading specific image tiles.

Are you able to view this dataset in 3DHISTECH's CaseViewer software? If so, we likely need to see the complete dataset in order to investigate.

xkacenga commented 2 years ago

Thanks for your answer @melissalinkert .Yes, I am able to visualize the dataset in CaseViewer. I prepared the dataset, but I would prefer not to share the download link publicly. Can I send it to you by mail (or any other means)?

xkacenga commented 2 years ago

It seems like the issue is not with the scanner. Recently, we started using a new scanner (using similar compression), and the problem is the same.

melissalinkert commented 2 years ago

I'd expect #146 to fix this issue. If you wish to try out the fix before it is released, you can use the build here: https://ci.appveyor.com/project/gs-jenkins/bioformats2raw/builds/43102166/artifacts

xkacenga commented 2 years ago

Thank you for the fix! It works now.