(ImageProcessor ip)
| 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; |
nothing calls this directly
no test coverage detected