New "User input" wiki section

Dear all,
With the help of @ctrueden, we updated the wiki with a new User input section about how to make Graphical User Interfaces (or collect input from the user in general e.g via the command line) with script parameters or the GenericDialog class, both being macro-recordable.

In particular, the new GenericDialog page details some tricks like defining custom buttons, parameters persistence…

Enjoy :hugs:


Thanks, @LThomas, for taking the time to improve the documentation!

I have two comments that we might want to address in the longer term:

  • The examples on the GenericDialog page are all written in Jython, while we generally use Groovy in many places of the ImageJ(2) documentation (e.g. imagej/tutorials, template scripts, etc.). To not cofuse users too much, I’d suggest settling for Groovy as the main language for documentation. (Also to set it apart from “real” Python examples that make use of pyimagej.)

  • The code examples on the GenericDialog page don’t follow best practices in variable naming: variables, fields and methods should always start with a small letter (lowerCamelCase). As far as I know that’s true for both Java coding style as well as Python PEP8. So I’d suggest to use gui and win instead of GUI and Win.

1 Like

Fixed :wink:

I know that Groovy is somehow better understood by the JVM and has a similar syntax but as Python is quite popular for data science out of the Fiji world, it is still my default choice to write a quick script :stuck_out_tongue:

1 Like