-
- All Superinterfaces:
PlugInFilter
- All Known Implementing Classes:
BackgroundSubtracter
,Binary
,Convolver
,EDM
,GaussianBlur
,ImageMath
,MaximumFinder
,RankFilters
,Rotator
,StackLabeler
,Translator
,UnsharpMask
public interface ExtendedPlugInFilter extends PlugInFilter
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 callsetNPasses(nPasses)
andrun(ip)
while the dialog is displayed. The filter should return its flags.-
setNPasses(nPasses)
: Informs the filter of the number of calls ofrun(ip)
that will follow.-
run(ip)
: Processing of the image(s). With theCONVERT_TO_FLOAT
flag, this method will be called for each color channel of an RGB image. WithDOES_STACKS
, it will be called for each slice of a stack.-
setup("final", imp)
: called only if flagFINAL_PROCESSING
has been specified.Flag
DONE
stops this sequence of calls.
-
-
Field Summary
Fields Modifier and Type Field Description static int
KEEP_PREVIEW
Set this flag if the last preview image may be kept as a result.-
Fields inherited from interface ij.plugin.filter.PlugInFilter
CONVERT_TO_FLOAT, DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, FINAL_PROCESSING, KEEP_THRESHOLD, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, NO_UNDO_RESET, PARALLELIZE_IMAGES, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
setNPasses(int nPasses)
This method is called by ImageJ to inform the plugin-filter about the passes to its run method.int
showDialog(ImagePlus imp, java.lang.String command, PlugInFilterRunner pfr)
This method is called aftersetup(arg, imp)
unless theDONE
flag has been set.-
Methods inherited from interface ij.plugin.filter.PlugInFilter
run, setup
-
-
-
-
Field Detail
-
KEEP_PREVIEW
static final int KEEP_PREVIEW
Set this flag if the last preview image may be kept as a result. For stacks, this flag can lead to out-of-sequence processing of the slices, irrespective of thePARALLELIZE_STACKS
flag.
- See Also:
- Constant Field Values
-
-
Method Detail
-
showDialog
int showDialog(ImagePlus imp, java.lang.String command, PlugInFilterRunner pfr)
This method is called aftersetup(arg, imp)
unless theDONE
flag has been set.- Parameters:
imp
- The active image already passed in thesetup(arg, imp)
call. It will be null, however, if theNO_IMAGE_REQUIRED
flag has been set.command
- The command that has led to the invocation of the plugin-filter. Useful as a title for the dialog.pfr
- The PlugInFilterRunner calling this plugin-filter. It can be passed to a GenericDialog byaddPreviewCheckbox
to enable preview by calling therun(ip)
method of this plugin-filter.pfr
can be also used later for calling back the PlugInFilterRunner, e.g., to obtain the slice number currently processed byrun(ip)
.- Returns:
- The method should return a combination (bitwise OR)
of the flags specified in interfaces
PlugInFilter
andExtendedPlugInFilter
.
-
setNPasses
void setNPasses(int nPasses)
This method is called by ImageJ to inform the plugin-filter about the passes to its run method. During preview, the number of passes is one (or 3 for RGB images, ifCONVERT_TO_FLOAT
has been specified). When processing a stack, it is the number of slices to be processed (minus one, if one slice has been processed for preview before), and again, 3 times that number for RGB images processed withCONVERT_TO_FLOAT
.
-
-