|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.gui.Roi
ij.gui.PolygonRoi
public class PolygonRoi
This class represents a polygon region of interest or polyline of interest.
Field Summary | |
---|---|
protected int |
maxPoints
|
protected int |
nPoints
|
protected int |
splinePoints
|
protected int[] |
xp
|
protected int[] |
xp2
|
protected float[] |
xpf
|
protected float[] |
xSpline
|
protected int[] |
yp
|
protected int[] |
yp2
|
protected float[] |
ypf
|
protected float[] |
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, type, updateFullWindow, wideLine, xMax, yMax |
Constructor Summary | |
---|---|
PolygonRoi(float[] xPoints,
float[] yPoints,
int type)
Creates a new polygon or polyline ROI from float x and y arrays. |
|
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(Polygon p,
int type)
Creates a new polygon or polyline ROI from a Polygon. |
Method Summary | |
---|---|
protected void |
addOffset()
|
protected int |
clipRectMargin()
|
Object |
clone()
Returns a copy of this PolygonRoi. |
boolean |
contains(int x,
int y)
|
void |
deleteHandle(double ox,
double oy)
|
void |
draw(Graphics g)
|
void |
drawPixels(ImageProcessor ip)
Draws the selection outline on the specified ImageProcessor. |
void |
enableSubPixelResolution()
|
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. |
Polygon |
getConvexHull()
Uses the gift wrap algorithm to find the convex hull and returns it as a Polygon. |
String |
getDebugInfo()
|
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. |
FloatPolygon |
getInterpolatedPolygon(double interval,
boolean smooth)
Returns, as a FloatPolygon, an interpolated version of this selection with points spaced 'interval' pixels apart. |
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. |
Polygon |
getNonSplineCoordinates()
|
FloatPolygon |
getNonSplineFloatPolygon()
|
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(). |
protected void |
grow(int sx,
int sy)
|
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 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. |
protected void |
mouseDownInHandle(int handle,
int sx,
int sy)
|
void |
mouseMoved(MouseEvent e)
|
protected void |
moveHandle(int sx,
int sy)
|
void |
removeSplineFit()
|
void |
setDrawOffset(boolean drawOffset)
|
void |
setLocation(double x,
double y)
Set the location of the ROI in image coordinates. |
boolean |
subPixelResolution()
Returns true if this is a slection that supports sub-pixel resolution. |
protected void |
updatePolygon()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int maxPoints
protected int[] xp
protected int[] yp
protected float[] xpf
protected float[] ypf
protected int[] xp2
protected int[] yp2
protected int nPoints
protected float[] xSpline
protected float[] ySpline
protected int splinePoints
Constructor Detail |
---|
public PolygonRoi(int[] xPoints, int[] yPoints, int nPoints, int type)
public PolygonRoi(float[] xPoints, float[] yPoints, int nPoints, int type)
public PolygonRoi(float[] xPoints, float[] yPoints, int type)
public PolygonRoi(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(Graphics g)
draw
in class Roi
public void drawPixels(ImageProcessor ip)
Roi
drawPixels
in class Roi
ImageProcessor.setColor(java.awt.Color)
,
ImageProcessor.setLineWidth(int)
protected void grow(int sx, int sy)
grow
in class Roi
protected void updatePolygon()
public void mouseMoved(MouseEvent e)
mouseMoved
in class Roi
public void exitConstructingMode()
protected void moveHandle(int sx, int sy)
moveHandle
in class Roi
protected void mouseDownInHandle(int handle, int sx, int sy)
mouseDownInHandle
in class Roi
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()
protected void handleMouseUp(int sx, int sy)
handleMouseUp
in class Roi
protected void addOffset()
public boolean contains(int x, int y)
contains
in class Roi
public int isHandle(int sx, int sy)
isHandle
in class Roi
public ImageProcessor getMask()
getMask
in class Roi
public double getLength()
getLength
in class Roi
public double getAngle()
getAngle
in class Roi
public int getNCoordinates()
public int[] getXCoordinates()
public int[] getYCoordinates()
public Polygon getNonSplineCoordinates()
public FloatPolygon getNonSplineFloatPolygon()
public Polygon getPolygon()
getPolygon
in class Roi
ImageProcessor.setRoi(java.awt.Rectangle)
,
ImageProcessor.drawPolygon(java.awt.Polygon)
,
ImageProcessor.fillPolygon(java.awt.Polygon)
public FloatPolygon getFloatPolygon()
getFloatPolygon
in class Roi
public boolean subPixelResolution()
Roi
subPixelResolution
in class Roi
public Polygon getConvexHull()
getConvexHull
in class Roi
public FloatPolygon getInterpolatedPolygon(double interval, boolean smooth)
Roi
getInterpolatedPolygon
in class Roi
protected int clipRectMargin()
clipRectMargin
in class Roi
public Object clone()
clone
in class Roi
public boolean getDrawOffset()
Roi
getDrawOffset
in class Roi
public void setDrawOffset(boolean drawOffset)
setDrawOffset
in class Roi
public void setLocation(double x, double y)
Roi
setLocation
in class Roi
public void enableSubPixelResolution()
enableSubPixelResolution
in class Roi
public String getDebugInfo()
getDebugInfo
in class Roi
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |