Package qupath.lib.gui.viewer
Class PathObjectPainter
java.lang.Object
qupath.lib.gui.viewer.PathObjectPainter
Static methods to assist with painting PathObjects.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StrokegetCachedStroke(double thickness) Get aBasicStrokewith the specified thickness.static voidpaintConnections(DelaunayTools.Subdivision subdivision, PathObjectHierarchy hierarchy, Graphics2D g2d, Color color, double downsampleFactor, ImagePlane plane) Paint connections between objects from aDelaunayTools.Subdivision.static voidpaintConnections(PathObjectConnections connections, PathObjectHierarchy hierarchy, Graphics2D g2d, Color color, double downsampleFactor, ImagePlane plane) Deprecated.v0.6.0 as #paintConnections(DelaunayTools.Subdivision, PathObjectHierarchy, Graphics2D, Color, double, ImagePlane) is preferredstatic voidpaintHandles(List<Point2> handles, Graphics2D g2d, double minHandleSize, double maxHandleSize, Color colorStroke, Color colorFill) Paint the handles onto a Graphics object, if we have a suitable (non-point) ROI.static voidpaintHandles(RoiEditor roiEditor, Graphics2D g2d, double minHandleSize, double maxHandleSize, Color colorStroke, Color colorFill) Paint the handles onto a Graphics object, if we have a suitable (non-point) ROI.static booleanpaintObject(PathObject pathObject, Graphics2D g, OverlayOptions overlayOptions, PathObjectSelectionModel selectionModel, double downsample) Paint an object (or, more precisely, its ROI).static voidpaintShape(Shape shape, Graphics2D g2d, Color colorStroke, Stroke stroke, Color colorFill) Paint the specified shape with specified stroke and fill colors.static voidpaintSpecifiedObjects(Graphics2D g2d, Collection<? extends PathObject> pathObjects, OverlayOptions overlayOptions, PathObjectSelectionModel selectionModel, double downsample) Paint the specified objects.static voidpaintTMAGrid(Graphics2D g2d, TMAGrid tmaGrid, OverlayOptions overlayOptions, PathObjectSelectionModel selectionModel, double downsample) Paint the specified tissue microarray grid.
- 
Method Details- 
paintSpecifiedObjectspublic static void paintSpecifiedObjects(Graphics2D g2d, Collection<? extends PathObject> pathObjects, OverlayOptions overlayOptions, PathObjectSelectionModel selectionModel, double downsample) Paint the specified objects.- Parameters:
- g2d- the graphics object on which the objects should be painted
- pathObjects- the objects to paint
- overlayOptions- the overlay options defining how objects should be painted
- selectionModel- the selection model used to determine the selection status of each object
- downsample- the downsample factor; this should already be applied to the graphics object, but is needed to determine some line thicknesses
 
- 
paintTMAGridpublic static void paintTMAGrid(Graphics2D g2d, TMAGrid tmaGrid, OverlayOptions overlayOptions, PathObjectSelectionModel selectionModel, double downsample) Paint the specified tissue microarray grid.- Parameters:
- g2d- the graphics object on which the objects should be painted
- tmaGrid- the TMA grid
- overlayOptions- the overlay options defining how objects should be painted
- selectionModel- the selection model used to determine the selection status of each object
- downsample- the downsample factor; this should already be applied to the graphics object, but is needed to determine some line thicknesses
 
- 
paintObjectpublic static boolean paintObject(PathObject pathObject, Graphics2D g, OverlayOptions overlayOptions, PathObjectSelectionModel selectionModel, double downsample) Paint an object (or, more precisely, its ROI). This is subject to the OverlayOptions, and therefore may not actually end up painting anything (if the settings are such that objects of the class provided are not to be displayed)- Parameters:
- pathObject-
- g-
- overlayOptions-
- selectionModel-
- downsample-
- Returns:
- true if anything was painted, false otherwise
 
- 
paintShapepublic static void paintShape(Shape shape, Graphics2D g2d, Color colorStroke, Stroke stroke, Color colorFill) Paint the specified shape with specified stroke and fill colors.- Parameters:
- shape- shape to paint
- g2d- graphics object
- colorStroke- stroke color (may be null)
- stroke- stroke (may be null)
- colorFill- fill color (may be null)
 
- 
getCachedStrokeGet aBasicStrokewith the specified thickness.- Parameters:
- thickness-
- Returns:
 
- 
paintHandlespublic static void paintHandles(RoiEditor roiEditor, Graphics2D g2d, double minHandleSize, double maxHandleSize, Color colorStroke, Color colorFill) Paint the handles onto a Graphics object, if we have a suitable (non-point) ROI.The minimum and maximum handle size can be specified; if the same, all handles will have the same size. If different, then the distance between consecutive handles will be used to influence the actual handle size. This is helpful when handles are densely packed. - Parameters:
- roiEditor-
- g2d-
- minHandleSize-
- maxHandleSize-
- colorStroke-
- colorFill-
 
- 
paintHandlespublic static void paintHandles(List<Point2> handles, Graphics2D g2d, double minHandleSize, double maxHandleSize, Color colorStroke, Color colorFill) Paint the handles onto a Graphics object, if we have a suitable (non-point) ROI.The minimum and maximum handle size can be specified; if the same, all handles will have the same size. If different, then the distance between consecutive handles will be used to influence the actual handle size. This is helpful when handles are densely packed. - Parameters:
- handles-
- g2d-
- minHandleSize-
- maxHandleSize-
- colorStroke-
- colorFill-
 
- 
paintConnections@Deprecated public static void paintConnections(PathObjectConnections connections, PathObjectHierarchy hierarchy, Graphics2D g2d, Color color, double downsampleFactor, ImagePlane plane) Deprecated.v0.6.0 as #paintConnections(DelaunayTools.Subdivision, PathObjectHierarchy, Graphics2D, Color, double, ImagePlane) is preferredPaint connections between objects (e.g. from Delaunay triangulation).- Parameters:
- connections-
- hierarchy-
- g2d-
- color-
- downsampleFactor-
- plane-
 
- 
paintConnectionspublic static void paintConnections(DelaunayTools.Subdivision subdivision, PathObjectHierarchy hierarchy, Graphics2D g2d, Color color, double downsampleFactor, ImagePlane plane) Paint connections between objects from aDelaunayTools.Subdivision.- Parameters:
- subdivision-
- hierarchy-
- g2d-
- color-
- downsampleFactor-
- plane-
 
 
-