ij.gui
Class Wand

java.lang.Object
  extended by ij.gui.Wand

public class Wand
extends java.lang.Object

This class implements ImageJ's wand (tracing) tool.


Field Summary
 int npoints
          The number of points in the generated outline.
 int[] xpoints
          The x-coordinates of the points in the outline.
 int[] ypoints
          The y-coordinates of the points in the outline.
 
Constructor Summary
Wand(ImageProcessor ip)
          Constructs a Wand object from either a ByteProcessor or a ColorProcessor.
 
Method Summary
 void autoOutline(int startX, int startY)
          Traces the boundary of an area of uniform color, where 'startX' and 'startY' are somewhere inside the area.
 void autoOutline(int startX, int startY, int lower, int upper)
          Traces an object defined by lower and upper threshold values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

npoints

public int npoints
The number of points in the generated outline.


xpoints

public int[] xpoints
The x-coordinates of the points in the outline.


ypoints

public int[] ypoints
The y-coordinates of the points in the outline.

Constructor Detail

Wand

public Wand(ImageProcessor ip)
Constructs a Wand object from either a ByteProcessor or a ColorProcessor.

Method Detail

autoOutline

public void autoOutline(int startX,
                        int startY)
Traces the boundary of an area of uniform color, where 'startX' and 'startY' are somewhere inside the area. The boundary points are stored in the public xpoints and ypoints fields. A 16 entry lookup table is used to determine the direction at each step of the tracing process.


autoOutline

public void autoOutline(int startX,
                        int startY,
                        int lower,
                        int upper)
Traces an object defined by lower and upper threshold values. The boundary points are stored in the public xpoints and ypoints fields.