|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.gui.AbstractRoi
ij.gui.AttributeRoi
ij.gui.Roi
ij.gui.PolygonRoi
public class PolygonRoi
This class represents a polygon region of interest or polyline of interest.
Field Summary |
---|
Fields inherited from class ij.gui.Roi |
---|
onePixelWide, previousRoi, roundRect |
Fields inherited from interface ij.gui.RoiConstance |
---|
ADD_TO_ROI, ANGLE, COMPOSITE, CONSTRUCTING, DRAW_HANDLE, DUPLICATE_HANDLE, EVT_HANDLE_SIZE, FILL_HANDLE, FREELINE, FREEROI, HANDLE_SIZE, LINE, MAG_HANDLE, MOVING, MOVING_HANDLE, MOVING_ROUNDRECT_HANDLE, NO_MODS, NORMAL, NOT_PASTING, OVAL, POINT, POLYGON, POLYLINE, RECTANGLE, RESIZING, SUBTRACT_FROM_ROI, TRACED_ROI, UNDO_HANDLE |
Constructor Summary | |
---|---|
PolygonRoi(float[] xPoints,
float[] yPoints,
int nPoints,
int type)
Creates a new polygon or polyline ROI from float x and y arrays. |
|
PolygonRoi(FloatPolygon p,
int type)
Creates a new polygon or polyline ROI from a FloatPolygon. |
|
PolygonRoi(int[] xPoints,
int[] yPoints,
int nPoints,
ImagePlus imp,
int type)
Deprecated. |
|
PolygonRoi(int[] xPoints,
int[] yPoints,
int nPoints,
int type)
Creates a new polygon or polyline ROI from x and y coordinate arrays. |
|
PolygonRoi(int sx,
int sy,
ImagePlus imp)
Starts the process of creating a new user-generated polygon or polyline ROI. |
|
PolygonRoi(java.awt.Polygon p,
int type)
Creates a new polygon or polyline ROI from a Polygon. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a copy of this PolygonRoi. |
boolean |
contains(int x,
int y)
|
void |
deleteHandle(double ox,
double oy)
|
void |
draw(java.awt.Graphics g)
|
void |
drawPixels(ImageProcessor ip)
Draws the selection outline on the specified ImageProcessor. |
void |
exitConstructingMode()
|
void |
fitSpline()
|
void |
fitSpline(int evaluationPoints)
|
void |
fitSplineForStraightening()
|
double |
getAngle()
Returns the angle in degrees between the first two segments of this polyline. |
java.awt.Polygon |
getConvexHull()
Uses the gift wrap algorithm to find the convex hull and returns it as a Polygon. |
boolean |
getDrawOffset()
Returns true if this is a PolygonRoi that supports sub-pixel resolution and polygons are drawn on zoomed images offset down and to the right by 0.5 pixels.. |
FloatPolygon |
getFloatPolygon()
Returns this polygon or polyline as float arrays. |
double |
getLength()
Returns the perimeter (for ROIs) or length (for lines). |
ImageProcessor |
getMask()
Override Roi.nudge() to support splines. |
int |
getNCoordinates()
Returns the number of XY coordinates. |
java.awt.Polygon |
getNonSplineCoordinates()
|
FloatPolygon |
getNonSplineFloatCoordinates()
|
java.awt.Polygon |
getPolygon()
Returns this PolygonRoi as a Polygon. |
double |
getUncalibratedLength()
|
int[] |
getXCoordinates()
Obsolete; replaced by either getPolygon() or getFloatPolygon(). |
int[] |
getYCoordinates()
Obsolete; replaced by either getPolygon() or getFloatPolygon(). |
int |
isHandle(int sx,
int sy)
Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1. |
boolean |
isSplineFit()
Returns 'true' if this selection has been fitted with a spline. |
void |
removeSplineFit()
|
void |
setDrawOffset(boolean drawOffset)
|
boolean |
subPixelResolution()
Returns true if this is a PolygonRoi that supports sub-pixel resolution. |
Methods inherited from class ij.gui.AttributeRoi |
---|
copyAttributes, getAngle, getColor, getCPosition, getDefaultFillColor, getFeretsDiameter, getFeretValues, getFillColor, getImage, getImageID, getName, getPosition, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getZPosition, setColor, setDefaultFillColor, setFillColor, setName, setPosition, setPosition, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PolygonRoi(int[] xPoints, int[] yPoints, int nPoints, int type)
public PolygonRoi(float[] xPoints, float[] yPoints, int nPoints, int type)
public PolygonRoi(java.awt.Polygon p, int type)
public PolygonRoi(FloatPolygon p, int type)
public PolygonRoi(int[] xPoints, int[] yPoints, int nPoints, ImagePlus imp, int type)
public PolygonRoi(int sx, int sy, ImagePlus imp)
Method Detail |
---|
public void draw(java.awt.Graphics g)
draw
in interface RoiBeans
draw
in class Roi
public void drawPixels(ImageProcessor ip)
Roi
drawPixels
in interface RoiBeans
drawPixels
in class Roi
ImageProcessor.setColor(java.awt.Color)
,
ImageProcessor.setLineWidth(int)
public void exitConstructingMode()
public void deleteHandle(double ox, double oy)
public void fitSpline(int evaluationPoints)
public void fitSpline()
public void removeSplineFit()
public boolean isSplineFit()
public void fitSplineForStraightening()
public double getUncalibratedLength()
public boolean contains(int x, int y)
contains
in interface RoiBeans
contains
in class Roi
public int isHandle(int sx, int sy)
isHandle
in interface RoiBeans
isHandle
in class Roi
public ImageProcessor getMask()
getMask
in interface RoiBeans
getMask
in class Roi
public double getLength()
getLength
in interface RoiBeans
getLength
in class Roi
public double getAngle()
public int getNCoordinates()
public int[] getXCoordinates()
public int[] getYCoordinates()
public java.awt.Polygon getNonSplineCoordinates()
public FloatPolygon getNonSplineFloatCoordinates()
public java.awt.Polygon getPolygon()
getPolygon
in interface RoiBeans
getPolygon
in class Roi
ImageProcessor.setRoi(java.awt.Rectangle)
,
ImageProcessor.drawPolygon(java.awt.Polygon)
,
ImageProcessor.fillPolygon(java.awt.Polygon)
public FloatPolygon getFloatPolygon()
getFloatPolygon
in interface RoiBeans
getFloatPolygon
in class Roi
public boolean subPixelResolution()
Roi
subPixelResolution
in interface RoiBeans
subPixelResolution
in class Roi
public java.awt.Polygon getConvexHull()
getConvexHull
in interface RoiBeans
getConvexHull
in class AttributeRoi
public java.lang.Object clone()
clone
in class Roi
public boolean getDrawOffset()
Roi
getDrawOffset
in interface RoiBeans
getDrawOffset
in class Roi
public void setDrawOffset(boolean drawOffset)
setDrawOffset
in interface RoiBeans
setDrawOffset
in class Roi
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |