Class HierarchyOverlay

java.lang.Object
qupath.lib.gui.viewer.overlays.AbstractOverlay
qupath.lib.gui.viewer.overlays.HierarchyOverlay
All Implemented Interfaces:
PathOverlay

public class HierarchyOverlay extends AbstractOverlay
An overlay capable of painting a PathObjectHierarchy, except for any TMA grid (which is handled by TMAGridOverlay).
Author:
Pete Bankhead
  • Constructor Details

    • HierarchyOverlay

      public HierarchyOverlay(DefaultImageRegionStore regionStore, OverlayOptions overlayOptions, ImageData<BufferedImage> imageData)
      Constructor. Note that a HierarchyOverlay cannot adapt very efficient to changes in ImageData, and therefore should not be reused across viewers.
      Parameters:
      regionStore - region store to cache image tiles
      overlayOptions - overlay options to control display
      imageData - 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 the Graphics2D as part of its AffineTransform, however it may optionally be needed within the method e.g. to correct line thicknesses.
      imageData - the ImageData associated with this overlay. If the overlay is being displayed on a viewer, this is the ImageData 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

      public void clearCachedOverlayForRegion(ImageRegion region)
      Clear previously-cached tiles for a specified region of this overlay.
      Parameters:
      region - the region for which tiles should be removed