Class RenderedImageServer

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

public class RenderedImageServer extends qupath.lib.images.servers.AbstractTileableImageServer implements qupath.lib.images.servers.GeneratingImageServer<BufferedImage>
An ImageServer that can display a rendered image, with optional overlays. This is intended for use when exporting 'flattened' RGB images.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder to create an ImageServer to display rendered images, with optional overlay layers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected BufferedImage
    createDefaultRGBImage(int width, int height)
     
    protected String
     
    static qupath.lib.images.servers.ImageServer<BufferedImage>
    Create an ImageServer that returns tiles based on how approximately they would appear within the viewer.
    static qupath.lib.images.servers.ImageServer<BufferedImage>
    createRenderedServer(qupath.lib.images.servers.ImageServer<BufferedImage> server, ImageRenderer renderer)
    Create an ImageServer that converts the image to RGB using the specified ImageRenderer.
    protected qupath.lib.images.servers.ImageServerBuilder.ServerBuilder<BufferedImage>
     
    qupath.lib.images.servers.ImageServerMetadata
     
     
     
    protected boolean
     
    protected BufferedImage
    readTile(qupath.lib.images.servers.TileRequest tileRequest)
     

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

    allowSmoothInterpolation, getDefaultColorModel, getEmptyTile, getEmptyTile, getTile, readRegion

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

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

    Methods inherited from class java.lang.Object

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

    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, isEmptyRegion, isRGB, nChannels, nResolutions, nTimepoints, nZSlices, readBufferedImage, readRegion, readRegion, readRegion, setMetadata
  • Method Details

    • createRenderedServer

      public static qupath.lib.images.servers.ImageServer<BufferedImage> createRenderedServer(QuPathViewer viewer) throws IOException
      Create an ImageServer that returns tiles based on how approximately they would appear within the viewer. Note that
      • the server uses fixed downsample values, while the viewer can adapt annotation line thickness continuously - therefore the agreement is not exact
      • changing display settings in the viewer may impact how later tiles are rendered
      • the server cannot be serialized to JSON
      The intention is to treat this as a throwaway server used to create rendered images including color transforms and overlays, which will be saved to disk.
      Parameters:
      viewer -
      Returns:
      Throws:
      IOException
      See Also:
    • createRenderedServer

      public static qupath.lib.images.servers.ImageServer<BufferedImage> createRenderedServer(qupath.lib.images.servers.ImageServer<BufferedImage> server, ImageRenderer renderer) throws IOException
      Create an ImageServer that converts the image to RGB using the specified ImageRenderer.
      Parameters:
      server -
      renderer -
      Returns:
      Throws:
      IOException
    • getURIs

      public Collection<URI> getURIs()
      Specified by:
      getURIs in interface qupath.lib.images.servers.ImageServer<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>
    • readTile

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

      protected boolean hasAlpha()
    • createDefaultRGBImage

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

      protected qupath.lib.images.servers.ImageServerBuilder.ServerBuilder<BufferedImage> createServerBuilder()
      Specified by:
      createServerBuilder in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • createID

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

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
      Throws:
      Exception