MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setAutoThreshold

Method setAutoThreshold

ij/src/main/java/ij/IJ.java:1565–1583  ·  view source on GitHub ↗

Replaced by ImagePlus.setAutoThreshold().

(ImagePlus imp, String method)

Source from the content-addressed store, hash-verified

1563
1564 /** Replaced by ImagePlus.setAutoThreshold(). */
1565 public static void setAutoThreshold(ImagePlus imp, String method) {
1566 ImageProcessor ip = imp.getProcessor();
1567 if (ip instanceof ColorProcessor)
1568 throw new IllegalArgumentException("Non-RGB image required");
1569 ip.setRoi(imp.getRoi());
1570 if (method!=null) {
1571 try {
1572 if (method.indexOf("stack")!=-1)
1573 setStackThreshold(imp, ip, method);
1574 else
1575 ip.setAutoThreshold(method);
1576 } catch (Exception e) {
1577 log(e.getMessage());
1578 }
1579 } else
1580 ip.setAutoThreshold(ImageProcessor.ISODATA2, ImageProcessor.RED_LUT);
1581 ThresholdAdjuster.setMethod(method);
1582 imp.updateAndDraw();
1583 }
1584
1585 private static void setStackThreshold(ImagePlus imp, ImageProcessor ip, String method) {
1586 boolean darkBackground = method.contains("dark");

Callers 2

setAutoThresholdMethod · 0.95
analyzeParticlesMethod · 0.95

Calls 10

setRoiMethod · 0.95
setStackThresholdMethod · 0.95
setAutoThresholdMethod · 0.95
logMethod · 0.95
setMethodMethod · 0.95
getProcessorMethod · 0.45
getRoiMethod · 0.45
indexOfMethod · 0.45
getMessageMethod · 0.45
updateAndDrawMethod · 0.45

Tested by

no test coverage detected