GenericDialog gd = new GenericDialog(command+"...");
gd.addNumericField("Radius", radius, 1, 6, "pixels");
int digits = imp.getType() == ImagePlus.GRAY32 ? 2 : 0;
if(filterType == OUTLIERS) {
gd.addNumericField("Threshold", threshold, digits);
gd.addChoice("Which Outliers", outlierStrings, outlierStrings[whichOutliers]);
}
gd.addPreviewCheckbox(pfr); //passing pfr makes the filter ready for preview
gd.addDialogListener(this); //the DialogItemChanged method will be called on user input
gd.showDialog(); //display the dialog; preview runs in the now
if (gd.wasCanceled()) return DONE;