ImageJ plugins that process an image may implement this interface.
In addition to the features of PlugInFilter, it is better suited
for filters that have a dialog asking for the options or filter
parameters. It also offers support for preview, for a smooth
progress bar when processing stacks and for calling back
the PlugInFilterRunner (needed, e.g., to get the slice number
when processing a stack in parallel threads).
The sequence of calls to an ExtendedPlugInFilter is the following:
- setup(arg, imp)
: The filter should return its flags.
- showDialog(imp, command, pfr)
: The filter should display
the dialog asking for parameters (if any) and do all operations
needed to prepare for processing the individual image(s) (E.g.,
slices of a stack). For preview, a separate thread may call
setNPasses(nPasses)
and run(ip)
while
the dialog is displayed. The filter should return its flags.
- setNPasses(nPasses)
: Informs the filter of the number
of calls of run(ip)
that will follow.
- run(ip)
: Processing of the image(s). With the
CONVERT_TO_FLOAT
flag, this method will be called for
each color channel of an RGB image. With DOES_STACKS
,
it will be called for each slice of a stack.
- setup("final", imp)
: called only if flag
FINAL_PROCESSING
has been specified.
Flag DONE
stops this sequence of calls.