Package qupath.lib.roi
Class ROIs
java.lang.Object
qupath.lib.roi.ROIs
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ROI
createAreaROI
(Shape shape, ImagePlane plane) Create an area ROI representing a 2D shape.static ROI
createEllipseROI
(double x, double y, double width, double height, ImagePlane plane) Create an ellipse ROI defined by its bounding box.static ROI
Create an 'empty' ROI with no length or area.static ROI
createLineROI
(double x, double y, double x2, double y2, ImagePlane plane) Create a line ROI with start and end coordinates.static ROI
createLineROI
(double x, double y, ImagePlane plane) Create a ROI representing a line with zero length.static ROI
createPointsROI
(double[] x, double[] y, ImagePlane plane) Create a points ROI from an array of x and y coordinates.static ROI
createPointsROI
(double x, double y, ImagePlane plane) Create a points ROI containing a single point.static ROI
createPointsROI
(List<? extends Point2> points, ImagePlane plane) Create a points ROI from a list of points.static ROI
createPointsROI
(ImagePlane plane) Create an empty points ROI.static ROI
createPolygonROI
(double[] x, double[] y, ImagePlane plane) Create a polygon ROI from an array of x and y coordinates.static PolygonROI
createPolygonROI
(double x, double y, ImagePlane plane) Create an empty, closed polygon ROI consisting of a single point.static PolygonROI
createPolygonROI
(List<Point2> points, ImagePlane plane) Create a closed polygon ROI from a list of points.static ROI
createPolylineROI
(double[] x, double[] y, ImagePlane plane) Create a polygon ROI from an array of x and y coordinates.static PolylineROI
createPolylineROI
(double x, double y, ImagePlane plane) Create an empty polyline ROI consisting of a single point.static PolylineROI
createPolylineROI
(List<Point2> points, ImagePlane plane) Create a polyline ROI from a list of points.static ROI
createRectangleROI
(double x, double y, double width, double height, ImagePlane plane) Create a rectangle ROI defined by its bounding box.static ROI
createRectangleROI
(ImageRegion region) Create a rectangle ROI that matches an ImageRegion.
-
Constructor Details
-
ROIs
public ROIs()
-
-
Method Details
-
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
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
Create a line ROI with start and end coordinates.- Parameters:
x
-y
-x2
-y2
-plane
-- Returns:
-
createLineROI
Create a ROI representing a line with zero length.- Parameters:
x
-y
-plane
-- Returns:
-
createPointsROI
Create an empty points ROI.- Parameters:
plane
-- Returns:
-
createPointsROI
Create a points ROI containing a single point.- Parameters:
x
-y
-plane
-- Returns:
-
createPointsROI
Create a points ROI from a list of points.- Parameters:
points
-plane
-- Returns:
-
createPointsROI
Create a points ROI from an array of x and y coordinates.- Parameters:
x
-y
-plane
-- Returns:
-
createPolygonROI
Create a closed polygon ROI from a list of points.- Parameters:
points
-plane
-- Returns:
-
createPolygonROI
Create a polygon ROI from an array of x and y coordinates.- Parameters:
x
-y
-plane
-- Returns:
-
createPolygonROI
Create an empty, closed polygon ROI consisting of a single point.- Parameters:
x
-y
-plane
-- Returns:
-
createPolylineROI
Create a polyline ROI from a list of points.- Parameters:
points
-plane
-- Returns:
-
createPolylineROI
Create an empty polyline ROI consisting of a single point.- Parameters:
x
-y
-plane
-- Returns:
-
createPolylineROI
Create a polygon ROI from an array of x and y coordinates.- Parameters:
x
-y
-plane
-- Returns:
-
createAreaROI
Create an area ROI representing a 2D shape.The resulting ROI may consist of multiple disconnected regions, possibly containing holes.
- Parameters:
shape
-plane
-- Returns:
-