Module ij
Package ij.gui

Class OvalRoi

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.awt.Point>

    public class OvalRoi
    extends Roi
    Oval region of interest
    See Also:
    Serialized Form
    • Constructor Detail

      • OvalRoi

        public OvalRoi​(int x,
                       int y,
                       int width,
                       int height)
        Creates an OvalRoi.
      • OvalRoi

        public OvalRoi​(double x,
                       double y,
                       double width,
                       double height)
        Creates an OvalRoi using double arguments.
      • OvalRoi

        public OvalRoi​(int x,
                       int y,
                       ImagePlus imp)
        Starts the process of creating a user-defined OvalRoi.
      • OvalRoi

        public OvalRoi​(int x,
                       int y,
                       int width,
                       int height,
                       ImagePlus imp)
        Deprecated.
    • Method Detail

      • create

        public static OvalRoi create​(double x,
                                     double y,
                                     double width,
                                     double height)
        Creates an OvalRoi.
      • getFeretValues

        public double[] getFeretValues()
        Feret (caliper width) values, see ij.gui.Roi.getFeretValues(). The superclass method of calculating this via the convex hull is less accurate for the MinFeret because it does not get the exact minor axis.
        Overrides:
        getFeretValues in class Roi
      • moveHandle

        protected void moveHandle​(int sx,
                                  int sy)
        Overrides:
        moveHandle in class Roi
      • draw

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

        public FloatPolygon getFloatPolygon()
        Returns this OvalRoi as a FloatPolygon approximating the ellipse.
        Overrides:
        getFloatPolygon in class Roi
      • getFloatPolygon4

        public FloatPolygon getFloatPolygon4()
        Returns this OvalRoi as a 4 point FloatPolygon (x,y,w,h).
      • size

        public int size()
        Returns the number of corner points in the mask of this selection; equivalent to getPolygon().npoints.
        Overrides:
        size in class Roi
      • contains

        public boolean contains​(int ox,
                                int oy)
        Tests whether the center of the specified pixel is inside the boundary of this OvalRoi. Authors: Barry DeZonia and Michael Schmid
        Overrides:
        contains in class Roi
      • containsPoint

        public boolean containsPoint​(double x,
                                     double y)
        Returns whether coordinate (x,y) is contained in the Roi. Note that the coordinate (0,0) is the top-left corner of pixel (0,0). Use contains(int, int) to determine whether a given pixel is contained in the Roi.
        Overrides:
        containsPoint 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 length using Ramanujan's approximation for the circumference of an ellipse
        Overrides:
        getLength in class Roi