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

Method run

ij/src/main/java/ij/plugin/filter/Binary.java:125–150  ·  view source on GitHub ↗
(ImageProcessor ip)

Source from the content-addressed store, hash-verified

123 }
124
125 public void run (ImageProcessor ip) {
126 int fg = Prefs.blackBackground ? 255 : 0;
127 foreground = ip.isInvertedLut() ? 255-fg : fg;
128 background = 255 - foreground;
129 ip.setSnapshotCopyMode(true);
130 if (arg.equals("median"))
131 median(ip);
132 else if (arg.equals("outline"))
133 outline(ip);
134 else if (arg.startsWith("fill"))
135 fill(ip, foreground, background);
136 else if (arg.startsWith("skel")) {
137 ip.resetRoi();
138 skeletonize(ip);
139 } else if (arg.equals("erode") || arg.equals("dilate"))
140 doIterations((ByteProcessor)ip, arg);
141 else if (arg.equals("open")) {
142 doIterations(ip, "erode");
143 doIterations(ip, "dilate");
144 } else if (arg.equals("close")) {
145 doIterations(ip, "dilate");
146 doIterations(ip, "erode");
147 }
148 ip.setSnapshotCopyMode(false);
149 ip.setBinaryThreshold();
150 }
151
152 void doIterations (ImageProcessor ip, String mode) {
153 if (escapePressed) return;

Callers

nothing calls this directly

Calls 11

medianMethod · 0.95
outlineMethod · 0.95
fillMethod · 0.95
skeletonizeMethod · 0.95
doIterationsMethod · 0.95
setSnapshotCopyModeMethod · 0.80
startsWithMethod · 0.80
setBinaryThresholdMethod · 0.80
isInvertedLutMethod · 0.45
equalsMethod · 0.45
resetRoiMethod · 0.45

Tested by

no test coverage detected