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 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 showDialogAskBaseline() { GenericDialog gd = new GenericDialog("Bleach Correction"); gd.addNumericField("Background Intensity", baselineInt, 1) ; gd.showDialog(); if (gd.wasCanceled()) return false; baselineInt = gd.getNextNumber(); return true; }
/** Displays a message in a dialog box with the specified title. Returns false if the user pressed "Cancel". */ public static boolean showMessageWithCancel(String title, String msg) { GenericDialog gd = new GenericDialog(title); gd.addMessage(msg); gd.showDialog(); return !gd.wasCanceled(); }
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 getValue (String title, String prompt, double defaultValue, int digits) { int places = Analyzer.getPrecision(); if (digits>0 || (int)defaultValue!=defaultValue) digits = Math.max(places, 1); gd = new GenericDialog(title); gd.addNumericField(prompt, defaultValue, digits, 8, null); gd.addPreviewCheckbox(pfr); gd.addDialogListener(this); gd.showDialog(); }
public GenericDialog showDialog() { // Create a new generic dialog with appropriate options GenericDialog gd = new GenericDialog("Set Label Map"); gd.addChoice("Colormap", CommonLabelMaps.getAllLabels(), CommonLabelMaps.GOLDEN_ANGLE.getLabel()); gd.addChoice("Background", CommonColors.getAllLabels(), CommonColors.WHITE.toString()); gd.addCheckbox("Shuffle", true); gd.addPreviewCheckbox(null); gd.addDialogListener(this); parseDialogParameters(gd); gd.showDialog(); return gd; }
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; }
protected static double[] getAdvancedDoGParameters( final double defaultSigma, final double defaultThreshold ) { final GenericDialog gd = new GenericDialog( "Select Difference-of-Gaussian parameters" ); gd.addNumericField( "Detection_sigma (approx. radius)", defaultSigma, 4 ); gd.addNumericField( "Threshold", defaultThreshold, 4 ); gd.showDialog(); if ( gd.wasCanceled() ) return null; else return new double[]{ gd.getNextNumber(), gd.getNextNumber() }; }
void showAngleDialog() { GenericDialog gd = new GenericDialog("Angle Tool"); gd.addCheckbox("Measure reflex angle", Prefs.reflexAngle); gd.showDialog(); if (!gd.wasCanceled()) Prefs.reflexAngle = gd.getNextBoolean(); }
String promptForName(String name) { GenericDialog gd = new GenericDialog("ROI Manager"); gd.addStringField("Rename As:", name, 20); gd.showDialog(); if (gd.wasCanceled()) return null; else return gd.getNextString(); }
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 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; }
protected boolean getDebug() { if ( debugMode ) { GenericDialog gdDebug = new GenericDialog( "Debug options" ); gdDebug.addNumericField( "Show debug output every n'th frame, n = ", defaultDebugInterval, 0 ); gdDebug.showDialog(); if ( gdDebug.wasCanceled() ) return false; defaultDebugInterval = debugInterval = (int)Math.round( gdDebug.getNextNumber() ); } return true; }
@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" ) ); } }
/** Allows the user to enter a string in a dialog box. Returns "" if the user cancels the dialog box. */ public static String getString(String prompt, String defaultString) { GenericDialog gd = new GenericDialog(""); gd.addStringField(prompt, defaultString, 20); gd.showDialog(); if (gd.wasCanceled()) return ""; return gd.getNextString(); }
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
private boolean showDialog() { GenericDialog gd = new GenericDialog("3D Gaussian Blur"); gd.addNumericField("X sigma:", xsigma, 1); gd.addNumericField("Y sigma:", ysigma, 1); gd.addNumericField("Z sigma:", zsigma, 1); gd.showDialog(); if (gd.wasCanceled()) return false; xsigma = gd.getNextNumber(); ysigma = gd.getNextNumber(); zsigma = gd.getNextNumber(); 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(); }
public boolean setup( final String title ) { final GenericDialog gd = new GenericDialog( title ); addFields( gd ); do { gd.showDialog(); if ( gd.wasCanceled() ) return false; } while ( !readFields( gd ) ); return true; }