Package qupath.lib.gui.images.servers
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
,GeneratingImageServer<BufferedImage>
,ImageServer<BufferedImage>
public class PathHierarchyImageServer
extends AbstractTileableImageServer
implements 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.- Author:
- Pete Bankhead
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
Prefix used for the path of all instances of this class. -
Constructor Summary
ConstructorDescriptionPathHierarchyImageServer
(ImageData<BufferedImage> imageData, OverlayOptions options) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected BufferedImage
createDefaultRGBImage
(int width, int height) Create the default (blank) RGB image for this server.protected String
createID()
Returns a UUID.protected ImageServerBuilder.ServerBuilder
<BufferedImage> Returns null (does not support ServerBuilders).Get the original metadata read during creation of the server.A string describing the type of server, for example the name of the library used (Openslide, Bioformats...)getURIs()
Get the URIs for images required for this server.boolean
isEmptyRegion
(RegionRequest request) Returns true if there are no objects to be painted within the requested region.protected BufferedImage
readTile
(TileRequest tileRequest) Read a single image tile.void
setMetadata
(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
finalize, 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, 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, isRGB, nChannels, nResolutions, nTimepoints, nZSlices, readBufferedImage, readRegion, readRegion, readRegion
-
Field Details
-
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
Constructor.- Parameters:
imageData
- the image dataoptions
- options defining how objects will be painted
-
-
Method Details
-
createServerBuilder
Returns null (does not support ServerBuilders).- Specified by:
createServerBuilder
in classAbstractImageServer<BufferedImage>
- Returns:
-
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()
.- Specified by:
getURIs
in interfaceImageServer<BufferedImage>
- Returns:
-
createID
Returns a UUID.- Specified by:
createID
in classAbstractImageServer<BufferedImage>
- Returns:
-
isEmptyRegion
Returns true if there are no objects to be painted within the requested region.- Specified by:
isEmptyRegion
in interfaceImageServer<BufferedImage>
- Overrides:
isEmptyRegion
in classAbstractImageServer<BufferedImage>
- Parameters:
request
-- Returns:
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classAbstractImageServer<BufferedImage>
-
getServerType
Description copied from interface:ImageServer
A string describing the type of server, for example the name of the library used (Openslide, Bioformats...)- Specified by:
getServerType
in interfaceImageServer<BufferedImage>
- Returns:
-
getOriginalMetadata
Description copied from interface:ImageServer
Get the original metadata read during creation of the server. This may or may not be correct.- Specified by:
getOriginalMetadata
in interfaceImageServer<BufferedImage>
- Returns:
- See Also:
-
setMetadata
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 interfaceImageServer<BufferedImage>
- Overrides:
setMetadata
in classAbstractImageServer<BufferedImage>
- Parameters:
metadata
-
-
createDefaultRGBImage
Description copied from class:AbstractTileableImageServer
Create the default (blank) RGB image for this server.By default this will have
TYPE_INT_RGB
but a subclass may change this if necessary (e.g. to incorporate an alpha channel).- Overrides:
createDefaultRGBImage
in classAbstractTileableImageServer
- Parameters:
width
-height
-- Returns:
-
readTile
Description copied from class:AbstractTileableImageServer
Read a single image tile.- Specified by:
readTile
in classAbstractTileableImageServer
- Parameters:
tileRequest
-- Returns:
- Throws:
IOException
-