We’ve recently become aware of the Keller Lab Block Filetype and it looks quite interesting. With the help of the forum, I’ve been able to open KLB files. However, I was hoping to also be able to save large files in KLB format. Overall, the dearth of documentation leads me to think KLB is not properly supported, is that correct?
I did actuall try to save to KLB but it fails with a 4GB (2048x2048x500x16) file (but not a 50MB crop of the same file). If I try the
ZLIB compression, Fiji just crashes. But with BZIP2 I get a
Failed to write 2 error, which the source clarifies as
Error during BZIP compression of one of the blocks.
Below is the python script I am using (I’ve converted it to a Java plugin and the error is the same). Can anyone spot anything clearly wrong?
from org.janelia.simview.klb import KLB from ij import IJ, WindowManager from net.imglib2.img import ImagePlusAdapter as ipa imp = WindowManager.getCurrentImage() imp = ipa.wrapImgPlus(imp) file_name = "D:\\Code tests\\klb_test.klb" klb = KLB.newInstance(); klb.writeFull(imp, file_name, [16,16,16] , KLB.CompressionType.BZIP2, "this is a klb saving test") print "Finished"
klb.writeFull(imp, file_name, [16,16,16] , KLB.CompressionType.BZIP2, "this is a klb saving test") at org.janelia.simview.klb.KLBJNI.writeFull(KLBJNI.java:289) at org.janelia.simview.klb.KLB.writeFull(KLB.java:588) at org.janelia.simview.klb.KLB.writeFull(KLB.java:549) at org.janelia.simview.klb.KLB.writeFull(KLB.java:691) at org.janelia.simview.klb.KLB.writeFull(KLB.java:547) at org.janelia.simview.klb.KLB.writeFull(KLB.java:573) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) java.io.IOException: java.io.IOException: Failed to write 2