fiji/HDF5_Vibez

Apple M1 Support

Closed this issue · 17 comments

Hi,

I've been trying to get this plugin working with Fiji on an M1 MacBook. While Fiji is running natively it seems that there are no native HDF5 libraries available for this plugin. Is there any chance that this will be updated in the future?

@FIrgolitsch Yes, @mkitti has been working on this. We hope to update the HDF5 native libraries of Fiji soon to include M1 support. There will be a major update of Fiji later this month, which will hopefully include this support, or at least infrastructural improvements that make it more feasible to include it relatively soon.

@ctrueden , we will need an update to 19.04.1 to include M1 support without user intervention.

Thanks for the update! Looking forward to the next release.

As the new jar is now included, I will close this issue.

Thanks @FIrgolitsch. But @mkitti: there is still more work to be done to make HDF5_Vibez support M1 natively, right? Don't we need a new base-18.09 library as well?

Thanks @FIrgolitsch. But @mkitti: there is still more work to be done to make HDF5_Vibez support M1 natively, right? Don't we need a new base-18.09 library as well?

I'm working on it. To be honest, I'm not sure what those other binaries do and if Vibez currently uses them at all.

Is HDF5_Vibez actually working for you in M1 mode on your system, @FIrgolitsch? Or did you close this issue presumptively? 😄

I have been working with HDF5 files with Fiji with a native JDK. That's why I presumed that it was fixed now. The only issue I encounter is that I get a "java.lang.IllegalArgumentException: Size exceeds Integer.MAX_VALUE" exception when I drag and drop a file into Fiji. When I open it using File > Import > HDF5 it works fine.

@FIrgolitsch Cool, so then it sounds like @mkitti's speculation is correct that HDF5_Vibez doesn't actually use anything from the base layer's native lib. 👍

As for the IllegalArgumentException: is there a stack trace with it? If so, paste it here and we can hopefully discern whether it's a bug in HDF5_Vibez, or base ImageJ, or something else. Or if not, and you have a sample file that I can use to reproduce locally, I could try to debug it.

Here it is:

java.lang.IllegalArgumentException: Size exceeds Integer.MAX_VALUE
	at java.base/sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:941)
	at org.scijava.text.DefaultTextService.open(DefaultTextService.java:66)
	at org.scijava.text.DefaultTextService.asHTML(DefaultTextService.java:75)
	at org.scijava.text.io.TextIOPlugin.open(TextIOPlugin.java:75)
	at org.scijava.text.io.TextIOPlugin.open(TextIOPlugin.java:49)
	at org.scijava.io.DefaultIOService.open(DefaultIOService.java:93)
	at org.scijava.io.DefaultIOService.open(DefaultIOService.java:68)
	at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:549)
	at HandleExtraFileTypes.run(HandleExtraFileTypes.java:97)
	at ij.IJ.runUserPlugIn(IJ.java:237)
	at ij.IJ.runPlugIn(IJ.java:203)
	at ij.IJ.runPlugIn(IJ.java:192)
	at ij.io.Opener.openWithHandleExtraFileTypes(Opener.java:555)
	at ij.io.Opener.openUsingHandleExtraFileTypes(Opener.java:407)
	at ij.io.Opener.openImage(Opener.java:386)
	at ij.io.Opener.openImage(Opener.java:241)
	at ij.io.Opener.open(Opener.java:104)
	at ij.io.Opener.openAndAddToRecent(Opener.java:310)
	at ij.plugin.DragAndDrop.openFile(DragAndDrop.java:194)
	at ij.plugin.DragAndDrop.run(DragAndDrop.java:160)
	at java.base/java.lang.Thread.run(Thread.java:829)

Ooh, same bug as here. Not HDF5-specific, but rather something about the text readers trying to open things they shouldn't. I'll investigate next week.

In case we do need sis-base support, here's the patch so far:
JaneliaSciComp/sis-base-java@master...janelia/aarch64-macosx

I still need to figure how how HDF5 Vibez might use this.

Here's a short Python script to create a HDF5 file that creates the IllegalArgumentException error above when dragged and dropped into FIJI:

conda create -n hdf5 -c conda-forge numpy h5py
import numpy as np, h5py

with h5py.File("test.hdf5", "w") as h5f:
    h5f.create_dataset("test", data = np.zeros((2**27,2)))

Thanks @mkitti, that was super useful! I was able to reproduce the problem, and fix the bug:

scijava/scijava-common@aa7fe2e