ilastik / ilastik4ij

ImageJ plugins to run ilastik workflows
MIT License
20 stars 17 forks source link

hdf5 export records superfluous value in macro recorder #77

Open k-dominik opened 3 years ago

k-dominik commented 3 years ago

in order to run the hdf export in a macro something like the following is enough

run("Export HDF5", "select=/tmp/test.h5 datasetname=data compressionlevel=0 input=2d_cells_apoptotic_1channel.png");

however, the following is recorder

run("Export HDF5", "select=/tmp/test.h5 exportpath=/tmp/test.h5 datasetname=data compressionlevel=0 input=2d_cells_apoptotic_1channel.png");

so there is a superfluous exportpath=/tmp/test.h5 in the recording.

Macro execution works with:

imagejan commented 3 years ago

<rant>Welcome to the "ImageJ 1.x nested dialog hell"</rant> 🙂

Suggestions:

@Parameter (style="save")
private File exportFile;

Here's a script that illustrates what I mean:

#@ String (visibility=MESSAGE, value="Axis order of the exported data set: 'TZYXC'") msg
#@ File (label="ExportPath", style="save") exportpath
#@ String (label="DatasetName") datasetname
#@ Integer (label="CompressionLevel", style="slider", min=0, max=100) compressionlevel
#@ Dataset (persist=false) input

println "Done."

It generates a dialog like this, with a Browse button to select a new file to save:

image

When saved as Fiji.app/scripts/MyScripts/Export_HDF5.groovy, it gets recorded as:

run("Export HDF5", "exportpath=/tmp/test.h5 datasetname=data compressionlevel=0 input=blobs.gif");