ij.gui
Class PointRoi

java.lang.Object
  extended by ij.gui.Roi
      extended by ij.gui.PolygonRoi
          extended by ij.gui.PointRoi
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PointRoi
extends PolygonRoi

This class represents a collection of points.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ij.gui.PolygonRoi
maxPoints, nPoints, splinePoints, xp, xp2, xSpline, yp, yp2, ySpline
 
Fields inherited from class ij.gui.Roi
ANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, defaultFillColor, fillColor, FREELINE, FREEROI, HANDLE_SIZE, handleColor, ic, imp, instanceColor, LINE, lineWidth, mag, MOVING, MOVING_HANDLE, name, nonScalable, NORMAL, NOT_PASTING, oldHeight, oldWidth, oldX, oldY, onePixelWide, OVAL, overlay, pasteMode, POINT, POLYGON, POLYLINE, previousRoi, RECTANGLE, RESIZING, ROIColor, stroke, strokeColor, TRACED_ROI, type, updateFullWindow, wideLine, xMax, yMax
 
Constructor Summary
PointRoi(int[] ox, int[] oy, int points)
          Creates a new PointRoi using the specified arrays of offscreen coordinates.
PointRoi(int ox, int oy)
          Creates a new PointRoi using the specified offscreen coordinates.
PointRoi(int sx, int sy, ImagePlus imp)
          Creates a new PointRoi using the specified screen coordinates.
PointRoi(java.awt.Polygon poly)
          Creates a new PointRoi from a Polygon.
 
Method Summary
 PointRoi addPoint(int x, int y)
          Returns a copy of this PointRoi with a point at (x,y) added.
 boolean contains(int x, int y)
          Returns true if (x,y) is one of the points in this collection.
 void draw(java.awt.Graphics g)
          Draws the points on the image.
 void drawPixels(ImageProcessor ip)
          Draws the selection outline on the specified ImageProcessor.
 ImageProcessor getMask()
          Override Roi.nudge() to support splines.
protected  void handleMouseUp(int sx, int sy)
           
 PointRoi subtractPoints(Roi roi)
          Subtract the points that intersect the specified ROI and return the result.
 
Methods inherited from class ij.gui.PolygonRoi
addOffset, clipRectMargin, clone, exitConstructingMode, fitSpline, fitSpline, fitSplineForStraightening, getAngle, getConvexHull, getFloatPolygon, getLength, getNCoordinates, getNonSplineCoordinates, getPolygon, getUncalibratedLength, getXCoordinates, getYCoordinates, grow, isHandle, isSplineFit, mouseDownInHandle, moveHandle, removeSplineFit, updatePolygon
 
Methods inherited from class ij.gui.Roi
abortPaste, copyAttributes, drawOverlay, drawPixels, endPaste, equals, getAngle, getBoundingRect, getBounds, getColor, getCurrentPasteMode, getDefaultFillColor, getFeretsDiameter, getFeretValues, getFillColor, getImageID, getName, getPasteMode, getRoundRectArcSize, getScaledStroke, getState, getStroke, getStrokeColor, getStrokeWidth, getType, getTypeAsString, handleMouseDown, handleMouseDrag, isArea, isDrawingTool, isLine, isVisible, nudge, nudgeCorner, setColor, setDefaultFillColor, setFillColor, setImage, setInstanceColor, setLineWidth, setLocation, setName, setNonScalable, setPasteMode, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, showStatus, startPaste, toString, update, updateClipRect, updateWideLine
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PointRoi

public PointRoi(int[] ox,
                int[] oy,
                int points)
Creates a new PointRoi using the specified arrays of offscreen coordinates.


PointRoi

public PointRoi(java.awt.Polygon poly)
Creates a new PointRoi from a Polygon.


PointRoi

public PointRoi(int ox,
                int oy)
Creates a new PointRoi using the specified offscreen coordinates.


PointRoi

public PointRoi(int sx,
                int sy,
                ImagePlus imp)
Creates a new PointRoi using the specified screen coordinates.

Method Detail

handleMouseUp

protected void handleMouseUp(int sx,
                             int sy)
Overrides:
handleMouseUp in class PolygonRoi

draw

public void draw(java.awt.Graphics g)
Draws the points on the image.

Overrides:
draw in class PolygonRoi

drawPixels

public void drawPixels(ImageProcessor ip)
Description copied from class: Roi
Draws the selection outline on the specified ImageProcessor.

Overrides:
drawPixels in class PolygonRoi
See Also:
ImageProcessor.setColor(java.awt.Color), ImageProcessor.setLineWidth(int)

addPoint

public PointRoi addPoint(int x,
                         int y)
Returns a copy of this PointRoi with a point at (x,y) added.


subtractPoints

public PointRoi subtractPoints(Roi roi)
Subtract the points that intersect the specified ROI and return the result. Returns null if there are no resulting points.


getMask

public ImageProcessor getMask()
Description copied from class: PolygonRoi
Override Roi.nudge() to support splines.

Overrides:
getMask in class PolygonRoi

contains

public boolean contains(int x,
                        int y)
Returns true if (x,y) is one of the points in this collection.

Overrides:
contains in class PolygonRoi