Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hdf5 export records superfluous value in macro recorder #77

Open
k-dominik opened this issue Feb 8, 2021 · 1 comment
Open

hdf5 export records superfluous value in macro recorder #77

k-dominik opened this issue Feb 8, 2021 · 1 comment

Comments

@k-dominik
Copy link
Contributor

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:

  • not supplying exportpath
  • supplying exportpath and select (but leaving select empty, so just select=.
@imagejan
Copy link
Contributor

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

Suggestions:

  • ask Wayne to add an 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
  • use a SciJava parameter (and help fixing the macro recording issues that still remain on the SciJava side... I know it's a lost case, but still 😉 ):
@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");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants