Class TransformingImageServer<T>

java.lang.Object
qupath.lib.images.servers.AbstractImageServer<T>
qupath.lib.images.servers.TransformingImageServer<T>
Type Parameters:
T -
All Implemented Interfaces:
AutoCloseable, ImageServer<T>
Direct Known Subclasses:
AffineTransformImageServer, ChannelDisplayTransformServer, ChannelTransformFeatureServer, CroppedImageServer, RearrangeRGBImageServer, RotatedImageServer

public abstract class TransformingImageServer<T> extends AbstractImageServer<T>
An ImageServer implementation used to apply transforms to another ImageServer. This might be a spatial or pixel intensity transformation, for example.

Subclasses may only implement the methods necessary to apply the required transform, such as readRegion(RegionRequest) since much of the remaining functionality is left up to the AbstractImageServer implementation.

Author:
Pete Bankhead
  • Constructor Details

    • TransformingImageServer

      protected TransformingImageServer(ImageServer<T> server)
  • Method Details

    • getWrappedServer

      protected ImageServer<T> getWrappedServer()
      Get underlying ImageServer, i.e. the one that is being wrapped.
      Returns:
    • getURIs

      public Collection<URI> getURIs()
      Description copied from interface: ImageServer
      Get the URIs for images required for this server. In the simplest case, this is a singleton list returning a URI representing a local file. However, some ImageServers may not have an associated URI at all, whereas others may depend upon multiple URIs (e.g. if concatenating images).

      Note: A URI alone may not be sufficient to recreate even a simple ImageServer; see ImageServer.getBuilder().

      Returns:
    • readRegion

      public T readRegion(RegionRequest request) throws IOException
      Description copied from interface: ImageServer
      Read a 2D(+C) image region for a specified RegionRequest. Coordinates and bounding box dimensions from the request are in pixel units, at the full image resolution (i.e. when downsample = 1).

      All channels are always returned.

      No specific checking is guaranteed to ensure that the request is valid, e.g. if it extends beyond the image boundary then it is likely (but not certain) that the returned image will be cropped accordingly - but some implementations may contain empty padding instead. Therefore it is up to the caller to ensure that the requests are within range.

      However, it is expected that any returnable region will be at least 1x1 pixel in size, even if via high downsampling one might otherwise expect a 0x0 image. This is consistent with the idea of pixels representing point samples rather than little squares.

      Note: One should avoid returning null, as this cannot be stored as a value in some map implementations that may be used for caching.

      Parameters:
      request - the region for which pixels are requested
      Returns:
      pixels for the region being requested
      Throws:
      IOException
      See Also:
    • getOriginalMetadata

      public ImageServerMetadata getOriginalMetadata()
      Description copied from interface: ImageServer
      Get the original metadata read during creation of the server. This may or may not be correct.
      Returns:
      See Also: