void doIterations(ImageProcessor ip, String mode) { if (escapePressed) return; if (!previewing && iterations > 1) IJ.showStatus(arg + "... press ESC to cancel"); for (int i = 0; i < iterations; i++) { if (Thread.currentThread().isInterrupted()) return; if (IJ.escapePressed()) { escapePressed = true; ip.reset(); return; } if (mode.equals("erode")) ((ByteProcessor) ip).erode(count, background); else ((ByteProcessor) ip).dilate(count, background); } }
void skeletonize(ImageProcessor ip) { if (Prefs.blackBackground) ip.invert(); boolean edgePixels = hasEdgePixels(ip); ImageProcessor ip2 = expand(ip, edgePixels); ((ByteProcessor) ip2).skeletonize(); ip = shrink(ip, ip2, edgePixels); if (Prefs.blackBackground) ip.invert(); }
void outline(ImageProcessor ip) { if (Prefs.blackBackground) ip.invert(); ((ByteProcessor) ip).outline(); if (Prefs.blackBackground) ip.invert(); }