import ij.*;
import ij.gui.*;
import ij.process.*;
import ij.plugin.frame.*;
import ij.plugin.filter.*;
import java.awt.*;

public class Cell_Segmentation implements PlugInFilter {

  // External
  public RoiManager     roiMgr;
  public ImagePlus      _imp;
  public ImageProcessor _ip;

  // Internal
  public ImagePlus      imp;
  public ImageProcessor ip;

  public int setup(String arg, ImagePlus _imp) {
    // Open ROI Manager
    roiMgr = RoiManager.getInstance();
    if (roiMgr == null)
    roiMgr = new RoiManager();

    // Save original ImagePlus
    this._imp = _imp;

    return DOES_ALL;
  }

  public void run(ImageProcessor _ip) {
    // Save original ImageProcessor
    this._ip = _ip;

    // Create a copy in Gray8 format
    create_gray8_copy();
  }

  public void create_gray8_copy() {
    // Copy the last channel of the original image,
    // since it's the skeleton in Liu's demo image
    int oriC = _imp.getC();
    _imp.setC(_imp.getNChannels());
    ip = _ip.convertToByte(true);
    _imp.setC(oriC);

    // Create a new ImagePlus to display
    imp = new ImagePlus("Cell Segmentation", ip);
    imp.show();
    imp.updateAndDraw();
  }

}

@@ -175,16 +175,84 @@
 lter %7B%0A%0A
+  // Constant%0A  public static final Boolean showProcedure = false;%0A%0A
   // Ext
@@ -253,24 +253,24 @@
 // External%0A
-
   public Roi
@@ -824,24 +824,185 @@
 ay8_copy();%0A
+    if (showProcedure) get_snapshot(%221. Gray8 Format%22);%0A%0A    // Auto threshold%0A    ip.autoThreshold();%0A    if (showProcedure) get_snapshot(%222. Auto Threshold%22);%0A
   %7D%0A%0A  publi
@@ -1294,16 +1294,16 @@
 display%0A
-
     imp 
@@ -1390,10 +1390,190 @@
 );%0A  %7D%0A%0A
+  public void get_snapshot(String title) %7B%0A    ImageProcessor ip = this.ip.duplicate();%0A    ImagePlus imp = new ImagePlus(title, ip);%0A    imp.show();%0A    imp.updateAndDraw();%0A  %7D%0A%0A
 %7D%0A

Add get_snapshot()