Use Javadoc template for javadoc links
== Introduction ==
[https://javadoc.scijava.org/ImageJ1 /ij/gui /GenericDialog .html Generic Dialog] class is part of [[ImageJ1]] and can be used to make simple graphical user interfaces for scripts and plugins. It requires a bit more of work than with the [[Script Parameters|script parameters]] option but offers more possibilities.<br>Fiji offers an additional [https://javadoc.scijava.org/Fiji /fiji/util/gui /GenericDialogPlus .html GenericDialogPlus] subclass which include additional GUI item like a file input with a browse button.<br>
Like the script parameters, plugins using the Generic Dialog (or one of its subclass) are macro recordable.
By default, script and plugins process the last selected image.<br>
However sometime one needs to specify different images or files as input.<br>
[https://javadoc.scijava.org/Fiji /fiji/util/gui /GenericDialogPlus.html GenericDialogPlus ] provides a couple of handful methods for such cases, while all methods shown above are inherited from the GenericDialog class.
Fortunately, it is still possible to make it works using the PrefService.
Services are some ImageJ2/SciJava features that can be though as some kind of package import at runtime. Here the link to the
[https://javadoc.scijava.org/SciJava /org/scijava/prefs /PrefService .html PrefService Javadoc].<br>
And below is a Jython example of how to use it.
from fiji.util.gui import GenericDialogPlus