private boolean getUserParams(GenericDialog gd) { gd.showDialog(); // the user presses the Cancel button if (gd.wasCanceled()) return false; m_Slope = (double) gd.getNextNumber(); if (m_Slope<=0) m_Slope = 10; m_Down = (boolean) gd.getNextBoolean(); m_TopHat = (boolean) gd.getNextBoolean(); return true; } // end of 'getUserParams' method
void showAngleDialog() { GenericDialog gd = new GenericDialog("Angle Tool"); gd.addCheckbox("Measure reflex angle", Prefs.reflexAngle); gd.showDialog(); if (!gd.wasCanceled()) Prefs.reflexAngle = gd.getNextBoolean(); }
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { if (gd.wasCanceled()) return false; tolerance = gd.getNextNumber(); mode = gd.getNextChoice(); if (showCheckbox) { if (gd.getNextBoolean()) { imp.deleteRoi(); IJ.run("Threshold..."); } } Prefs.smoothWand = gd.getNextBoolean(); if (startx>0||starty>0) IJ.doWand(startx, starty, tolerance, mode+(Prefs.smoothWand?" smooth":"")); return true; }
void showAngleDialog() { GenericDialog gd = new GenericDialog("Angle Tool"); gd.addCheckbox("Measure reflex angle", Prefs.reflexAngle); gd.showDialog(); if (!gd.wasCanceled()) Prefs.reflexAngle = gd.getNextBoolean(); }
private boolean getUserParams(GenericDialog gd) { gd.showDialog(); // the user presses the Cancel button if (gd.wasCanceled()) return false; m_Slope = (double) gd.getNextNumber(); if (m_Slope<=0) m_Slope = 10; m_Down = (boolean) gd.getNextBoolean(); m_TopHat = (boolean) gd.getNextBoolean(); return true; } // end of 'getUserParams' method
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { if (gd.wasCanceled()) return false; tolerance = gd.getNextNumber(); mode = gd.getNextChoice(); if (showCheckbox) { if (gd.getNextBoolean()) { imp.deleteRoi(); IJ.run("Threshold..."); } } Prefs.smoothWand = gd.getNextBoolean(); if (startx>0||starty>0) IJ.doWand(startx, starty, tolerance, mode+(Prefs.smoothWand?" smooth":"")); return true; }
static public void debugDialog() { // note: all this could nicely be done using reflection, so adding another boolean variable would be automatically added here (filtering by the prefix "debug"). final GenericDialog gd = new GenericDialog("Debug:"); gd.addCheckbox("debug", debug); gd.addCheckbox("debug mouse", debug_mouse); gd.addCheckbox("debug sql", debug_sql); gd.addCheckbox("debug event", debug_event); gd.addCheckbox("debug clip", debug_clip); gd.addCheckbox("debug thing", debug_thing); gd.showDialog(); if (gd.wasCanceled()) { return; } debug = gd.getNextBoolean(); debug_mouse = gd.getNextBoolean(); debug_sql = gd.getNextBoolean(); debug_event = gd.getNextBoolean(); debug_clip = gd.getNextBoolean(); debug_thing = gd.getNextBoolean(); }
@Override public void run( String arg0 ) { final GenericDialog gd = new GenericDialog( "Toggle Cluster Processing Options" ); gd.addCheckbox( "Display_Cluster Processing Options", displayClusterProcessing ); gd.showDialog(); if ( gd.wasCanceled() ) return; displayClusterProcessing = gd.getNextBoolean(); IOFunctions.println( "Cluster processing option: " + ( displayClusterProcessing ? "ON" : "OFF" ) ); } }
boolean showDialog() { GenericDialog gd = new GenericDialog("Kuwahara Filter"); gd.addNumericField("Sampling window width (must be odd):", size, 0, 3, ""); if (isRGB) gd.addCheckbox("Filter all 3 channels (slower)", filterRGB); gd.showDialog(); if (gd.wasCanceled()) return false; size = (int) gd.getNextNumber(); if ((size&1)!=1) size--; if (size<3) size = 3; if (isRGB) filterRGB = gd.getNextBoolean(); return true; }
boolean showDialog() { GenericDialog gd = new GenericDialog("Surface Plotter"); gd.addCheckbox("Draw_Wireframe", showWireframe); gd.addCheckbox("Shade", showGrayscale); gd.addCheckbox("Draw_Axis", showAxis); gd.addCheckbox("Source Background is Lighter", whiteBackground); gd.addCheckbox("Fill Plot Background with Black", blackFill); gd.addCheckbox("One Polygon Per Line", oneToOne); gd.addCheckbox("Smooth", smooth); gd.showDialog(); if (gd.wasCanceled()) return false; polygonMultiplier = (int)gd.getNextNumber(); showWireframe = gd.getNextBoolean(); showGrayscale = gd.getNextBoolean(); showAxis = gd.getNextBoolean(); whiteBackground = gd.getNextBoolean(); blackFill = gd.getNextBoolean(); oneToOne = gd.getNextBoolean(); smooth = gd.getNextBoolean(); if (showWireframe && !showGrayscale) blackFill = false;
/** * Display the generic dialog for this plugin. Called by the * {@link #run(String)} method when the plugin is launched from the ImageJ * menu. * * @return a boolean, which is false if the cancel button was pressed, true * otherwise */ private boolean showDialog() { /* * Create and display generic dialog */ final GenericDialog gd = new GenericDialog("Dynamic Reslice"); gd.addCheckbox("Flip Vertically", flip); gd.addCheckbox("Rotate 90 Degrees", rotate); gd.showDialog(); if (gd.wasCanceled()) return false; /* * Collect from generic dialog */ flip = gd.getNextBoolean(); rotate = gd.getNextBoolean(); return true; }
void dicom() { GenericDialog gd = new GenericDialog("DICOM Options"); gd.addCheckbox("Open as 32-bit float", Prefs.openDicomsAsFloat); gd.addCheckbox("Ignore Rescale Slope", Prefs.ignoreRescaleSlope); gd.addMessage("Orthogonal Views"); gd.setInsets(5, 40, 0); gd.addCheckbox("Rotate YZ", Prefs.rotateYZ); gd.setInsets(0, 40, 0); gd.addCheckbox("Flip XZ", Prefs.flipXZ); gd.showDialog(); if (gd.wasCanceled()) return; Prefs.openDicomsAsFloat = gd.getNextBoolean(); Prefs.ignoreRescaleSlope = gd.getNextBoolean(); Prefs.rotateYZ = gd.getNextBoolean(); Prefs.flipXZ = gd.getNextBoolean(); }
boolean showDialog() { GenericDialog gd = new GenericDialog("Surface Plotter"); gd.addCheckbox("Draw_Wireframe", showWireframe); gd.addCheckbox("Shade", showGrayscale); gd.addCheckbox("Draw_Axis", showAxis); gd.addCheckbox("Source Background is Lighter", whiteBackground); gd.addCheckbox("Fill Plot Background with Black", blackFill); gd.addCheckbox("One Polygon Per Line", oneToOne); gd.addCheckbox("Smooth", smooth); gd.showDialog(); if (gd.wasCanceled()) return false; polygonMultiplier = (int)gd.getNextNumber(); showWireframe = gd.getNextBoolean(); showGrayscale = gd.getNextBoolean(); showAxis = gd.getNextBoolean(); whiteBackground = gd.getNextBoolean(); blackFill = gd.getNextBoolean(); oneToOne = gd.getNextBoolean(); smooth = gd.getNextBoolean(); if (showWireframe && !showGrayscale) blackFill = false;
public boolean showDialog() { GenericDialog gd = new GenericDialog("Scale Selection"); gd.addNumericField("X scale factor:", defaultXScale, 2, 3, ""); gd.addNumericField("Y scale factor:", defaultYScale, 2, 3, ""); gd.addCheckbox("Centered", false); gd.showDialog(); if (gd.wasCanceled()) return false; xscale = gd.getNextNumber(); yscale = gd.getNextNumber(); centered = gd.getNextBoolean(); return true; }
void dicom() { GenericDialog gd = new GenericDialog("DICOM Options"); gd.addCheckbox("Open as 32-bit float", Prefs.openDicomsAsFloat); gd.addCheckbox("Ignore Rescale Slope", Prefs.ignoreRescaleSlope); gd.addMessage("Orthogonal Views"); gd.setInsets(5, 40, 0); gd.addCheckbox("Rotate YZ", Prefs.rotateYZ); gd.setInsets(0, 40, 0); gd.addCheckbox("Flip XZ", Prefs.flipXZ); gd.showDialog(); if (gd.wasCanceled()) return; Prefs.openDicomsAsFloat = gd.getNextBoolean(); Prefs.ignoreRescaleSlope = gd.getNextBoolean(); Prefs.rotateYZ = gd.getNextBoolean(); Prefs.flipXZ = gd.getNextBoolean(); }
@Override protected boolean setAdvancedValues() { final GenericDialog gd = new GenericDialog( "Advanced values" ); gd.addNumericField( "Sigma", defaultSigma, 5 ); gd.addNumericField( "Threshold", defaultThreshold, 5 ); gd.addCheckbox( "Find_minima", defaultFindMin ); gd.addCheckbox( "Find_maxima", defaultFindMax ); gd.showDialog(); if ( gd.wasCanceled() ) return false; this.sigma = defaultSigma = gd.getNextNumber(); this.threshold = defaultThreshold = gd.getNextNumber(); this.findMin = defaultFindMin = gd.getNextBoolean(); this.findMax = defaultFindMax = gd.getNextBoolean(); return true; }
public boolean showDialog() { GenericDialog gd = new GenericDialog("Scale Selection"); gd.addNumericField("X scale factor:", defaultXScale, 2, 3, ""); gd.addNumericField("Y scale factor:", defaultYScale, 2, 3, ""); gd.addCheckbox("Centered", false); gd.showDialog(); if (gd.wasCanceled()) return false; xscale = gd.getNextNumber(); yscale = gd.getNextNumber(); centered = gd.getNextBoolean(); return true; }
public boolean showDialog() { GenericDialog gd = new GenericDialog("De-Interleaver"); gd.addNumericField("How many channels?", nChannels, 0); gd.addCheckbox("Keep source stack", keep); gd.showDialog(); if (gd.wasCanceled()) return false; nChannels = (int) gd.getNextNumber(); keep = gd.getNextBoolean(); Prefs.set("Deint_ch.int", nChannels); Prefs.set("Deint_keep.boolean", keep); return true; }
@Override protected boolean setAdvancedValues() { final GenericDialog gd = new GenericDialog( "Advanced values" ); gd.addNumericField( "Radius_1", defaultRadius1, 0 ); gd.addNumericField( "Radius_2", defaultRadius2, 0 ); gd.addNumericField( "Threshold", defaultThreshold, 4 ); gd.addCheckbox( "Find_minima", defaultFindMin ); gd.addCheckbox( "Find_maxima", defaultFindMax ); gd.showDialog(); if ( gd.wasCanceled() ) return false; this.radius1 = defaultRadius1 = (int)Math.round( gd.getNextNumber() ); this.radius2 = defaultRadius2 = (int)Math.round( gd.getNextNumber() ); this.threshold = defaultThreshold = gd.getNextNumber(); this.findMin = defaultFindMin = gd.getNextBoolean(); this.findMax = defaultFindMax = gd.getNextBoolean(); return true; }
private boolean showDialog() { GenericDialog gd = new GenericDialog("RATS"); gd.addNumericField("Noise Threshold:", sigma, 0); gd.addNumericField("Lambda Factor:", lambda, 0); gd.addNumericField("Min Leaf Size (pixels):", minSzPx[0], 0); gd.addCheckbox("Verbose", bVerbose); gd.showDialog(); if (gd.wasCanceled()) {return false;} sigma = gd.getNextNumber(); lambda = gd.getNextNumber(); minSzPx[0] = gd.getNextNumber(); minSzPx[1] = minSzPx[0]; bVerbose = gd.getNextBoolean(); return true; }//showDialog