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 SummaryModifier 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- 
getBoundsCreate aRectanglecorresponding to the x,y,width,height of anImageRegion.- Parameters:
- region-
- Returns:
 
- 
getBoundsSet 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:
 
- 
getBounds2DCreate aRectangle2Dcorresponding to bounding box of aROI.- Parameters:
- roi-
- Returns:
 
- 
getBounds2DSet 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:
 
- 
getBoundsCreate aRectanglecorresponding to bounding box of aROI.This differs from getBounds2D(ROI)in that the bounding box must consist of integer values.- Parameters:
- roi-
- Returns:
 
- 
getImageRegionCreate anImageRegioncorresponding to a specifiedRectanglebounding box.- Parameters:
- rectangle-
- z- the z position of the region
- t- the t position of the region
- Returns:
 
- 
getImageRegionCreate anImageRegioncorresponding to a the bounding box of aShape.- Parameters:
- shape-
- z- the z position of the region
- t- the t position of the region
- Returns:
 
 
-