Class PathHierarchyImageServer

java.lang.Object
qupath.lib.images.servers.AbstractImageServer<BufferedImage>
qupath.lib.images.servers.AbstractTileableImageServer
qupath.lib.gui.images.servers.PathHierarchyImageServer
All Implemented Interfaces:
AutoCloseable, qupath.lib.images.servers.GeneratingImageServer<BufferedImage>, qupath.lib.images.servers.ImageServer<BufferedImage>

public class PathHierarchyImageServer extends qupath.lib.images.servers.AbstractTileableImageServer implements qupath.lib.images.servers.GeneratingImageServer<BufferedImage>
A special ImageServer implementation that doesn't have a backing image, but rather constructs tiles on request from a PathObjectHierarchy and its detection objects.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
    Prefix used for the path of all instances of this class.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PathHierarchyImageServer(qupath.lib.images.ImageData<BufferedImage> imageData, OverlayOptions options)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected BufferedImage
    createDefaultRGBImage(int width, int height)
     
    protected String
    Returns a UUID.
    protected qupath.lib.images.servers.ImageServerBuilder.ServerBuilder<BufferedImage>
    Returns null (does not support ServerBuilders).
    qupath.lib.images.servers.ImageServerMetadata
     
     
     
    boolean
    isEmptyRegion(qupath.lib.regions.RegionRequest request)
    Returns true if there are no objects to be painted within the requested region.
    protected BufferedImage
    readTile(qupath.lib.images.servers.TileRequest tileRequest)
     
    void
    setMetadata(qupath.lib.images.servers.ImageServerMetadata metadata)
    Throws an exception - metadata should not be set for a hierarchy image server directly.

    Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServer

    allowSmoothInterpolation, getDefaultColorModel, getEmptyTile, getEmptyTile, getTile, readRegion

    Methods inherited from class qupath.lib.images.servers.AbstractImageServer

    close, getAssociatedImage, getAssociatedImageList, getBuilder, getCache, getCachedTile, getChannel, getDefaultThumbnail, getDownsampleForResolution, getHeight, getImageClass, getMetadata, getPath, getPixelType, getPreferredDownsamples, getThumbnailDownsampleFactor, getTileRequestManager, getWidth, isRGB, nChannels, nResolutions, nTimepoints, nZSlices, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.AutoCloseable

    close

    Methods inherited from interface qupath.lib.images.servers.ImageServer

    getAssociatedImage, getAssociatedImageList, getBuilder, getCachedTile, getChannel, getDefaultThumbnail, getDownsampleForResolution, getHeight, getImageClass, getMetadata, getPath, getPixelCalibration, getPixelType, getPreferredDownsamples, getTileRequestManager, getWidth, isRGB, nChannels, nResolutions, nTimepoints, nZSlices, readBufferedImage, readRegion, readRegion, readRegion
  • Field Details

    • DEFAULT_PREFIX

      public static String DEFAULT_PREFIX
      Prefix used for the path of all instances of this class. This can be used to help with caching (and in particular with clearing caches selectively).
  • Constructor Details

    • PathHierarchyImageServer

      public PathHierarchyImageServer(qupath.lib.images.ImageData<BufferedImage> imageData, OverlayOptions options)
      Constructor.
      Parameters:
      imageData - the image data
      options - options defining how objects will be painted
  • Method Details

    • createServerBuilder

      protected qupath.lib.images.servers.ImageServerBuilder.ServerBuilder<BufferedImage> createServerBuilder()
      Returns null (does not support ServerBuilders).
      Specified by:
      createServerBuilder in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • getURIs

      public Collection<URI> getURIs()
      Specified by:
      getURIs in interface qupath.lib.images.servers.ImageServer<BufferedImage>
    • createID

      protected String createID()
      Returns a UUID.
      Specified by:
      createID in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • isEmptyRegion

      public boolean isEmptyRegion(qupath.lib.regions.RegionRequest request)
      Returns true if there are no objects to be painted within the requested region.
      Specified by:
      isEmptyRegion in interface qupath.lib.images.servers.ImageServer<BufferedImage>
      Overrides:
      isEmptyRegion in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • getServerType

      public String getServerType()
      Specified by:
      getServerType in interface qupath.lib.images.servers.ImageServer<BufferedImage>
    • getOriginalMetadata

      public qupath.lib.images.servers.ImageServerMetadata getOriginalMetadata()
      Specified by:
      getOriginalMetadata in interface qupath.lib.images.servers.ImageServer<BufferedImage>
    • setMetadata

      public void setMetadata(qupath.lib.images.servers.ImageServerMetadata metadata)
      Throws an exception - metadata should not be set for a hierarchy image server directly. Any changes should be made to the underlying image server for which this server represents an object hierarchy.
      Specified by:
      setMetadata in interface qupath.lib.images.servers.ImageServer<BufferedImage>
      Overrides:
      setMetadata in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • createDefaultRGBImage

      protected BufferedImage createDefaultRGBImage(int width, int height)
      Overrides:
      createDefaultRGBImage in class qupath.lib.images.servers.AbstractTileableImageServer
    • readTile

      protected BufferedImage readTile(qupath.lib.images.servers.TileRequest tileRequest) throws IOException
      Specified by:
      readTile in class qupath.lib.images.servers.AbstractTileableImageServer
      Throws:
      IOException