Class ROIs

java.lang.Object
qupath.lib.roi.ROIs

public class ROIs extends Object
This class consists exclusively of static methods that operate on or return regions of interest (ROIs).

These methods should be used rather than constructors for individual ROI types.

Author:
Pete Bankhead
  • Constructor Details

    • ROIs

      public ROIs()
  • Method Details

    • createEmptyROI

      public static ROI createEmptyROI()
      Create an 'empty' ROI with no length or area.

      The only guarantee is that it will return isEmpty() == true

      Returns:
    • createRectangleROI

      public static ROI createRectangleROI(double x, double y, double width, double height, ImagePlane plane)
      Create a rectangle ROI defined by its bounding box.
      Parameters:
      x -
      y -
      width -
      height -
      plane -
      Returns:
    • createRectangleROI

      public static ROI createRectangleROI(ImageRegion region)
      Create a rectangle ROI that matches an ImageRegion.
      Parameters:
      region -
      Returns:
    • createEllipseROI

      public static ROI createEllipseROI(double x, double y, double width, double height, ImagePlane plane)
      Create an ellipse ROI defined by its bounding box.
      Parameters:
      x -
      y -
      width -
      height -
      plane -
      Returns:
    • createLineROI

      public static ROI createLineROI(double x, double y, double x2, double y2, ImagePlane plane)
      Create a line ROI with start and end coordinates.
      Parameters:
      x -
      y -
      x2 -
      y2 -
      plane -
      Returns:
    • createLineROI

      public static ROI createLineROI(double x, double y, ImagePlane plane)
      Create a ROI representing a line with zero length.
      Parameters:
      x -
      y -
      plane -
      Returns:
    • createPointsROI

      public static ROI createPointsROI(ImagePlane plane)
      Create an empty points ROI.
      Parameters:
      plane -
      Returns:
    • createPointsROI

      public static ROI createPointsROI(double x, double y, ImagePlane plane)
      Create a points ROI containing a single point.
      Parameters:
      x -
      y -
      plane -
      Returns:
    • createPointsROI

      public static ROI createPointsROI(List<? extends Point2> points, ImagePlane plane)
      Create a points ROI from a list of points.
      Parameters:
      points -
      plane -
      Returns:
    • createPointsROI

      public static ROI createPointsROI(double[] x, double[] y, ImagePlane plane)
      Create a points ROI from an array of x and y coordinates.
      Parameters:
      x -
      y -
      plane -
      Returns:
    • createPolygonROI

      public static PolygonROI createPolygonROI(List<Point2> points, ImagePlane plane)
      Create a closed polygon ROI from a list of points.
      Parameters:
      points -
      plane -
      Returns:
    • createPolygonROI

      public static ROI createPolygonROI(double[] x, double[] y, ImagePlane plane)
      Create a polygon ROI from an array of x and y coordinates.
      Parameters:
      x -
      y -
      plane -
      Returns:
    • createPolygonROI

      public static PolygonROI createPolygonROI(double x, double y, ImagePlane plane)
      Create an empty, closed polygon ROI consisting of a single point.
      Parameters:
      x -
      y -
      plane -
      Returns:
    • createPolylineROI

      public static PolylineROI createPolylineROI(List<Point2> points, ImagePlane plane)
      Create a polyline ROI from a list of points.
      Parameters:
      points -
      plane -
      Returns:
    • createPolylineROI

      public static PolylineROI createPolylineROI(double x, double y, ImagePlane plane)
      Create an empty polyline ROI consisting of a single point.
      Parameters:
      x -
      y -
      plane -
      Returns:
    • createPolylineROI

      public static ROI createPolylineROI(double[] x, double[] y, ImagePlane plane)
      Create a polygon ROI from an array of x and y coordinates.
      Parameters:
      x -
      y -
      plane -
      Returns:
    • createAreaROI

      public static ROI createAreaROI(Shape shape, ImagePlane plane)
      Create an area ROI representing a 2D shape.

      The resulting ROI may consist of multiple disconnected regions, possibly containing holes.

      Parameters:
      shape -
      plane -
      Returns: