private void parseDialogParameters(GenericDialog gd) { // extract chosen parameters this.op = Operation.fromLabel(gd.getNextChoice()); this.connectivity = connectivityValues[gd.getNextChoiceIndex()]; }
@Override protected boolean harvestResults(GenericDialog gd) { String location = gd.getNextChoice(); options.setLocation(location); return true; }
/** * Called when a dialog widget has been modified: recomputes option values * from dialog content. */ public boolean dialogItemChanged(GenericDialog gd, AWTEvent evt) { // set up current parameters weights = ChamferWeights.fromLabel( gd.getNextChoice() ); resultAsFloat = gd.getNextChoiceIndex() == 0; normalize = gd.getNextBoolean(); return true; }
/** * Called when a dialog widget has been modified: recomputes option values * from dialog content. */ public boolean dialogItemChanged(GenericDialog gd, AWTEvent evt) { // set up current parameters operation = Operation.fromLabel(gd.getNextChoice()); connectivity = Conn2D.fromLabel(gd.getNextChoice()); return true; }
private void parseDialogParameters(GenericDialog gd) { // extract chosen parameters this.op = Operation.fromLabel(gd.getNextChoice()); this.dynamic = (int) gd.getNextNumber(); this.connectivity = connectivityValues[gd.getNextChoiceIndex()]; }
@Override protected boolean harvestResults(GenericDialog gd) { String location = gd.getNextChoice(); options.setLocation(location); return true; }
/** * Called when a dialog widget has been modified: recomputes option values * from dialog content. */ public boolean dialogItemChanged(GenericDialog gd, AWTEvent evt) { // set up current parameters String weightLabel = gd.getNextChoice(); floatProcessing = gd.getNextChoiceIndex() == 0; normalize = gd.getNextBoolean(); // identify which weights should be used weights = ChamferWeights.fromLabel(weightLabel); return true; }
private void parseDialogParameters(GenericDialog gd) { // extract chosen parameters this.type = Type.fromLabel(gd.getNextChoice()); this.op = Operation.fromLabel(gd.getNextChoice()); this.lineLength = (int) gd.getNextNumber(); this.nDirections = (int) gd.getNextNumber(); }
/** * Extract chosen parameters * @param gd the instance of GenericDialog used to parse parameters */ private void parseDialogParameters(GenericDialog gd) { this.operation = Operation.fromLabel(gd.getNextChoice()); this.attribute = Attribute.fromLabel(gd.getNextChoice()); this.minimumValue = (int) gd.getNextNumber(); this.connectivity = connectivityValues[gd.getNextChoiceIndex()]; this.previewing = gd.getPreviewCheckbox().getState(); }
/** * analyse dialog, and setup inner fields of the class. */ private void parseDialogOptions() { String tableName = this.gd.getNextChoice(); Frame tableFrame = WindowManager.getFrame(tableName); this.table = ((TextWindow) tableFrame).getTextPanel().getResultsTable(); this.selectedHeaderName = this.gd.getNextChoice(); this.minValue = this.gd.getNextNumber(); this.maxValue = this.gd.getNextNumber(); }
private void parseDialogParameters(GenericDialog gd) { lutName = gd.getNextChoice(); String bgColorName = gd.getNextChoice(); bgColor = CommonColors.fromLabel(bgColorName).getColor(); shuffleLut = gd.getNextBoolean(); // I could not use more than 256 colors for the LUT with ShortProcessor, // problem at // ij.process.ShortProcessor.createBufferedImage(ShortProcessor.java:135) colorMap = CommonLabelMaps.fromLabel(lutName).computeLut(255, shuffleLut); }
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { final String variableName = gd.getNextChoice(); if (e!=null && (e.getSource() instanceof Choice) && !variableName.equals("Insert...")) { final int pos = ta.getCaretPosition(); ((Choice)e.getSource()).select(0); final TextArea textArea = ta; new Thread(new Runnable() { public void run() { IJ.wait(100); textArea.insert(variableName, pos); textArea.setCaretPosition(pos+variableName.length()); textArea.requestFocus(); }}).start(); } return true; }
private void parseDialogParameters(GenericDialog gd) { // extract chosen parameters this.op = Operation.fromLabel(gd.getNextChoice()); this.shape = Strel.Shape.fromLabel(gd.getNextChoice()); this.radius = (int) gd.getNextNumber(); this.showStrel = gd.getNextBoolean(); this.previewing = gd.getPreviewCheckbox().getState(); }
@Override public void run(String arg) { GenericDialog gd = new GenericDialog("Center Transformation"); AmiraParameters.addAmiraTableList(gd, "Model table"); AmiraParameters.addAmiraTableList(gd, "Template table"); gd.addNumericField("radius", 10, 2); gd.showDialog(); if (gd.wasCanceled()) return; String titleM = gd.getNextChoice(); String titleT = gd.getNextChoice(); float radius = (float)gd.getNextNumber(); AmiraTable tableModel = (AmiraTable)WindowManager.getFrame(titleM); AmiraTable tableTemplate = (AmiraTable)WindowManager.getFrame(titleT); bestRigid(tableModel, tableTemplate); }
@Override public void run(final ImageProcessor ip) { final GenericDialog gd = new GenericDialog("Smooth_"); gd.addChoice("Method", new String[] { "Uniform", "Gaussian" }, "Gaussian"); gd.addNumericField("sigma", 1.0f, 3); gd.addCheckbox("Use calibration", true); gd.showDialog(); if (gd.wasCanceled()) return; final boolean useGaussian = gd.getNextChoice().equals("Gaussian"); final float sigma = (float) gd.getNextNumber(); final boolean useCalibration = gd.getNextBoolean(); final ImagePlus smoothed = smooth(image, useGaussian, sigma, useCalibration); smoothed.show(); }
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; }
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; }
@Override public void run(ImageProcessor ip) { GenericDialog gd = new GenericDialog("Center Transformation"); AmiraParameters.addAmiraTableList(gd, "Statistics"); gd.showDialog(); if (gd.wasCanceled()) return; String titleM = gd.getNextChoice(); AmiraTable statistics = (AmiraTable)WindowManager.getFrame(titleM); ImagePlus centers = getCenters(statistics); centers.show(); centers.updateAndDraw(); }
@Override public void run(ImageProcessor ip) { GenericDialog gd = new GenericDialog("Show Label Centers"); AmiraParameters.addAmiraTableList(gd, "Statistics file"); gd.addNumericField("Radius", 10, 2); gd.showDialog(); if (gd.wasCanceled()) return; String title = gd.getNextChoice(); AmiraTable table = (AmiraTable)WindowManager.getFrame(title); double radius = gd.getNextNumber(); calculateCenters(image, table, radius).show(); }
@Override public void run(ImageProcessor ip) { GenericDialog gd = new GenericDialog("Transform Parameters"); AmiraParameters.addAmiraMeshList(gd, "imageToTransform"); gd.addStringField("origPoints", ""); gd.addStringField("transPoints", ""); gd.showDialog(); if (gd.wasCanceled()) return; ImagePlus trans = WindowManager.getImage(gd.getNextChoice()); Point3d[] origPoints = parsePoints(gd.getNextString()); Point3d[] transPoints = parsePoints(gd.getNextString()); ElasticTransformedImage t = new ElasticTransformedImage(new InterpolatedImage(image), new InterpolatedImage(trans), origPoints, transPoints); t.getTransformed().image.show(); }