Package ij.gui

Class EllipseRoi

All Implemented Interfaces:
Serializable, Cloneable, Iterable<Point>

public class EllipseRoi
extends PolygonRoi
This class implements the ellipse selection tool.
See Also:
Serialized Form
  • Constructor Details

    • EllipseRoi

      public EllipseRoi​(double x1, double y1, double x2, double y2, double aspectRatio)
    • EllipseRoi

      public EllipseRoi​(int sx, int sy, ImagePlus imp)
  • Method Details

    • draw

      public void draw​(Graphics g)
      Overrides:
      draw in class PolygonRoi
    • grow

      protected void grow​(int sx, int sy)
      Overrides:
      grow in class PolygonRoi
    • showStatus

      public void showStatus()
      Overrides:
      showStatus in class Roi
    • nudgeCorner

      public void nudgeCorner​(int key)
      Description copied from class: Roi
      Nudge lower right corner of rectangular and oval ROIs by one pixel based on arrow key press.
      Overrides:
      nudgeCorner in class Roi
    • handleMouseUp

      protected void handleMouseUp​(int screenX, int screenY)
      Description copied from class: PolygonRoi
      With segmented selections, ignore first mouse up and finalize when user double-clicks, control-clicks or clicks in start box.
      Overrides:
      handleMouseUp in class PolygonRoi
    • moveHandle

      protected void moveHandle​(int sx, int sy)
      Overrides:
      moveHandle in class PolygonRoi
    • isHandle

      public int isHandle​(int sx, int sy)
      Description copied from class: PolygonRoi
      Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.
      Overrides:
      isHandle in class PolygonRoi
    • getLength

      public double getLength()
      Returns the perimeter of this ellipse.
      Overrides:
      getLength in class PolygonRoi
    • getParams

      public double[] getParams()
      Returns x1, y1, x2, y2 and aspectRatio as a 5 element array.
    • getFeretValues

      public double[] getFeretValues()
      Description copied from class: Roi
      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.
      [5-7] reserved
      All these values and point coordinates are in calibrated image coordinates.

      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.

      Overrides:
      getFeretValues in class Roi
    • subPixelResolution

      public boolean subPixelResolution()
      Always returns true.
      Overrides:
      subPixelResolution in class PolygonRoi