Recommendations to start doing a GUI

Hi there,

I would like to improve a fiji macro by introducing a dialog or Gui where the user could change default values of some parameters while seeing the result as a preview. Can you give some ideias how should I do it? Where can I find information to start doing it? Do you think is better to do it in java, or a Dialog is sufficient?

Thank you in advance.

Mafalda

I think you can start from the script parameters. It’s very fast to make a GUI and they have nice built in functionalities like recall of the previously typed value, bounding values to a range for ints…
The only issue with those is if you want to have just a message string, the recording of the macro will not be working well, it is a current bug that should be fixed at some point. The preview button is also missing in this case.

Otherwise the GenericDialog or its Fiji’s daughter class GenericDialogPlus which has a few more options are also good options but requires more coding than the script parameters, including the possibility to make a help button that opens a webpage, to make a preview button as well… But the recall or Persistence of previous parameters should also be manually code using the Persistence scijava service.

I would not use any other Java GUI library even though they might be more fancy, the first reason is that you would loose the macro recordability which is key for many plugins and that you would depend on some additional library not shipped with Fiji.

2 Likes