private boolean readThresholdFromImp() { boolean successfulRead = true; final double minT = imp.getProcessor().getMinThreshold(); final double maxT = imp.getProcessor().getMaxThreshold(); if (imp.getProcessor().isBinary()) { lowerT = 1; upperT = 255; } else if (imp.isThreshold()) { lowerT = minT; upperT = maxT; } else { successfulRead = false; } return successfulRead; }
Roi roi = imp.getRoi(); imp.deleteRoi(); if (imp.isThreshold()) imp.getProcessor().resetThreshold(); boolean saveChanges = imp.changes;
Roi roi = imp.getRoi(); imp.deleteRoi(); if (imp.isThreshold()) imp.getProcessor().resetThreshold(); boolean saveChanges = imp.changes;
boolean thresholdSet = imp.isThreshold(); this.imp = imp; if (!IJ.isMacro()) {
double tolerance = WandToolOptions.getTolerance(); Roi roi = imp.getRoi(); if (roi!=null && (tolerance==0.0||imp.isThreshold()) && roi.contains(ox, oy)) { Rectangle r = roi.getBounds(); if (r.width==imageWidth && r.height==imageHeight)
boolean thresholdSet = imp.isThreshold(); this.imp = imp; if (!IJ.isMacro()) {
double tolerance = WandToolOptions.getTolerance(); Roi roi = imp.getRoi(); if (roi!=null && (tolerance==0.0||imp.isThreshold()) && roi.contains(ox, oy)) { Rectangle r = roi.getBounds(); if (r.width==imageWidth && r.height==imageHeight)
public void run(String arg) { imp = WindowManager.getCurrentImage(); Roi roi = imp!=null?imp.getRoi():null; boolean selection = roi!=null && (roi.getType()==Roi.TRACED_ROI||roi.getType()==Roi.POLYGON); if (imp==null || (ID!=0&&imp.getID()!=ID) || !selection) startx = starty = 0; ID = imp!=null?imp.getID():0; double sliderMax = 255; int depth = imp!=null?imp.getBitDepth():0; if (depth==16 || depth==32) { sliderMax = imp.getProcessor().getMax(); if (depth==32) sliderMax+=0.0000000001; } showCheckbox = imp!=null && depth!=24 && WindowManager.getFrame("Threshold")==null && !imp.isThreshold(); GenericDialog gd = new GenericDialog("Wand Tool"); gd.addSlider("Tolerance: ", 0, sliderMax, tolerance); gd.addChoice("Mode:", modes, mode); if (showCheckbox) gd.addCheckbox("Enable Thresholding", false); gd.addCheckbox("Smooth if thresholded", Prefs.smoothWand); if (showCheckbox) { gd.setInsets(2,0,0); gd.addMessage("Thresholded objects are traced and \"Tolerance\"\nis ignored when thresholding is enabled."); } gd.addDialogListener(this); gd.showDialog(); }
public void run(String arg) { imp = WindowManager.getCurrentImage(); Roi roi = imp!=null?imp.getRoi():null; boolean selection = roi!=null && (roi.getType()==Roi.TRACED_ROI||roi.getType()==Roi.POLYGON); if (imp==null || (ID!=0&&imp.getID()!=ID) || !selection) startx = starty = 0; ID = imp!=null?imp.getID():0; double sliderMax = 255; int depth = imp!=null?imp.getBitDepth():0; if (depth==16 || depth==32) { sliderMax = imp.getProcessor().getMax(); if (depth==32) sliderMax+=0.0000000001; } showCheckbox = imp!=null && depth!=24 && WindowManager.getFrame("Threshold")==null && !imp.isThreshold(); GenericDialog gd = new GenericDialog("Wand Tool"); gd.addSlider("Tolerance: ", 0, sliderMax, tolerance); gd.addChoice("Mode:", modes, mode); if (showCheckbox) gd.addCheckbox("Enable Thresholding", false); gd.addCheckbox("Smooth if thresholded", Prefs.smoothWand); if (showCheckbox) { gd.setInsets(2,0,0); gd.addMessage("Thresholded objects are traced and \"Tolerance\"\nis ignored when thresholding is enabled."); } gd.addDialogListener(this); gd.showDialog(); }
Prefs.useInvertingLut = false; boolean selectAll = roi!=null && roi.getType()==Roi.RECTANGLE && roi.getBounds().width==imp.getWidth() && roi.getBounds().height==imp.getHeight() && imp.isThreshold(); boolean overlay = imp.getOverlay()!=null && imp.getProcessor().getMinThreshold()==ImageProcessor.NO_THRESHOLD; if (!overlay && (roi==null || selectAll)) {
Prefs.useInvertingLut = false; boolean selectAll = roi!=null && roi.getType()==Roi.RECTANGLE && roi.getBounds().width==imp.getWidth() && roi.getBounds().height==imp.getHeight() && imp.isThreshold(); boolean overlay = imp.getOverlay()!=null && imp.getProcessor().getMinThreshold()==ImageProcessor.NO_THRESHOLD; if (!overlay && (roi==null || selectAll)) {