Package qupath.lib.awt.common
Class AwtTools
java.lang.Object
qupath.lib.awt.common.AwtTools
A collection of static methods useful when working with AWT shapes and
ImageRegions.-
Method Summary
Modifier and TypeMethodDescriptionstatic RectanglegetBounds(ImageRegion region) Create aRectanglecorresponding to the x,y,width,height of anImageRegion.static RectanglegetBounds(ImageRegion region, Rectangle rect) Set the bounds of an existingRectangleto the x,y,width,height of anImageRegion.static Rectanglestatic Rectangle2DgetBounds2D(ROI roi) Create aRectangle2Dcorresponding to bounding box of aROI.static Rectangle2DgetBounds2D(ROI roi, Rectangle2D rect) Set the bounds of an existingRectangle2Dto the x,y,width,height of aROI.static ImageRegiongetImageRegion(Rectangle rectangle, int z, int t) Create anImageRegioncorresponding to a specifiedRectanglebounding box.static ImageRegiongetImageRegion(Shape shape, int z, int t) Create anImageRegioncorresponding to a the bounding box of aShape.
-
Method Details
-
getBounds
Create aRectanglecorresponding to the x,y,width,height of anImageRegion.- Parameters:
region-- Returns:
-
getBounds
Set the bounds of an existingRectangleto the x,y,width,height of anImageRegion.If no
Rectangleis provided, a new one will be created.- Parameters:
region-rect-- Returns:
-
getBounds2D
Create aRectangle2Dcorresponding to bounding box of aROI.- Parameters:
roi-- Returns:
-
getBounds2D
Set the bounds of an existingRectangle2Dto the x,y,width,height of aROI.If no
Rectangle2Dis provided, a new one will be created.- Parameters:
roi-rect-- Returns:
-
getBounds
Create aRectanglecorresponding to bounding box of aROI.This differs from
getBounds2D(ROI)in that the bounding box must consist of integer values.- Parameters:
roi-- Returns:
-
getImageRegion
Create anImageRegioncorresponding to a specifiedRectanglebounding box.- Parameters:
rectangle-z- the z position of the regiont- the t position of the region- Returns:
-
getImageRegion
Create anImageRegioncorresponding to a the bounding box of aShape.- Parameters:
shape-z- the z position of the regiont- the t position of the region- Returns:
-