Open k-dominik opened 3 years ago
<rant>
Welcome to the "ImageJ 1.x nested dialog hell"</rant>
🙂
Suggestions:
addSaveField()
method to GenericDialog
(or adapt the already present addFileField
to support a file saving mode), that would allow to browse directories on the local file system, and enter an output file name, or@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:
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");
in order to run the hdf export in a macro something like the following is enough
however, the following is recorder
so there is a superfluous
exportpath=/tmp/test.h5
in the recording.Macro execution works with:
exportpath
exportpath
andselect
(but leaving select empty, so justselect=
.