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; }
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; }
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() }; }
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; }
private boolean showDialog(String name) { GenericDialog gd = new GenericDialog(name); gd.addNumericField("X radius:", xradius, 1); gd.addNumericField("Y radius:", yradius, 1); gd.addNumericField("Z radius:", zradius, 1); gd.showDialog(); if (gd.wasCanceled()) { return false; } xradius = (float) gd.getNextNumber(); yradius = (float) gd.getNextNumber(); zradius = (float) gd.getNextNumber(); return true; }
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; }
private boolean showDialog(String name) { GenericDialog gd = new GenericDialog(name); gd.addNumericField("X radius:", xradius, 1); gd.addNumericField("Y radius:", yradius, 1); gd.addNumericField("Z radius:", zradius, 1); gd.showDialog(); if (gd.wasCanceled()) { return false; } xradius = (float) gd.getNextNumber(); yradius = (float) gd.getNextNumber(); zradius = (float) gd.getNextNumber(); 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; }
@Override public void run(ImageProcessor ip) { GenericDialog gd = new GenericDialog("Replace value"); gd.addNumericField("Pattern: [0..255] ", 0, 0); gd.addNumericField("Replacement: [0.255] ", 0, 0); gd.showDialog(); if(gd.wasCanceled()) return; doit((int)gd.getNextNumber(), (int)gd.getNextNumber()); }
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; }
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("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; }
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
public boolean params() { GenericDialog gd = new GenericDialog("Nonlinear diffusion", imp.getWindow()); gd.addNumericField("lambda", lambda, 2); gd.addNumericField("iterations", (float) iterations, 0); gd.addNumericField("k", k, 2); gd.showDialog(); if (gd.wasCanceled()) return false; lambda = (float) gd.getNextNumber(); iterations = (int) gd.getNextNumber(); k = (float) gd.getNextNumber(); return true; } public void compute()
public boolean params(ImagePlus imp, VolumeFloat v) { this.v = v; GenericDialog gd = new GenericDialog("3D diffusion", imp.getWindow()); gd.addNumericField("lambda", lambda, 2); gd.addNumericField("iterations", (double) iterations, 0); gd.addNumericField("k", k, 2); gd.showDialog(); if (gd.wasCanceled()) return false; lambda = gd.getNextNumber(); iterations = (int) gd.getNextNumber(); k = gd.getNextNumber(); return true; } public void compute3D()
public void run(ImageProcessor ip) { int current = image.getCurrentSlice(); GenericDialog gd = new GenericDialog("Delete Frame"); gd.addNumericField("Slice", current, 0); gd.addNumericField("Number of slices", DEF_NUM_SLICES, 0); gd.showDialog(); if(gd.wasCanceled()) return; int slice = (int)gd.getNextNumber(); int num = (int)gd.getNextNumber(); deleteFrames(image, slice, num); }
int getNumber() { if (imp.getType()!=ImagePlus.COLOR_RGB) return 256; GenericDialog gd = new GenericDialog("MedianCut"); gd.addNumericField("Number of Colors (2-256):", 256, 0); gd.showDialog(); if (gd.wasCanceled()) return 0; int n = (int)gd.getNextNumber(); if (n<2) n = 2; if (n>256) n = 256; return n; }
public void run(ImageProcessor ip) { int current = image.getCurrentSlice(); GenericDialog gd = new GenericDialog("Add Frame"); gd.addNumericField("After slice", current, 0); gd.addNumericField("Number of slices", DEF_NUM_SLICES, 0); gd.showDialog(); if(gd.wasCanceled()) return; int slice = (int)gd.getNextNumber(); int num = (int)gd.getNextNumber(); addFrames(image, slice, num); }