Example #1
0
 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);
   }
 }
Example #2
0
 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();
 }
Example #3
0
 void outline(ImageProcessor ip) {
   if (Prefs.blackBackground) ip.invert();
   ((ByteProcessor) ip).outline();
   if (Prefs.blackBackground) ip.invert();
 }