- java.lang.Object
- 
- ij.gui.Roi
- 
- ij.gui.PolygonRoi
- 
- ij.gui.PointRoi
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable,- java.lang.Iterable<java.awt.Point>
 
 public class PointRoi extends PolygonRoi This class represents a collection of points that can be associated with counters. Use the getPolygon() or getFloatPolygon() methods to retrieve the coordinates of the points.- See Also:
- PointProperties.js, Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intCIRCLEstatic intCROSSstatic intCROSSHAIRstatic intDOTstatic intHYBRIDstatic intMAX_COUNTERSstatic PointRoisavedPointsstatic java.lang.String[]sizesstatic java.lang.String[]types- 
Fields inherited from class ij.gui.PolygonRoimaxPoints, nPoints, splinePoints, xp, xp2, xpf, xSpline, yp, yp2, ypf, ySpline
 - 
Fields inherited from class ij.gui.RoiANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, defaultColor, defaultFillColor, FERET_ARRAY_POINTOFFSET, FERET_ARRAYSIZE, fillColor, flattenScale, FREELINE, FREEROI, HANDLE_SIZE, handleColor, ic, ignoreClipRect, imp, instanceColor, LINE, lineWidth, mag, MOVING, MOVING_HANDLE, nonScalable, NORMAL, NOT_PASTING, oldHeight, oldWidth, oldX, oldY, onePixelWide, OVAL, overlay, pasteMode, POINT, POLYGON, POLYLINE, previousRoi, RECTANGLE, RESIZING, ROIColor, stroke, strokeColor, TRACED_ROI, updateFullWindow, wideLine, xMax, yMax
 
- 
 - 
Constructor SummaryConstructors Constructor Description PointRoi()PointRoi(double ox, double oy)Creates a new PointRoi using the specified offscreen double coordinates.PointRoi(double ox, double oy, java.lang.String options)Creates a new PointRoi using the specified coordinates and options.PointRoi(float[] ox, float[] oy)Creates a new PointRoi using the specified float arrays of offscreen coordinates.PointRoi(float[] ox, float[] oy, int points)Creates a new PointRoi using the specified float arrays of offscreen coordinates.PointRoi(float[] ox, float[] oy, java.lang.String options)Creates a new PointRoi using the specified coordinate arrays and options.PointRoi(int[] ox, int[] oy, int points)Creates a new PointRoi using the specified int arrays of offscreen coordinates.PointRoi(int ox, int oy)Creates a new PointRoi using the specified offscreen int coordinates.PointRoi(int sx, int sy, ImagePlus imp)Creates a new PointRoi using the specified screen coordinates.PointRoi(FloatPolygon poly)Creates a new PointRoi from a FloatPolygon.PointRoi(java.awt.Polygon poly)Creates a new PointRoi from a Polygon.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PointRoiaddPoint(double x, double y)Adds a point to this PointRoi.voidaddPoint(double x, double y, int position)Adds a point at the specified stack position.voidaddPoint(ImagePlus imp, double ox, double oy)Adds a point to this PointRoi.booleanaddToOverlay()voidaddUserPoint(ImagePlus imp, double ox, double oy)java.lang.Objectclone()Returns a copy of this PointRoi.PointRoicontainedPoints(Roi roi)Returns the points of this Roi that are contained in the specified area ROI.booleancontains(int x, int y)Returns true if (x,y) is one of the points in this collection.voidcopyAttributes(Roi roi2)Copy the attributes (outline color, fill color, outline width) of 'roi2' to the this selection.PointRoicrop(Roi roi)protected voiddeletePoint(int index)voiddisplayCounts()voiddraw(java.awt.Graphics g)Draws the points on the image.voiddrawPixels(ImageProcessor ip)Draws the selection outline on the specified ImageProcessor.protected intgetClosestPoint(double x, double y, FloatPolygon points)FloatPolygongetContainedFloatPoints()Returns the points as a FloatPolygon.java.awt.Point[]getContainedPoints()Returns the points as an array of Points.intgetCount(int counter)Returns the count associated with the specified counter index.intgetCounter()Returns the index of the current counter.intgetCounter(int index)Returns the counter assocated with the specified point.static java.lang.String[]getCounterChoices()int[]getCounterInfo()int[]getCounters()Returns an array containing for each point: The counter number (0-100) in the lower 8 bits, and the slice number (or 0, if the point appears on all slices) in the higher 24 bits.static java.awt.ColorgetDefaultCrossColor()Deprecatedstatic java.lang.StringgetDefaultMarkerSize()Deprecated.static intgetDefaultSize()Returns the default point size 0-6 (Tiny-XXXL).static intgetDefaultType()intgetLastCounter()Returns the index of the last counter.ImageProcessorgetMask()Always returns null for rectangular Roi'sintgetNCounters()Returns the number of counters.intgetPointPosition(int index)Returns the stack slice of the point with the given index, or 0 if no slice defined for this pointintgetPointType()Returns the point type (0=hybrid, 1=cross, 2=dot, 3=circle).booleangetShowLabels()intgetSize()Returns the current point size 0-6 (Tiny-XXXL).protected voidhandleMouseUp(int sx, int sy)With segmented selections, ignore first mouse up and finalize when user double-clicks, control-clicks or clicks in start box.intisHandle(int sx, int sy)Returns a point index if it has been at least one second since the last point was added and the specified screen coordinates are inside or near a point, otherwise returns -1.java.util.Iterator<java.awt.Point>iterator()Custom iterator for points contained in aPointRoi.booleanpromptBeforeDeleting()voidpromptBeforeDeleting(java.lang.Boolean prompt)voidresetCounters()voidsetCounter(int counter)voidsetCounterInfo(int[] info)voidsetCounters(int[] counters)Sets the counter number and slice number for each point from an array, where the lower 8 bits are the counter number and the higher 24 bits contain the slice position of each point.static voidsetDefaultCounter(int counter)static voidsetDefaultCrossColor(java.awt.Color color)Deprecatedstatic voidsetDefaultMarkerSize(java.lang.String size)Deprecated.static voidsetDefaultSize(int size)Sets the default point size, where 'size' is 0-6 (Tiny-XXXL).static voidsetDefaultType(int type)voidsetHideLabels(boolean hideLabels)Deprecated.voidsetOptions(java.lang.String options)voidsetPointType(int type)Sets the point type (0=hybrid, 1=cross, 2=dot, 3=circle).voidsetShowLabels(boolean showLabels)voidsetSize(int size)Sets the point size, where 'size' is 0-6 (Tiny-XXXL).booleansubPixelResolution()Always returns true.PointRoisubtractPoints(Roi roi)Returns the points of this Roi that are not contained in the specified area ROI.java.lang.StringtoString()voidupdateCounts()Updates the counts for each category in 'counters'- 
Methods inherited from class ij.gui.PolygonRoiaddOffset, clipRectMargin, containsPoint, deleteHandle, enableSubPixelResolution, exitConstructingMode, fitSpline, fitSpline, fitSplineForStraightening, getAngle, getDebugInfo, getFloatPolygon, getInterpolatedPolygon, getLength, getNCoordinates, getNonSplineCoordinates, getNonSplineFloatPolygon, getPolygon, getUncalibratedLength, getXCoordinates, getYCoordinates, grow, isSplineFit, mouseDownInHandle, mouseMoved, moveHandle, removeSplineFit, resetBoundingRect, setLocation, size, updatePolygon, wipeBack
 - 
Methods inherited from class ij.gui.RoiabortModification, abortPaste, addRoiListener, convertLineToArea, convertToPolygon, create, create, drawOverlay, drawPixels, endPaste, equals, getAngle, getAntiAlias, getBoundingRect, getBounds, getColor, getContourCentroid, getConvexHull, getCornerDiameter, getCPosition, getCurrentPasteMode, getDefaultFillColor, getDefaultGroup, getDefaultHandleSize, getDefaultStrokeWidth, getDrawOffset, getFeretsDiameter, getFeretValues, getFillColor, getFloatAngle, getFloatBounds, getFloatConvexHull, getFloatHeight, getFloatPolygon, getFloatWidth, getGroup, getGroupName, getGroupNames, getHandleSize, getHashCode, getImage, getImageID, getInterpolatedPolygon, getInterpolatedPolygon, getInverse, getListeners, getMagnification, getName, getPasteMode, getPosition, getPreviousRoi, getProperties, getProperty, getPropertyCount, getPrototypeOverlay, getRotationCenter, getRoundRectArcSize, getScaledStroke, getScaleStrokeWidth, getState, getStatistics, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getTypeAsString, getXBase, getYBase, getZPosition, handleMouseDown, handleMouseDrag, hasHyperStackPosition, isActiveOverlayRoi, isArea, isCursor, isDrawingTool, isInteger, isLine, isLineOrPoint, isVisible, lineCircleIntersection, magnificationForSubPixel, magnificationForSubPixel, mouseDragged, mouseReleased, notifyListeners, nudge, nudgeCorner, offScreenX, offScreenXD, offScreenY, offScreenYD, removeRoiListener, resetDefaultHandleSize, saveGroupNames, screenX, screenXD, screenY, screenYD, setAntiAlias, setBounds, setColor, setCornerDiameter, setDefaultColor, setDefaultFillColor, setDefaultGroup, setDefaultStrokeWidth, setDrawOffset, setFillColor, setFlattenScale, setGroup, setGroupName, setGroupNames, setHandleSize, setIgnoreClipRect, setImage, setInstanceColor, setIsCursor, setLineWidth, setLocation, setName, setNonScalable, setPasteMode, setPosition, setPosition, setPosition, setPreviousRoi, setProperties, setProperty, setPrototypeOverlay, setRenderingHint, setRotationCenter, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth, setUnscalableStrokeWidth, showStatus, startPaste, temporarilyHide, toFloat, toInt, toInt, toIntR, translate, update, updateClipRect, updateWideLine, useLineSubpixelConvention, xor
 
- 
 
- 
- 
- 
Field Detail- 
sizespublic static final java.lang.String[] sizes 
 - 
typespublic static final java.lang.String[] types 
 - 
HYBRIDpublic static final int HYBRID - See Also:
- Constant Field Values
 
 - 
CROSSpublic static final int CROSS - See Also:
- Constant Field Values
 
 - 
CROSSHAIRpublic static final int CROSSHAIR - See Also:
- Constant Field Values
 
 - 
DOTpublic static final int DOT - See Also:
- Constant Field Values
 
 - 
CIRCLEpublic static final int CIRCLE - See Also:
- Constant Field Values
 
 - 
MAX_COUNTERSpublic static final int MAX_COUNTERS - See Also:
- Constant Field Values
 
 - 
savedPointspublic static PointRoi savedPoints 
 
- 
 - 
Constructor Detail- 
PointRoipublic PointRoi() 
 - 
PointRoipublic PointRoi(int[] ox, int[] oy, int points)Creates a new PointRoi using the specified int arrays of offscreen coordinates.
 - 
PointRoipublic PointRoi(float[] ox, float[] oy, int points)Creates a new PointRoi using the specified float arrays of offscreen coordinates.
 - 
PointRoipublic PointRoi(float[] ox, float[] oy)Creates a new PointRoi using the specified float arrays of offscreen coordinates.
 - 
PointRoipublic PointRoi(float[] ox, float[] oy, java.lang.String options)Creates a new PointRoi using the specified coordinate arrays and options.
 - 
PointRoipublic PointRoi(FloatPolygon poly) Creates a new PointRoi from a FloatPolygon.
 - 
PointRoipublic PointRoi(java.awt.Polygon poly) Creates a new PointRoi from a Polygon.
 - 
PointRoipublic PointRoi(double ox, double oy, java.lang.String options)Creates a new PointRoi using the specified coordinates and options.
 - 
PointRoipublic PointRoi(int ox, int oy)Creates a new PointRoi using the specified offscreen int coordinates.
 - 
PointRoipublic PointRoi(double ox, double oy)Creates a new PointRoi using the specified offscreen double coordinates.
 - 
PointRoipublic PointRoi(int sx, int sy, ImagePlus imp)Creates a new PointRoi using the specified screen coordinates.
 
- 
 - 
Method Detail- 
setOptionspublic void setOptions(java.lang.String options) 
 - 
handleMouseUpprotected void handleMouseUp(int sx, int sy)Description copied from class:PolygonRoiWith segmented selections, ignore first mouse up and finalize when user double-clicks, control-clicks or clicks in start box.- Overrides:
- handleMouseUpin class- PolygonRoi
 
 - 
drawpublic void draw(java.awt.Graphics g) Draws the points on the image.- Overrides:
- drawin class- PolygonRoi
 
 - 
drawPixelspublic void drawPixels(ImageProcessor ip) Description copied from class:RoiDraws the selection outline on the specified ImageProcessor.- Overrides:
- drawPixelsin class- PolygonRoi
- See Also:
- ImageProcessor.setColor(java.awt.Color),- ImageProcessor.setLineWidth(int)
 
 - 
addPointpublic void addPoint(ImagePlus imp, double ox, double oy) Adds a point to this PointRoi.
 - 
addUserPointpublic void addUserPoint(ImagePlus imp, double ox, double oy) 
 - 
addPointpublic PointRoi addPoint(double x, double y) Adds a point to this PointRoi.
 - 
addPointpublic void addPoint(double x, double y, int position)Adds a point at the specified stack position.
 - 
deletePointprotected void deletePoint(int index) - Overrides:
- deletePointin class- PolygonRoi
 
 - 
getCounterpublic int getCounter() Returns the index of the current counter.
 - 
getCountpublic int getCount(int counter) Returns the count associated with the specified counter index.- See Also:
- getLastCounter(), PointProperties.js
 
 - 
getLastCounterpublic int getLastCounter() Returns the index of the last counter.
 - 
getNCounterspublic int getNCounters() Returns the number of counters.
 - 
getCounterpublic int getCounter(int index) Returns the counter assocated with the specified point.
 - 
resetCounterspublic void resetCounters() 
 - 
subtractPointspublic PointRoi subtractPoints(Roi roi) Returns the points of this Roi that are not contained in the specified area ROI. Returns null if there are no resulting points or Roi is not an area roi.
 - 
containedPointspublic PointRoi containedPoints(Roi roi) Returns the points of this Roi that are contained in the specified area ROI. Returns null if there are no resulting points or Roi is not an area roi.
 - 
getMaskpublic ImageProcessor getMask() Description copied from class:RoiAlways returns null for rectangular Roi's- Overrides:
- getMaskin class- PolygonRoi
 
 - 
containspublic boolean contains(int x, int y)Returns true if (x,y) is one of the points in this collection.- Overrides:
- containsin class- PolygonRoi
 
 - 
setShowLabelspublic void setShowLabels(boolean showLabels) 
 - 
getShowLabelspublic boolean getShowLabels() 
 - 
setDefaultTypepublic static void setDefaultType(int type) 
 - 
getDefaultTypepublic static int getDefaultType() 
 - 
setPointTypepublic void setPointType(int type) Sets the point type (0=hybrid, 1=cross, 2=dot, 3=circle).
 - 
getPointTypepublic int getPointType() Returns the point type (0=hybrid, 1=cross, 2=dot, 3=circle).
 - 
setDefaultSizepublic static void setDefaultSize(int size) Sets the default point size, where 'size' is 0-6 (Tiny-XXXL).
 - 
getDefaultSizepublic static int getDefaultSize() Returns the default point size 0-6 (Tiny-XXXL).
 - 
setSizepublic void setSize(int size) Sets the point size, where 'size' is 0-6 (Tiny-XXXL).
 - 
getSizepublic int getSize() Returns the current point size 0-6 (Tiny-XXXL).
 - 
subPixelResolutionpublic boolean subPixelResolution() Always returns true.- Overrides:
- subPixelResolutionin class- Roi
 
 - 
setCounterpublic void setCounter(int counter) 
 - 
promptBeforeDeletingpublic boolean promptBeforeDeleting() 
 - 
promptBeforeDeletingpublic void promptBeforeDeleting(java.lang.Boolean prompt) 
 - 
setDefaultCounterpublic static void setDefaultCounter(int counter) 
 - 
getCounterspublic int[] getCounters() Returns an array containing for each point: The counter number (0-100) in the lower 8 bits, and the slice number (or 0, if the point appears on all slices) in the higher 24 bits. Used when writing a Roi to file (RoiEncoder)
 - 
setCounterspublic void setCounters(int[] counters) Sets the counter number and slice number for each point from an array, where the lower 8 bits are the counter number and the higher 24 bits contain the slice position of each point. Used when reading a roi fromfile (RoiDecoder).
 - 
updateCountspublic void updateCounts() Updates the counts for each category in 'counters'
 - 
getPointPositionpublic int getPointPosition(int index) Returns the stack slice of the point with the given index, or 0 if no slice defined for this point
 - 
displayCountspublic void displayCounts() 
 - 
getCounterChoicespublic static java.lang.String[] getCounterChoices() 
 - 
isHandlepublic int isHandle(int sx, int sy)Returns a point index if it has been at least one second since the last point was added and the specified screen coordinates are inside or near a point, otherwise returns -1.- Overrides:
- isHandlein class- PolygonRoi
 
 - 
getContainedPointspublic java.awt.Point[] getContainedPoints() Returns the points as an array of Points. Wilhelm Burger: modified to use FloatPolygon for correct point positions.- Overrides:
- getContainedPointsin class- Roi
- See Also:
- Roi.getContainedFloatPoints(),- Roi.iterator()
 
 - 
getContainedFloatPointspublic FloatPolygon getContainedFloatPoints() Returns the points as a FloatPolygon.- Overrides:
- getContainedFloatPointsin class- Roi
- See Also:
- Roi.getContainedPoints(),- Roi.iterator()
 
 - 
iteratorpublic java.util.Iterator<java.awt.Point> iterator() Custom iterator for points contained in aPointRoi. Author: W. Burger- Specified by:
- iteratorin interface- java.lang.Iterable<java.awt.Point>
- Overrides:
- iteratorin class- Roi
- See Also:
- Roi.getContainedPoints(),- Roi.getContainedFloatPoints()
 
 - 
getClosestPointprotected int getClosestPoint(double x, double y, FloatPolygon points)- Overrides:
- getClosestPointin class- PolygonRoi
 
 - 
clonepublic java.lang.Object clone() Returns a copy of this PointRoi.- Overrides:
- clonein class- PolygonRoi
 
 - 
copyAttributespublic void copyAttributes(Roi roi2) Description copied from class:RoiCopy the attributes (outline color, fill color, outline width) of 'roi2' to the this selection.- Overrides:
- copyAttributesin class- Roi
 
 - 
setCounterInfopublic void setCounterInfo(int[] info) 
 - 
getCounterInfopublic int[] getCounterInfo() 
 - 
addToOverlaypublic boolean addToOverlay() 
 - 
setHideLabelspublic void setHideLabels(boolean hideLabels) Deprecated.
 - 
setDefaultMarkerSizepublic static void setDefaultMarkerSize(java.lang.String size) Deprecated.
 - 
getDefaultMarkerSizepublic static java.lang.String getDefaultMarkerSize() Deprecated.
 - 
setDefaultCrossColorpublic static void setDefaultCrossColor(java.awt.Color color) Deprecated
 - 
getDefaultCrossColorpublic static java.awt.Color getDefaultCrossColor() Deprecated
 
- 
 
-