Drag&drop for hdf5 files


I was wondering whether Fiji could automatically launch the HDF5 importer when a .h5 file is dragged&dropped onto the menu bar?!
Right now one has to go through [File>Import>HDF5…] which is very tedious if one does that many times a day.

Best, Christian


I agree that it would be handy to have a drag-n-drop support for HDF5. The problem is that h5 files can store an arbitrary number of datasets that contain really any data from a simple table to n-dimensional image data, organized in a tree structure much like a file system tree. You’d have to make an automatic decision whether to load only the first or only the largest dataset, or all of them, and how many levels deep you want to go into the dataset structure where e.g. channels and time frames can be saved in different leaves.

On the last ImageJ/KNIME hackathon, I did some preliminary investigations how to add hdf5 read/write support to SCIFIO by modifying scifio-hdf5 (which currently only support writing files using the hdf5 flavor of Imaris), but I unfortunately didn’t have time yet to continue this work.

If you have an h5 file type with recurring standard layout, e.g. from ilastik or from SVI Huygens, that you’d like to open by drag and drop, I suggest you create a small macro using Plugins > HDF5 > Scriptable load HDF5… and put the macro code into an ActionBar as a <DnDAction> as a handy workaround.

1 Like

If you use [File>Import>HDF5…] it shows you a little GUI to select the data set that you want to load. I think this is OK (maybe annoying but necessary). I was just moaning about the fact that I have to go through [File>Import>HDF5…] to get this GUI.

Note that SCIFIO provides the framework to open and interrogate the contents of data sources, to make a decision about which format should be used. So in an ideal world, we would have a separate SCIFIO format plugin which handles each supported flavor of .h5. As for drag and drop, when the SCIFIO option is turned on, drag and drop should already work to open it accordingly.

You could code a SciJava IOPlugin which calls it. Turning on SCIFIO in the ImageJ2 options activates the SciJava I/O subsystem for drag and drop as well as for File :arrow_forward: Open….

1 Like

6 posts were split to a new topic: Error opening HDF5 file via File › Import › HDF5… command