Package ij.gui
Class PointRoi
java.lang.Object
ij.gui.Roi
ij.gui.PolygonRoi
ij.gui.PointRoi
- All Implemented Interfaces:
Serializable
,Cloneable
This class represents a collection of points.
- See Also:
-
Field Summary
FieldsFields inherited from class ij.gui.PolygonRoi
maxPoints, nPoints, splinePoints, xp, xp2, xpf, xSpline, yp, yp2, ypf, 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, 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 Summary
ConstructorsConstructorDescriptionPointRoi
(double ox, double oy) Creates a new PointRoi using the specified offscreen double coordinates.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
(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.Creates a new PointRoi using the specified screen coordinates.PointRoi
(FloatPolygon poly) Creates a new PointRoi from a FloatPolygon.Creates a new PointRoi from a Polygon. -
Method Summary
Modifier and TypeMethodDescriptionaddPoint
(double x, double y) Adds a point to this PointRoi.void
Adds a point to this PointRoi.clone()
Returns a copy of this PointRoi.boolean
contains
(int x, int y) Returns true if (x,y) is one of the points in this collection.protected void
deletePoint
(int index) void
void
Draws the points on the image.void
Draws the selection outline on the specified ImageProcessor.int
getCount
(int counter) int
static String[]
int[]
static Color
Deprecatedstatic String
Deprecated.static int
static int
getMask()
Always returns null for rectangular Roi'sint
getPointPosition
(int index) int
Returns the point type (0=hybrid, 1=crosshair, 2=dot, 3=circle).boolean
int
getSize()
Returns the point size (0-4).protected void
handleMouseUp
(int sx, int sy) With segmented selections, ignore first mouse up and finalize when user double-clicks, control-clicks or clicks in start box.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.void
void
setCounter
(int counter) void
setCounters
(int[] counters) static void
setDefaultCounter
(int counter) static void
setDefaultCrossColor
(Color color) Deprecatedstatic void
setDefaultMarkerSize
(String size) Deprecated.static void
setDefaultSize
(int index) static void
setDefaultType
(int type) void
setHideLabels
(boolean hideLabels) Deprecated.void
setPointType
(int type) Sets the point type (0=hybrid, 1=crosshair, 2=dot, 3=circle).void
setShowLabels
(boolean showLabels) void
setSize
(int size) Sets the point size, where 'size' is 0-4.boolean
Always returns true.subtractPoints
(Roi roi) Subtract the points that intersect the specified ROI and return the result.toString()
Methods inherited from class ij.gui.PolygonRoi
addOffset, clipRectMargin, deleteHandle, enableSubPixelResolution, exitConstructingMode, fitSpline, fitSpline, fitSplineForStraightening, getAngle, getConvexHull, getDebugInfo, getDrawOffset, getFloatPolygon, getInterpolatedPolygon, getLength, getNCoordinates, getNonSplineCoordinates, getNonSplineFloatPolygon, getPolygon, getUncalibratedLength, getXCoordinates, getYCoordinates, grow, isSplineFit, mouseDownInHandle, mouseMoved, moveHandle, removeSplineFit, setDrawOffset, setLocation, updatePolygon, wipeBack
Methods inherited from class ij.gui.Roi
abortPaste, addRoiListener, copyAttributes, drawOverlay, drawPixels, endPaste, equals, getAngle, getBoundingRect, getBounds, getColor, getContourCentroid, getCornerDiameter, getCPosition, getCurrentPasteMode, getDefaultFillColor, getFeretsDiameter, getFeretValues, getFillColor, getFloatAngle, getFloatBounds, getFloatHeight, getFloatWidth, getHashCode, getImage, getImageID, getInterpolatedPolygon, getInterpolatedPolygon, getMagnification, getName, getPasteMode, getPosition, getProperties, getProperty, getPropertyCount, getPrototypeOverlay, getRotationCenter, getRoundRectArcSize, getScaledStroke, getState, getStatistics, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getTypeAsString, getXBase, getYBase, getZPosition, handleMouseDown, handleMouseDrag, isActiveOverlayRoi, isArea, isCursor, isDrawingTool, isLine, isVisible, lineCircleIntersection, mouseDragged, mouseReleased, notifyListeners, nudge, nudgeCorner, removeRoiListener, screenX, screenXD, screenY, screenYD, setColor, setCornerDiameter, setDefaultFillColor, setFillColor, setIgnoreClipRect, setImage, setInstanceColor, setIsCursor, setLineWidth, setLocation, setName, setNonScalable, setPasteMode, setPosition, setPosition, setProperties, setProperty, setPrototypeOverlay, setRotationCenter, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth, showStatus, startPaste, temporarilyHide, toFloat, toInt, toInt, toIntR, update, updateClipRect, updateWideLine
-
Field Details
-
sizes
-
types
-
MAX_COUNTERS
public static final int MAX_COUNTERS- See Also:
-
-
Constructor Details
-
PointRoi
public PointRoi(int[] ox, int[] oy, int points) Creates a new PointRoi using the specified int arrays of offscreen coordinates. -
PointRoi
public PointRoi(float[] ox, float[] oy, int points) Creates a new PointRoi using the specified float arrays of offscreen coordinates. -
PointRoi
public PointRoi(float[] ox, float[] oy) Creates a new PointRoi using the specified float arrays of offscreen coordinates. -
PointRoi
Creates a new PointRoi from a FloatPolygon. -
PointRoi
Creates a new PointRoi from a Polygon. -
PointRoi
public PointRoi(int ox, int oy) Creates a new PointRoi using the specified offscreen int coordinates. -
PointRoi
public PointRoi(double ox, double oy) Creates a new PointRoi using the specified offscreen double coordinates. -
PointRoi
Creates a new PointRoi using the specified screen coordinates.
-
-
Method Details
-
handleMouseUp
protected void handleMouseUp(int sx, int sy) Description copied from class:PolygonRoi
With segmented selections, ignore first mouse up and finalize when user double-clicks, control-clicks or clicks in start box.- Overrides:
handleMouseUp
in classPolygonRoi
-
draw
Draws the points on the image.- Overrides:
draw
in classPolygonRoi
-
drawPixels
Description copied from class:Roi
Draws the selection outline on the specified ImageProcessor.- Overrides:
drawPixels
in classPolygonRoi
- See Also:
-
addPoint
Adds a point to this PointRoi. -
addPoint
Adds a point to this PointRoi. -
deletePoint
protected void deletePoint(int index) - Overrides:
deletePoint
in classPolygonRoi
-
resetCounters
public void resetCounters() -
subtractPoints
Subtract the points that intersect the specified ROI and return the result. Returns null if there are no resulting points. -
getMask
Description copied from class:Roi
Always returns null for rectangular Roi's- Overrides:
getMask
in classPolygonRoi
-
contains
public boolean contains(int x, int y) Returns true if (x,y) is one of the points in this collection.- Overrides:
contains
in classPolygonRoi
-
setShowLabels
public void setShowLabels(boolean showLabels) -
getShowLabels
public boolean getShowLabels() -
setDefaultType
public static void setDefaultType(int type) -
getDefaultType
public static int getDefaultType() -
setPointType
public void setPointType(int type) Sets the point type (0=hybrid, 1=crosshair, 2=dot, 3=circle). -
getPointType
public int getPointType()Returns the point type (0=hybrid, 1=crosshair, 2=dot, 3=circle). -
setDefaultSize
public static void setDefaultSize(int index) -
getDefaultSize
public static int getDefaultSize() -
setSize
public void setSize(int size) Sets the point size, where 'size' is 0-4. -
getSize
public int getSize()Returns the point size (0-4). -
setDefaultCrossColor
Deprecated -
getDefaultCrossColor
Deprecated -
subPixelResolution
public boolean subPixelResolution()Always returns true.- Overrides:
subPixelResolution
in classPolygonRoi
-
toString
-
setCounter
public void setCounter(int counter) -
getCounter
public int getCounter() -
setDefaultCounter
public static void setDefaultCounter(int counter) -
getCount
public int getCount(int counter) -
getCounters
public int[] getCounters() -
setCounters
public void setCounters(int[] counters) -
getPointPosition
public int getPointPosition(int index) -
displayCounts
public void displayCounts() -
getCounterChoices
-
isHandle
public 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:
isHandle
in classPolygonRoi
-
clone
Returns a copy of this PointRoi.- Overrides:
clone
in classPolygonRoi
-
setHideLabels
public void setHideLabels(boolean hideLabels) Deprecated. -
setDefaultMarkerSize
Deprecated. -
getDefaultMarkerSize
Deprecated.
-