Java Code Examples for ij.gui.GenericDialog#dispose()

The following examples show how to use ij.gui.GenericDialog#dispose() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GrayscaleAreaOpeningPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr)
{
	// Create the configuration dialog
	GenericDialog gd = new GenericDialog("Gray Scale Area Opening");

	gd.addNumericField("Pixel Number", 100, 0, 10, "pixels");
	
	gd.addPreviewCheckbox(pfr);
	gd.addDialogListener(this);
       previewing = true;
       gd.showDialog();
       previewing = false;
       
       if (gd.wasCanceled())
       	return DONE;
		
   	parseDialogParameters(gd);
		
	// clean up an return 
	gd.dispose();
	return flags;
}
 
Example 2
Source File: GrayscaleBoxDiameterOpeningPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr)
{
	// Create the configuration dialog
	GenericDialog gd = new GenericDialog("Gray Scale Box Diagonal Opening");

	gd.addNumericField("Diagonal Min.", 100, 0, 10, "pixels");
	
	gd.addPreviewCheckbox(pfr);
	gd.addDialogListener(this);
       previewing = true;
       gd.showDialog();
       previewing = false;
       
       if (gd.wasCanceled())
       	return DONE;
		
   	parseDialogParameters(gd);
		
	// clean up an return 
	gd.dispose();
	return flags;
}
 
Example 3
Source File: AreaOpeningPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr)
{
	// Create the configuration dialog
	GenericDialog gd = new GenericDialog("Area Opening");

	gd.addNumericField("Pixel Number", 100, 0, 10, "pixels");
	
	gd.addPreviewCheckbox(pfr);
	gd.addDialogListener(this);
       previewing = true;
       gd.showDialog();
       previewing = false;
       
       if (gd.wasCanceled())
       	return DONE;
		
   	parseDialogParameters(gd);
		
	// clean up an return 
	gd.dispose();
	return flags;
}
 
Example 4
Source File: GrayscaleAttributeFilteringPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr)
{
	// Create the configuration dialog
	GenericDialog gd = new GenericDialog("Gray Scale Attribute Filtering");

	gd.addChoice("Operation", Operation.getAllLabels(), Operation.OPENING.label);
	gd.addChoice("Attribute", Attribute.getAllLabels(), Attribute.AREA.label);
	gd.addNumericField("Minimum Value", 100, 0, 10, "pixels");
	gd.addChoice("Connectivity", connectivityLabels, connectivityLabels[0]);
	
	gd.addPreviewCheckbox(pfr);
	gd.addDialogListener(this);
       previewing = true;
	gd.showDialog();
       previewing = false;
       
       if (gd.wasCanceled())
       {
       	resetPreview();
       	return DONE;
       }	
       parseDialogParameters(gd);

       // clean up an return
	gd.dispose();
	return flags;
}
 
Example 5
Source File: MorphologicalFilterPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 5 votes vote down vote up
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr)
{
	// Normal setup
   	this.imagePlus = imp;
   	this.baseImage = imp.getProcessor().duplicate();

	// Create the configuration dialog
	GenericDialog gd = new GenericDialog("Morphological Filters");
	
	gd.addChoice("Operation", Operation.getAllLabels(), 
			this.op.toString());
	gd.addChoice("Element", Strel.Shape.getAllLabels(), 
			this.shape.toString());
	gd.addNumericField("Radius (in pixels)", this.radius, 0);
	gd.addCheckbox("Show Element", false);
	gd.addPreviewCheckbox(pfr);
	gd.addDialogListener(this);
       previewing = true;
	gd.addHelp("http://imagej.net/MorphoLibJ#Morphological_filters");
       gd.showDialog();
       previewing = false;
       
       if (gd.wasCanceled()) 
       {
       	resetPreview();
       	return DONE;
       }	
       
   	parseDialogParameters(gd);
		
	// clean up an return 
	gd.dispose();
	return flags;
}
 
Example 6
Source File: RegionalMinAndMaxPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 5 votes vote down vote up
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr) {
	// Normal setup
   	this.imagePlus = imp;
   	this.baseImage = imp.getProcessor().duplicate();

	// Create the configuration dialog
	GenericDialog gd = new GenericDialog("Regional Min & Max");
	
	gd.addChoice("Operation", Operation.getAllLabels(), 
			Operation.REGIONAL_MINIMA.label);
	gd.addChoice("Connectivity", connectivityLabels, connectivityLabels[0]);
	
	gd.addPreviewCheckbox(pfr);
	gd.addDialogListener(this);
       previewing = true;
       gd.addHelp("https://imagej.net/MorphoLibJ");
       gd.showDialog();
       previewing = false;
       
       if (gd.wasCanceled())
       	return DONE;
		
   	parseDialogParameters(gd);
		
	// clean up an return 
	gd.dispose();
	return flags;
}
 
Example 7
Source File: ExtendedMinAndMaxPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 5 votes vote down vote up
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr) {
	// Normal setup
   	this.imagePlus = imp;
   	this.baseImage = imp.getProcessor().duplicate();

	// Create the configuration dialog
	GenericDialog gd = new GenericDialog("Extended Min & Max");
	
	gd.addChoice("Operation", Operation.getAllLabels(), Operation.EXTENDED_MINIMA.label);
	boolean isGray8 = (this.baseImage instanceof ByteProcessor);
	double minValue = isGray8 ? 1 : this.baseImage.getMin();
	double maxValue = isGray8 ? 255 : this.baseImage.getMax();
	gd.addSlider("Dynamic", minValue, maxValue, 10);
	gd.addChoice("Connectivity", connectivityLabels, connectivityLabels[0]);
	
	gd.addPreviewCheckbox(pfr);
	gd.addDialogListener(this);
       previewing = true;
       gd.addHelp("https://imagej.net/MorphoLibJ");
       gd.showDialog();
       previewing = false;
       
       if (gd.wasCanceled()) {
		return DONE;
       }
       
   	parseDialogParameters(gd);
		
	// clean up an return 
	gd.dispose();
	return flags;
}
 
Example 8
Source File: DirectionalFilteringPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
	public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr)
	{
		// Normal setup
    	this.imagePlus = imp;
    	this.baseImage = imp.getProcessor().duplicate();

		// Create the configuration dialog
		GenericDialog gd = new GenericDialog("Directional Filtering");
		
		gd.addChoice("Type", Type.getAllLabels(), this.type.toString());
		gd.addChoice("Operation", Operation.getAllLabels(), this.op.toString());
		gd.addNumericField("Line Length", this.lineLength, 0, 8, "pixels");
		gd.addNumericField("Direction Number", this.nDirections, 0);
		
		gd.addPreviewCheckbox(pfr);
		gd.addDialogListener(this);
        previewing = true;
//		gd.addHelp("http://imagejdocu.tudor.lu/doku.php?id=plugin:morphology:fast_morphological_filters:start");
        gd.showDialog();
        previewing = false;
        
        if (gd.wasCanceled()) 
        {
			return DONE;
        }
        
    	parseDialogParameters(gd);
			
		// clean up an return 
		gd.dispose();
		return flags;
	}