Package qupath.lib.regions
Class ImageRegion
java.lang.Object
qupath.lib.regions.ImageRegion
- Direct Known Subclasses:
RegionRequest
Class for defining an image region.
A boundary box is given in pixel coordinates, while z & t values are given as indices.
- Author:
- Pete Bankhead
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(int x, int y, int z, int t) Check if this region contains a specified coordinate.static ImageRegion
createInstance
(int x, int y, int width, int height, int z, int t) Create a region based on its bounding box coordinates, z-slice index and time point index.static ImageRegion
createInstance
(Collection<? extends ROI> rois) Create the smallest region that completely contains the specified ROIs.static ImageRegion
createInstance
(ROI pathROI) Create the smallest region that completely contains a specified ROI.boolean
int
Get the height of the region bounding box.Get the z-slice and time point for this region as anImagePlane
.int
getMaxX()
Get the x coordinate of the bottom right of the region bounding box.int
getMaxY()
Get the y coordinate of the bottom right of the region bounding box.int
getMinX()
Get the x coordinate of the top left of the region bounding box.int
getMinY()
Get the y coordinate of the top left of the region bounding box.getPlane()
Deprecated.int
getT()
Get the time point index for the region.int
getWidth()
Get the width of the region bounding box.int
getX()
Get the x coordinate of the region bounding box (top left).int
getY()
Get the y coordinate of the region bounding box (top left).int
getZ()
Get the z-slice index for the region.int
hashCode()
boolean
intersects
(double x2, double y2, double w2, double h2) Query if this region intersects with a specified bounding box, ignoring z-slice and time point information.boolean
intersects
(ImageRegion request) Returns true if the region specified by this region overlaps with another.toString()
-
Method Details
-
toString
-
createInstance
Create a region based on its bounding box coordinates, z-slice index and time point index.- Parameters:
x
-y
-width
-height
-z
-t
-- Returns:
-
createInstance
Create the smallest region that completely contains a specified ROI.- Parameters:
pathROI
-- Returns:
-
createInstance
Create the smallest region that completely contains the specified ROIs.- Parameters:
rois
-- Returns:
-
intersects
Returns true if the region specified by this region overlaps with another.If either z or t is < 0 then that value will be ignored.
- Parameters:
request
-- Returns:
-
intersects
public boolean intersects(double x2, double y2, double w2, double h2) Query if this region intersects with a specified bounding box, ignoring z-slice and time point information.- Parameters:
x2
-y2
-w2
-h2
-- Returns:
-
contains
public boolean contains(int x, int y, int z, int t) Check if this region contains a specified coordinate.- Parameters:
x
-y
-z
-t
-- Returns:
-
getX
public int getX()Get the x coordinate of the region bounding box (top left).- Returns:
-
getY
public int getY()Get the y coordinate of the region bounding box (top left).- Returns:
-
getWidth
public int getWidth()Get the width of the region bounding box.- Returns:
-
getHeight
public int getHeight()Get the height of the region bounding box.- Returns:
-
getZ
public int getZ()Get the z-slice index for the region.- Returns:
-
getT
public int getT()Get the time point index for the region.- Returns:
-
getMinX
public int getMinX()Get the x coordinate of the top left of the region bounding box.- Returns:
-
getMaxX
public int getMaxX()Get the x coordinate of the bottom right of the region bounding box.- Returns:
-
getMinY
public int getMinY()Get the y coordinate of the top left of the region bounding box.- Returns:
-
getMaxY
public int getMaxY()Get the y coordinate of the bottom right of the region bounding box.- Returns:
-
getImagePlane
Get the z-slice and time point for this region as anImagePlane
.- Returns:
- Since:
- v0.4.0 (replaces
getPlane()
for better consistency with other classes)
-
getPlane
Deprecated.v0.4.0 usegetImagePlane()
instead (changed for better consistency with other classes)Get the z-slice and time point for this region as anImagePlane
.- Returns:
-
hashCode
public int hashCode() -
equals
-
getImagePlane()
instead (changed for better consistency with other classes)