public class Roi
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, java.lang.Iterable<java.awt.Point>
Iterable<Point>
and can thus be
used to iterate over the contained coordinates. Usage example:
Roi roi = ...; for (Point p : roi) { // process p }Convention for subpixel resolution and zooming in:
Modifier and Type | Field and Description |
---|---|
static int |
ANGLE |
protected double |
asp_bk |
protected boolean |
aspect |
protected ImageProcessor |
cachedMask |
protected boolean |
center |
protected ImagePlus |
clipboard |
protected int |
clipHeight |
protected int |
clipWidth |
protected int |
clipX |
protected int |
clipY |
static int |
COMPOSITE |
protected boolean |
constrain |
static int |
CONSTRUCTING |
protected static java.awt.Color |
defaultColor |
protected static java.awt.Color |
defaultFillColor |
static int |
FERET_ARRAY_POINTOFFSET |
static int |
FERET_ARRAYSIZE |
protected java.awt.Color |
fillColor |
protected double |
flattenScale |
static int |
FREELINE |
static int |
FREEROI |
static int |
HANDLE_SIZE |
protected java.awt.Color |
handleColor |
protected ImageCanvas |
ic |
protected boolean |
ignoreClipRect |
protected ImagePlus |
imp |
protected java.awt.Color |
instanceColor |
static int |
LINE |
protected static int |
lineWidth |
protected double |
mag |
static int |
MOVING |
static int |
MOVING_HANDLE |
protected boolean |
nonScalable |
static int |
NORMAL |
static int |
NOT_PASTING |
protected int |
oldHeight |
protected int |
oldWidth |
protected int |
oldX |
protected int |
oldY |
static java.awt.BasicStroke |
onePixelWide |
static int |
OVAL |
protected boolean |
overlay |
protected static int |
pasteMode |
static int |
POINT |
static int |
POLYGON |
static int |
POLYLINE |
static Roi |
previousRoi
Get using getPreviousRoi() and set using setPreviousRoi()
|
static int |
RECTANGLE |
static int |
RESIZING |
protected static java.awt.Color |
ROIColor |
protected java.awt.BasicStroke |
stroke |
protected java.awt.Color |
strokeColor |
static int |
TRACED_ROI |
protected int |
type |
protected boolean |
updateFullWindow |
protected boolean |
wideLine |
protected int |
xMax |
protected int |
yMax |
Constructor and Description |
---|
Roi(double x,
double y,
double width,
double height)
Creates a rectangular ROI using double arguments.
|
Roi(double x,
double y,
double width,
double height,
int cornerDiameter)
Creates a rounded rectangular ROI using double arguments.
|
Roi(int sx,
int sy,
ImagePlus imp)
Starts the process of creating a user-defined rectangular Roi,
where sx and sy are the starting screen coordinates.
|
Roi(int sx,
int sy,
ImagePlus imp,
int cornerDiameter)
Starts the process of creating a user-defined rectangular Roi,
where sx and sy are the starting screen coordinates.
|
Roi(int x,
int y,
int width,
int height)
Creates a rectangular ROI.
|
Roi(int x,
int y,
int width,
int height,
ImagePlus imp)
Deprecated.
|
Roi(int x,
int y,
int width,
int height,
int cornerDiameter)
Creates a new rounded rectangular ROI.
|
Roi(java.awt.Rectangle r)
Creates a new rectangular Roi.
|
Modifier and Type | Method and Description |
---|---|
void |
abortModification(ImagePlus imp)
Aborts constructing or modifying the roi (called by the ImageJ class on escape)
|
void |
abortPaste() |
static void |
addRoiListener(RoiListener listener) |
protected int |
clipRectMargin() |
java.lang.Object |
clone()
Returns a copy of this roi.
|
boolean |
contains(int x,
int y)
Returns whether the center of pixel (x,y) is contained in the Roi.
|
boolean |
containsPoint(double x,
double y)
Returns whether coordinate (x,y) is contained in the Roi.
|
static Roi |
convertLineToArea(Roi line)
Converts a line selection into an area (polygon or composite) selection.
Author: Michael Schmid |
Roi |
convertToPolygon()
Deprecated.
|
void |
copyAttributes(Roi roi2)
Copy the attributes (outline color, fill color, outline width)
of 'roi2' to the this selection.
|
static Roi |
create(double x,
double y,
double width,
double height)
Creates a rectangular ROI.
|
static Roi |
create(double x,
double y,
double width,
double height,
int cornerDiameter)
Creates a rounded rectangular ROI.
|
void |
draw(java.awt.Graphics g) |
void |
drawOverlay(java.awt.Graphics g) |
void |
drawPixels()
Deprecated.
replaced by drawPixels(ImageProcessor)
|
void |
drawPixels(ImageProcessor ip)
Draws the selection outline on the specified ImageProcessor.
|
void |
enableSubPixelResolution() |
void |
endPaste() |
boolean |
equals(java.lang.Object obj)
Checks whether two rectangles are equal.
|
double |
getAngle()
Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).
|
double |
getAngle(int x1,
int y1,
int x2,
int y2)
Returns the angle in degrees between the specified line and a horizontal line.
|
boolean |
getAntiAlias() |
java.awt.Rectangle |
getBoundingRect()
Deprecated.
replaced by getBounds()
|
java.awt.Rectangle |
getBounds()
Return this selection's bounding rectangle.
|
static java.awt.Color |
getColor()
Returns the default (global) color used for drawing ROI outlines.
|
FloatPolygon |
getContainedFloatPoints()
Returns the coordinates of the pixels inside this ROI as a FloatPolygon.
|
java.awt.Point[] |
getContainedPoints()
Returns the coordinates of the pixels inside this ROI as an array of Points.
|
double[] |
getContourCentroid() |
java.awt.Polygon |
getConvexHull()
Returns the convex hull of this Roi as a Polygon with integer coordinates
by rounding the floating-point values.
|
int |
getCornerDiameter()
Returns the rounded rectangle corner diameter (pixels).
|
int |
getCPosition()
Returns the channel position of this ROI, or zero
if this ROI is not associated with a particular channel.
|
static int |
getCurrentPasteMode()
Returns the current paste transfer mode.
|
java.lang.String |
getDebugInfo() |
static java.awt.Color |
getDefaultFillColor() |
static int |
getDefaultGroup()
Returns the group value assigned to newly created ROIs.
|
static int |
getDefaultHandleSize()
Returns the default handle size.
|
static double |
getDefaultStrokeWidth()
Returns the default stroke width.
|
boolean |
getDrawOffset()
Deprecated.
Drawoffset is not used any more.
|
double |
getFeretsDiameter()
Returns Feret's diameter, the greatest distance between
any two points along the ROI boundary.
|
double[] |
getFeretValues()
Returns an array with the following values:
[0] "Feret" (maximum caliper width) [1] "FeretAngle" (angle of diameter with maximum caliper width, between 0 and 180 deg) [2] "MinFeret" (minimum caliper width) [3][4] , "FeretX" and "FeretY", the X and Y coordinates of the starting point (leftmost point) of the maximum-caliper-width diameter. |
java.awt.Color |
getFillColor()
Returns the fill color used to display this ROI, or null if it is displayed transparently.
|
double |
getFloatAngle(double x1,
double y1,
double x2,
double y2)
Returns the angle in degrees between the specified line and a horizontal line.
|
java.awt.geom.Rectangle2D.Double |
getFloatBounds()
Return this selection's bounding rectangle.
|
FloatPolygon |
getFloatConvexHull()
Returns the convex hull of this Roi as a FloatPolygon.
|
double |
getFloatHeight() |
FloatPolygon |
getFloatPolygon()
Returns the outline (in image pixel coordinates) as a FloatPolygon
|
FloatPolygon |
getFloatPolygon(java.lang.String options)
Returns the outline in image pixel coordinates,
where options may include "close" to add a point to close the outline
if this is an area roi and the outline is not closed yet.
|
double |
getFloatWidth() |
int |
getGroup()
Returns the group attribute of this ROI.
|
static java.lang.String |
getGroupName(int groupNumber)
Returns the group name associtated with the specified group.
|
static java.lang.String |
getGroupNames()
Returns the group names as a comma-delimeted string.
|
int |
getHandleSize()
Returns the current handle size.
|
int |
getHashCode()
Returns a hashcode for this Roi that typically changes
if it is moved, even though it is still the same object.
|
ImagePlus |
getImage()
Returns the ImagePlus associated with this ROI, or null.
|
int |
getImageID()
Returns the ID of the image associated with this ROI.
|
FloatPolygon |
getInterpolatedPolygon()
Returns, as a FloatPolygon, an interpolated version
of this selection that has points spaced 1.0 pixel apart.
|
FloatPolygon |
getInterpolatedPolygon(double interval,
boolean smooth)
Returns, as a FloatPolygon, an interpolated version of
this selection with points spaced 'interval' pixels apart.
|
protected FloatPolygon |
getInterpolatedPolygon(FloatPolygon p,
double interval,
boolean smooth)
Returns, as a FloatPolygon, an interpolated version of this selection
with points spaced abs('interval') pixels apart.
|
Roi |
getInverse(ImagePlus imp)
Returns the inverted roi, or null if this is not an area roi or cannot be converted to a ShapeRoi.
|
double |
getLength()
Returns the perimeter length.
|
static java.util.Vector |
getListeners() |
protected double |
getMagnification() |
ImageProcessor |
getMask()
Always returns null for rectangular Roi's
|
java.lang.String |
getName()
Returns the name of this ROI, or null.
|
int |
getPasteMode()
Returns the current paste transfer mode, or NOT_PASTING (-1)
if no paste operation is in progress.
|
java.awt.Polygon |
getPolygon()
Returns the outline of this selection as a Polygon, or
null if this is a straight line selection.
|
int |
getPosition()
Returns the stack position (image number) of this ROI, or
zero if the ROI is not associated with a particular stack image.
|
static Roi |
getPreviousRoi()
Returns the Roi saved by setPreviousRoi().
|
java.lang.String |
getProperties() |
java.lang.String |
getProperty(java.lang.String property) |
int |
getPropertyCount() |
Overlay |
getPrototypeOverlay() |
FloatPolygon |
getRotationCenter() |
int |
getRoundRectArcSize()
Obsolete; replaced by getCornerDiameter().
|
protected java.awt.BasicStroke |
getScaledStroke() |
boolean |
getScaleStrokeWidth()
Returns 'true' if the stroke width is scaled as images are zoomed.
|
int |
getState() |
ImageStatistics |
getStatistics() |
java.awt.BasicStroke |
getStroke()
Returns the Stroke used to draw this ROI, or null if no Stroke is used.
|
java.awt.Color |
getStrokeColor()
Returns the the color used to draw the ROI outline or null if the default color is being used.
|
float |
getStrokeWidth()
Returns the lineWidth.
|
int |
getTPosition()
Returns the frame position of this ROI, or zero
if this ROI is not associated with a particular frame.
|
int |
getType() |
java.lang.String |
getTypeAsString()
Convenience method that converts Roi type to a human-readable form.
|
double |
getXBase() |
double |
getYBase() |
int |
getZPosition()
Returns the slice position of this ROI, or zero
if this ROI is not associated with a particular slice.
|
protected void |
grow(int sx,
int sy) |
protected void |
handleMouseDown(int sx,
int sy) |
protected void |
handleMouseDrag(int sx,
int sy,
int flags) |
protected void |
handleMouseUp(int screenX,
int screenY) |
boolean |
hasHyperStackPosition()
Returns 'true' if setPosition(C,Z,T) has been called.
|
boolean |
isActiveOverlayRoi()
Returns 'true' if this ROI is displayed and is also in an overlay.
|
boolean |
isArea()
Returns 'true' if this is an area selection.
|
boolean |
isCursor() |
boolean |
isDrawingTool()
Returns 'true' if this is an ROI primarily used from drawing
(e.g., TextRoi or Arrow).
|
int |
isHandle(int sx,
int sy)
Returns a handle number if the specified screen coordinates are
inside or near a handle, otherwise returns -1.
|
static boolean |
isInteger(double x)
Returns whether a number is an integer
|
boolean |
isLine()
Returns 'true' if this is a line selection.
|
protected boolean |
isLineOrPoint()
Return 'true' if this is a line or point selection.
|
boolean |
isVisible()
Returns true if this ROI is currently displayed on an image.
|
java.util.Iterator<java.awt.Point> |
iterator()
Required by the
Iterable interface. |
static double[] |
lineCircleIntersection(double ax,
double ay,
double bx,
double by,
double cx,
double cy,
double rad,
boolean ignoreOutside)
Calculates intersections of a line segment with a circle
Author N.Vischer
ax, ay, bx, by: points A and B of line segment
cx, cy, rad: Circle center and radius.
|
protected boolean |
magnificationForSubPixel()
Returns whether a roi created interactively should have subpixel resolution,
(if the roi type supports it), i.e., whether the magnification is high enough
|
protected static boolean |
magnificationForSubPixel(double magnification) |
protected void |
mouseDownInHandle(int handle,
int sx,
int sy) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
protected void |
moveHandle(int sx,
int sy) |
void |
notifyListeners(int id) |
void |
nudge(int key)
Nudge ROI one pixel on arrow key press.
|
void |
nudgeCorner(int key)
Nudge lower right corner of rectangular and oval ROIs by
one pixel based on arrow key press.
|
protected int |
offScreenX(int sx)
Converts image canvas screen x coordinates to integer offscreen image pixel
coordinates, depending on whether this roi uses the line or area convention
for coordinates.
|
protected double |
offScreenXD(int sx)
Converts image canvas screen x coordinates to floating-point offscreen image pixel
coordinates, depending on whether this roi uses the line or area convention
for coordinates.
|
protected int |
offScreenY(int sy)
Converts image canvas screen y coordinates to integer offscreen image pixel
coordinates, depending on whether this roi uses the line or area convention
for coordinates.
|
protected double |
offScreenYD(int sy)
Converts image canvas screen y coordinates to floating-point offscreen image pixel
coordinates, depending on whether this roi uses the line or area convention
for coordinates.
|
static void |
removeRoiListener(RoiListener listener) |
static void |
resetDefaultHandleSize() |
static void |
saveGroupNames() |
protected int |
screenX(int ox) |
protected int |
screenXD(double ox)
Converts an image pixel x (offscreen)coordinate to a screen x coordinate,
taking the the line or area convention for coordinates into account
|
protected int |
screenY(int oy) |
protected int |
screenYD(double oy)
Converts an image pixel y (offscreen)coordinate to a screen y coordinate,
taking the the line or area convention for coordinates into account
|
void |
setAntiAlias(boolean antiAlias) |
void |
setBounds(java.awt.geom.Rectangle2D.Double b)
Sets the bounds of rectangular, oval or text selections.
|
static void |
setColor(java.awt.Color c)
Sets the default (global) color used for ROI outlines.
|
void |
setCornerDiameter(int cornerDiameter)
Sets the rounded rectangle corner diameter (pixels).
|
static void |
setDefaultColor(java.awt.Color color)
Sets the default stroke color.
|
static void |
setDefaultFillColor(java.awt.Color color) |
static void |
setDefaultGroup(int group)
Sets the group value assigned to newly created ROIs, and also
sets the default ROI color to the group color.
|
static void |
setDefaultStrokeWidth(double width)
Sets the default stroke width.
|
void |
setDrawOffset(boolean drawOffset)
Deprecated.
This method was previously used to draw lines and polylines shifted
by 0.5 pixels top the bottom and right, for better agreement with the
position used by ProfilePlot, with the default taken from
Prefs.subPixelResolution. Now the shift is independent of this
setting and only depends on the ROI type (area or line/point ROI).
|
void |
setFillColor(java.awt.Color color)
Sets the fill color used to display this ROI, or set to null to display it transparently.
|
void |
setFlattenScale(double scale) |
void |
setGroup(int group)
Sets the group of this Roi, and updates stroke color accordingly.
|
static void |
setGroupName(int groupNumber,
java.lang.String name) |
static void |
setGroupNames(java.lang.String names)
Sets the group names from a comma-delimeted string.
|
void |
setHandleSize(int size)
Sets the current handle size.
|
void |
setIgnoreClipRect(boolean ignoreClipRect) |
void |
setImage(ImagePlus imp) |
void |
setInstanceColor(java.awt.Color c)
Deprecated.
replaced by setStrokeColor()
|
void |
setIsCursor(boolean isCursor) |
void |
setLineWidth(int width)
Deprecated.
replaced by setStrokeWidth(int)
|
void |
setLocation(double x,
double y)
Set the location of the ROI in image coordinates.
|
void |
setLocation(int x,
int y)
Set the location of the ROI in image coordinates.
|
void |
setName(java.lang.String name)
Sets the name of this ROI.
|
void |
setNonScalable(boolean nonScalable)
Set 'nonScalable' true to have TextRois in a display
list drawn at a fixed location and size.
|
static void |
setPasteMode(int transferMode)
Sets the Paste transfer mode.
|
void |
setPosition(ImagePlus imp)
Sets the position of this ROI based on the stack position of the specified image.
|
void |
setPosition(int n)
Sets the stack position (image number) of this ROI.
|
void |
setPosition(int channel,
int slice,
int frame)
Sets the hyperstack position of this ROI.
|
static void |
setPreviousRoi(Roi roi)
Saves 'roi' so it can be restored later using Edit/Selection/Restore Selection.
|
void |
setProperties(java.lang.String properties) |
void |
setProperty(java.lang.String key,
java.lang.String value) |
void |
setPrototypeOverlay(Overlay overlay) |
protected void |
setRenderingHint(java.awt.Graphics2D g2d) |
void |
setRotationCenter(double x,
double y) |
void |
setRoundRectArcSize(int cornerDiameter)
Obsolete; replaced by setCornerDiameter().
|
void |
setStroke(java.awt.BasicStroke stroke)
Sets the Stroke used to draw this ROI.
|
void |
setStrokeColor(java.awt.Color c)
Sets the color used by this ROI to draw its outline.
|
void |
setStrokeWidth(double strokeWidth)
This is a version of setStrokeWidth() that accepts a double argument.
|
void |
setStrokeWidth(float strokeWidth)
Sets the width of the line used to draw this ROI.
|
void |
setUnscalableStrokeWidth(double strokeWidth) |
void |
showStatus() |
int |
size()
Returns the number of points in this selection; equivalent to getFloatPolygon().npoints.
|
void |
startPaste(ImagePlus clipboard) |
boolean |
subPixelResolution()
Returns true if this is a slection that supports sub-pixel resolution.
|
void |
temporarilyHide()
Deprecated
|
static float[] |
toFloat(int[] arr)
Converts an int array to a float array.
|
static int[] |
toInt(float[] arr)
Converts a float array to an int array using truncation.
|
static int[] |
toInt(float[] arr,
int[] arr2,
int size) |
static int[] |
toIntR(float[] arr)
Converts a float array to an int array using rounding.
|
java.lang.String |
toString() |
void |
update(boolean add,
boolean subtract)
If 'add' is true, adds this selection to the previous one.
|
protected void |
updateClipRect() |
void |
updateWideLine(float width) |
protected boolean |
useLineSubpixelConvention()
Returns 'true' if this ROI uses for drawing the convention for
line and point ROIs, where the coordinates are with respect
to the pixel center.
|
public static final int CONSTRUCTING
public static final int MOVING
public static final int RESIZING
public static final int NORMAL
public static final int MOVING_HANDLE
public static final int RECTANGLE
public static final int OVAL
public static final int POLYGON
public static final int FREEROI
public static final int TRACED_ROI
public static final int LINE
public static final int POLYLINE
public static final int FREELINE
public static final int ANGLE
public static final int COMPOSITE
public static final int POINT
public static final int HANDLE_SIZE
public static final int NOT_PASTING
public static final int FERET_ARRAYSIZE
public static final int FERET_ARRAY_POINTOFFSET
public static final java.awt.BasicStroke onePixelWide
protected static java.awt.Color ROIColor
protected static int pasteMode
protected static int lineWidth
protected static java.awt.Color defaultFillColor
public static Roi previousRoi
protected int type
protected int xMax
protected int yMax
protected ImagePlus imp
protected ImageCanvas ic
protected int oldX
protected int oldY
protected int oldWidth
protected int oldHeight
protected int clipX
protected int clipY
protected int clipWidth
protected int clipHeight
protected ImagePlus clipboard
protected boolean constrain
protected boolean center
protected boolean aspect
protected boolean updateFullWindow
protected double mag
protected double asp_bk
protected ImageProcessor cachedMask
protected java.awt.Color handleColor
protected java.awt.Color strokeColor
protected java.awt.Color instanceColor
protected java.awt.Color fillColor
protected java.awt.BasicStroke stroke
protected boolean nonScalable
protected boolean overlay
protected boolean wideLine
protected boolean ignoreClipRect
protected double flattenScale
protected static java.awt.Color defaultColor
public Roi(int x, int y, int width, int height)
public Roi(double x, double y, double width, double height)
public Roi(int x, int y, int width, int height, int cornerDiameter)
public Roi(double x, double y, double width, double height, int cornerDiameter)
public Roi(java.awt.Rectangle r)
public Roi(int sx, int sy, ImagePlus imp)
public Roi(int sx, int sy, ImagePlus imp, int cornerDiameter)
public Roi(int x, int y, int width, int height, ImagePlus imp)
public static Roi create(double x, double y, double width, double height)
public static Roi create(double x, double y, double width, double height, int cornerDiameter)
public void setLocation(int x, int y)
public void setLocation(double x, double y)
public void setImage(ImagePlus imp)
public ImagePlus getImage()
public int getImageID()
public int getType()
public int getState()
public double getLength()
public double getFeretsDiameter()
public double[] getFeretValues()
The following array elements are end points of the maximum and minimum caliper diameter,
in unscaled image pixel coordinates:
[8][9] "FeretX1", "FeretY1"; unscaled versions of "FeretX" and "FeretY"
(subclasses may use any end of the diameter, not necessarily the left one)
[10][11] "FeretX2", "FeretY2", end point of the maxium-caliper-width diameter.
Both of these points are vertices of the convex hull.
The final four array elements are the starting and end points of the minimum caliper width,
[12],[13] "MinFeretX", "MinFeretY", and
[14],[15] "MinFeretX2", "MinFeretY2". These two pooints are not sorted by x,
but the first point point (MinFeretX, MinFeretY) is guaranteed to be a vertex of the convex hull,
while second point (MinFeretX2, MinFeretY2) usually is not a vertex point but at a
boundary line of the convex hull.
public java.awt.Polygon getConvexHull()
public FloatPolygon getFloatConvexHull()
public java.awt.Rectangle getBounds()
public java.awt.geom.Rectangle2D.Double getFloatBounds()
public void setBounds(java.awt.geom.Rectangle2D.Double b)
public java.awt.Rectangle getBoundingRect()
public java.awt.Polygon getPolygon()
public FloatPolygon getFloatPolygon()
public FloatPolygon getFloatPolygon(java.lang.String options)
public FloatPolygon getInterpolatedPolygon()
public FloatPolygon getInterpolatedPolygon(double interval, boolean smooth)
protected FloatPolygon getInterpolatedPolygon(FloatPolygon p, double interval, boolean smooth)
public java.awt.Point[] getContainedPoints()
getContainedFloatPoints()
,
iterator()
public FloatPolygon getContainedFloatPoints()
getContainedPoints()
,
iterator()
public static double[] lineCircleIntersection(double ax, double ay, double bx, double by, double cx, double cy, double rad, boolean ignoreOutside)
Calculates intersections of a line segment with a circle Author N.Vischer ax, ay, bx, by: points A and B of line segment cx, cy, rad: Circle center and radius. ignoreOutside: if true, ignores intersections outside the line segment A-B Returns an array of 0, 2 or 4 coordinates (for 0, 1, or 2 intersection points). If two intersection points are returned, they are listed in travel direction A->B
public java.lang.Object clone()
clone
in class java.lang.Object
public void abortModification(ImagePlus imp)
protected void grow(int sx, int sy)
protected void moveHandle(int sx, int sy)
public void nudge(int key)
public void nudgeCorner(int key)
protected void updateClipRect()
protected int clipRectMargin()
protected void handleMouseDrag(int sx, int sy, int flags)
public void draw(java.awt.Graphics g)
public void drawOverlay(java.awt.Graphics g)
public int getHandleSize()
public void setHandleSize(int size)
public static int getDefaultHandleSize()
public static void resetDefaultHandleSize()
public void drawPixels()
public void drawPixels(ImageProcessor ip)
public boolean contains(int x, int y)
public boolean containsPoint(double x, double y)
public Roi getInverse(ImagePlus imp)
public int isHandle(int sx, int sy)
protected void mouseDownInHandle(int handle, int sx, int sy)
protected void handleMouseDown(int sx, int sy)
protected void handleMouseUp(int screenX, int screenY)
public void update(boolean add, boolean subtract)
public void showStatus()
public ImageProcessor getMask()
public void startPaste(ImagePlus clipboard)
public void endPaste()
public void abortPaste()
public static double getDefaultStrokeWidth()
public static void setDefaultStrokeWidth(double width)
public static int getDefaultGroup()
public static void setDefaultGroup(int group)
setGroup(int)
,
getGroup()
,
getGroupColor(int)
public int getGroup()
public static java.lang.String getGroupName(int groupNumber)
public static void setGroupName(int groupNumber, java.lang.String name)
public static void saveGroupNames()
public static java.lang.String getGroupNames()
public static void setGroupNames(java.lang.String names)
public void setGroup(int group)
public double getAngle(int x1, int y1, int x2, int y2)
public double getFloatAngle(double x1, double y1, double x2, double y2)
public static void setColor(java.awt.Color c)
getColor()
,
setStrokeColor(Color)
public static java.awt.Color getColor()
setColor(Color)
,
getStrokeColor()
public void setStrokeColor(java.awt.Color c)
public java.awt.Color getStrokeColor()
setStrokeColor(Color)
public static void setDefaultColor(java.awt.Color color)
public void setFillColor(java.awt.Color color)
getFillColor()
,
setStrokeColor(java.awt.Color)
public java.awt.Color getFillColor()
setFillColor(java.awt.Color)
,
getStrokeColor()
public static void setDefaultFillColor(java.awt.Color color)
public static java.awt.Color getDefaultFillColor()
public void setAntiAlias(boolean antiAlias)
public boolean getAntiAlias()
protected void setRenderingHint(java.awt.Graphics2D g2d)
public void copyAttributes(Roi roi2)
public void setInstanceColor(java.awt.Color c)
public void setLineWidth(int width)
public void updateWideLine(float width)
public void setNonScalable(boolean nonScalable)
public void setStrokeWidth(float strokeWidth)
public void setStrokeWidth(double strokeWidth)
public void setUnscalableStrokeWidth(double strokeWidth)
public float getStrokeWidth()
public void setStroke(java.awt.BasicStroke stroke)
public java.awt.BasicStroke getStroke()
public boolean getScaleStrokeWidth()
protected java.awt.BasicStroke getScaledStroke()
public java.lang.String getName()
public void setName(java.lang.String name)
public static void setPasteMode(int transferMode)
Blitter
public void setCornerDiameter(int cornerDiameter)
public int getCornerDiameter()
public void setRoundRectArcSize(int cornerDiameter)
public int getRoundRectArcSize()
public void setPosition(int n)
Overlay
public int getPosition()
Overlay
public void setPosition(int channel, int slice, int frame)
Overlay
public boolean hasHyperStackPosition()
public void setPosition(ImagePlus imp)
public final int getCPosition()
public final int getZPosition()
public final int getTPosition()
public void setPrototypeOverlay(Overlay overlay)
public Overlay getPrototypeOverlay()
public int getPasteMode()
Blitter
public static int getCurrentPasteMode()
public boolean isArea()
public boolean isLine()
protected boolean isLineOrPoint()
public boolean isDrawingTool()
protected double getMagnification()
public java.lang.String getTypeAsString()
public boolean isVisible()
public boolean subPixelResolution()
@Deprecated public boolean getDrawOffset()
@Deprecated public void setDrawOffset(boolean drawOffset)
public void setIgnoreClipRect(boolean ignoreClipRect)
public final boolean isActiveOverlayRoi()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected int offScreenX(int sx)
protected int offScreenY(int sy)
protected double offScreenXD(int sx)
protected double offScreenYD(int sy)
protected boolean useLineSubpixelConvention()
protected boolean magnificationForSubPixel()
protected static boolean magnificationForSubPixel(double magnification)
protected int screenXD(double ox)
protected int screenYD(double oy)
protected int screenX(int ox)
protected int screenY(int oy)
public static int[] toInt(float[] arr)
public static int[] toInt(float[] arr, int[] arr2, int size)
public static int[] toIntR(float[] arr)
public static float[] toFloat(int[] arr)
public static boolean isInteger(double x)
public void setProperty(java.lang.String key, java.lang.String value)
public java.lang.String getProperty(java.lang.String property)
public void setProperties(java.lang.String properties)
public java.lang.String getProperties()
public int getPropertyCount()
public java.lang.String toString()
toString
in class java.lang.Object
public void temporarilyHide()
public void mouseDragged(java.awt.event.MouseEvent e)
public void mouseMoved(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
public double getXBase()
public double getYBase()
public double getFloatWidth()
public double getFloatHeight()
public double getAngle()
public void enableSubPixelResolution()
public void setIsCursor(boolean isCursor)
public boolean isCursor()
public java.lang.String getDebugInfo()
public ImageStatistics getStatistics()
public FloatPolygon getRotationCenter()
public void setRotationCenter(double x, double y)
public int size()
public static void setPreviousRoi(Roi roi)
public static Roi getPreviousRoi()
public double[] getContourCentroid()
public Roi convertToPolygon()
public static Roi convertLineToArea(Roi line)
public int getHashCode()
public void setFlattenScale(double scale)
public void notifyListeners(int id)
public static void addRoiListener(RoiListener listener)
public static void removeRoiListener(RoiListener listener)
public static java.util.Vector getListeners()
public java.util.Iterator<java.awt.Point> iterator()
Iterable
interface.
Use to iterate over the contained coordinates. Usage example:
for (Point p : roi) { // process p }Author: Wilhelm Burger
iterator
in interface java.lang.Iterable<java.awt.Point>
getContainedPoints()
,
getContainedFloatPoints()