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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ROIcreateAreaROI(Shape shape, ImagePlane plane) Create an area ROI representing a 2D shape.static ROIcreateEllipseROI(double x, double y, double width, double height, ImagePlane plane) Create an ellipse ROI defined by its bounding box.static ROICreate an 'empty' ROI with no length or area.static ROIcreateLineROI(double x, double y, double x2, double y2, ImagePlane plane) Create a line ROI with start and end coordinates.static ROIcreateLineROI(double x, double y, ImagePlane plane) Create a ROI representing a line with zero length.static ROIcreatePointsROI(double[] x, double[] y, ImagePlane plane) Create a points ROI from an array of x and y coordinates.static ROIcreatePointsROI(double x, double y, ImagePlane plane) Create a points ROI containing a single point.static ROIcreatePointsROI(List<? extends Point2> points, ImagePlane plane) Create a points ROI from a list of points.static ROIcreatePointsROI(ImagePlane plane) Create an empty points ROI.static ROIcreatePolygonROI(double[] x, double[] y, ImagePlane plane) Create a polygon ROI from an array of x and y coordinates.static PolygonROIcreatePolygonROI(double x, double y, ImagePlane plane) Create an empty, closed polygon ROI consisting of a single point.static PolygonROIcreatePolygonROI(List<Point2> points, ImagePlane plane) Create a closed polygon ROI from a list of points.static ROIcreatePolylineROI(double[] x, double[] y, ImagePlane plane) Create a polygon ROI from an array of x and y coordinates.static PolylineROIcreatePolylineROI(double x, double y, ImagePlane plane) Create an empty polyline ROI consisting of a single point.static PolylineROIcreatePolylineROI(List<Point2> points, ImagePlane plane) Create a polyline ROI from a list of points.static ROIcreateRectangleROI(double x, double y, double width, double height, ImagePlane plane) Create a rectangle ROI defined by its bounding box.static ROIcreateRectangleROI(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:
-