Package qupath.lib.gui.viewer.overlays
Class HierarchyOverlay
java.lang.Object
qupath.lib.gui.viewer.overlays.AbstractOverlay
qupath.lib.gui.viewer.overlays.HierarchyOverlay
- All Implemented Interfaces:
PathOverlay
An overlay capable of painting a
PathObjectHierarchy
, except for any
TMA grid (which is handled by TMAGridOverlay
).- Author:
- Pete Bankhead
-
Nested Class Summary
Nested classes/interfaces inherited from class qupath.lib.gui.viewer.overlays.AbstractOverlay
AbstractOverlay.LocationStringFunction
-
Constructor Summary
ConstructorDescriptionHierarchyOverlay
(DefaultImageRegionStore regionStore, OverlayOptions overlayOptions, ImageData<BufferedImage> imageData) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear previously-cached tiles for this overlay.void
Clear previously-cached tiles for a specified region of this overlay.void
paintOverlay
(Graphics2D g2d, ImageRegion imageRegion, double downsampleFactor, ImageData<BufferedImage> imageData, boolean paintCompletely) Paint the overlay to a graphics object.void
Reset the last image data.Methods inherited from class qupath.lib.gui.viewer.overlays.AbstractOverlay
getAlphaComposite, getLocationString, getLocationStringFunction, getOpacity, getOverlayOptions, getPreferredOverlayColor, isVisible, setAlphaComposite, setLocationStringFunction, setOpacity, setPreferredOverlayColor
-
Constructor Details
-
HierarchyOverlay
public HierarchyOverlay(DefaultImageRegionStore regionStore, OverlayOptions overlayOptions, ImageData<BufferedImage> imageData) Constructor. Note that aHierarchyOverlay
cannot adapt very efficient to changes inImageData
, and therefore should not be reused across viewers.- Parameters:
regionStore
- region store to cache image tilesoverlayOptions
- overlay options to control displayimageData
- current image data
-
-
Method Details
-
resetImageData
public void resetImageData()Reset the last image data. The hierarchy overlay stores the last-seen image data internally to assist with caching, but retaining a reference too long could become a memory leak. -
paintOverlay
public void paintOverlay(Graphics2D g2d, ImageRegion imageRegion, double downsampleFactor, ImageData<BufferedImage> imageData, boolean paintCompletely) Description copied from interface:PathOverlay
Paint the overlay to a graphics object. The graphics object will have a transform applied to it, so the painting should make use of coordinates in the original image space.- Parameters:
g2d
- Graphics2D object to which drawing should be performed. This should have any transform already applied to it.imageRegion
- The maximum image region that should be shown.downsampleFactor
- The downsample factor at which the overlay will be viewed. There is no need for rescaling according to this value since it has already been applied to theGraphics2D
as part of itsAffineTransform
, however it may optionally be needed within the method e.g. to correct line thicknesses.imageData
- theImageData
associated with this overlay. If the overlay is being displayed on a viewer, this is theImageData
open within the viewer. Not all overlays require this, and it may be null.paintCompletely
- If true, the method is permitted to return without completely painting everything, for performance reasons.
-
clearCachedOverlay
public void clearCachedOverlay()Clear previously-cached tiles for this overlay. -
clearCachedOverlayForRegion
Clear previously-cached tiles for a specified region of this overlay.- Parameters:
region
- the region for which tiles should be removed
-