Documentation of 'ij.gui.PolygonRoi' Java class
PolygonRoi
ij.gui

Class PolygonRoi

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.awt.Point>
    Direct Known Subclasses:
    EllipseRoi, FreehandRoi, PointRoi, RotatedRectRoi


    public class PolygonRoi
    extends Roi
    This class represents a polygon region of interest or polyline of interest.
    See Also:
    Serialized Form
    • Constructor Detail

      • PolygonRoi

        public PolygonRoi(int[] xPoints,
                          int[] yPoints,
                          int nPoints,
                          int type)
        Creates a new polygon or polyline ROI from x and y coordinate arrays. Type must be Roi.POLYGON, Roi.FREEROI, Roi.TRACED_ROI, Roi.POLYLINE, Roi.FREELINE or Roi.ANGLE.
      • PolygonRoi

        public PolygonRoi(float[] xPoints,
                          float[] yPoints,
                          int nPoints,
                          int type)
        Creates a new polygon or polyline ROI from float x and y arrays. Type must be Roi.POLYGON, Roi.FREEROI, Roi.POLYLINE, Roi.FREELINE or Roi.ANGLE.
      • PolygonRoi

        public PolygonRoi(float[] xPoints,
                          float[] yPoints,
                          int type)
        Creates a new polygon or polyline ROI from float x and y arrays. Type must be Roi.POLYGON, Roi.FREEROI, Roi.POLYLINE, Roi.FREELINE or Roi.ANGLE.
      • PolygonRoi

        public PolygonRoi(java.awt.Polygon p,
                          int type)
        Creates a new polygon or polyline ROI from a Polygon. Type must be Roi.POLYGON, Roi.FREEROI, Roi.TRACED_ROI, Roi.POLYLINE, Roi.FREELINE or Roi.ANGLE.
      • PolygonRoi

        public PolygonRoi(FloatPolygon p,
                          int type)
        Creates a new polygon or polyline ROI from a FloatPolygon. Type must be Roi.POLYGON, Roi.FREEROI, Roi.TRACED_ROI, Roi.POLYLINE, Roi.FREELINE or Roi.ANGLE.
      • PolygonRoi

        public PolygonRoi(int[] xPoints,
                          int[] yPoints,
                          int nPoints,
                          ImagePlus imp,
                          int type)
        Deprecated. 
      • PolygonRoi

        public PolygonRoi(int sx,
                          int sy,
                          ImagePlus imp)
        Starts the process of creating a new user-generated polygon or polyline ROI.
    • Method Detail

      • draw

        public void draw(java.awt.Graphics g)
        Overrides:
        draw in class Roi
      • mouseMoved

        public void mouseMoved(java.awt.event.MouseEvent e)
        Overrides:
        mouseMoved in class Roi
      • exitConstructingMode

        public void exitConstructingMode()
      • deleteHandle

        public void deleteHandle(double ox,
                                 double oy)
      • fitSpline

        public void fitSpline(int evaluationPoints)
      • fitSpline

        public void fitSpline()
      • removeSplineFit

        public void removeSplineFit()
      • isSplineFit

        public boolean isSplineFit()
        Returns 'true' if this selection has been fitted with a spline.
      • fitSplineForStraightening

        public void fitSplineForStraightening()
      • getUncalibratedLength

        public double getUncalibratedLength()
      • contains

        public boolean contains(int x,
                                int y)
        Overrides:
        contains in class Roi
      • isHandle

        public int isHandle(int sx,
                            int sy)
        Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.
        Overrides:
        isHandle in class Roi
      • getMask

        public ImageProcessor getMask()
        Description copied from class: Roi
        Always returns null for rectangular Roi's
        Overrides:
        getMask in class Roi
      • getLength

        public double getLength()
        Returns the perimeter (for ROIs) or length (for lines).
        Overrides:
        getLength in class Roi
      • getAngle

        public double getAngle()
        Returns the angle in degrees between the first two segments of this polyline.
        Overrides:
        getAngle in class Roi
      • getNCoordinates

        public int getNCoordinates()
        Returns the number of points that define this PolygonRoi.
        See Also:
        getNonSplineCoordinates()
      • getXCoordinates

        public int[] getXCoordinates()
        Obsolete; replaced by either getPolygon() or getFloatPolygon().
      • getYCoordinates

        public int[] getYCoordinates()
        Obsolete; replaced by either getPolygon() or getFloatPolygon().
      • getNonSplineCoordinates

        public java.awt.Polygon getNonSplineCoordinates()
      • getNonSplineFloatPolygon

        public FloatPolygon getNonSplineFloatPolygon()
      • subPixelResolution

        public boolean subPixelResolution()
        Description copied from class: Roi
        Returns true if this is a slection that supports sub-pixel resolution.
        Overrides:
        subPixelResolution in class Roi
      • getConvexHull

        public java.awt.Polygon getConvexHull()
        Uses the gift wrap algorithm to find the convex hull and returns it as a Polygon.
        Overrides:
        getConvexHull in class Roi
      • getInterpolatedPolygon

        public FloatPolygon getInterpolatedPolygon(double interval,
                                                   boolean smooth)
        Description copied from class: Roi
        Returns, as a FloatPolygon, an interpolated version of this selection with points spaced 'interval' pixels apart. If 'smooth' is true, traced and freehand selections are first smoothed using a 3 point running average.
        Overrides:
        getInterpolatedPolygon in class Roi
      • clone

        public java.lang.Object clone()
        Returns a copy of this PolygonRoi.
        Overrides:
        clone in class Roi
      • getDrawOffset

        public boolean getDrawOffset()
        Description copied from class: Roi
        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..
        Overrides:
        getDrawOffset in class Roi
      • setDrawOffset

        public void setDrawOffset(boolean drawOffset)
        Overrides:
        setDrawOffset in class Roi
      • setLocation

        public void setLocation(double x,
                                double y)
        Description copied from class: Roi
        Set the location of the ROI in image coordinates.
        Overrides:
        setLocation in class Roi
      • getDebugInfo

        public java.lang.String getDebugInfo()
        Overrides:
        getDebugInfo in class Roi

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.