Package qupath.lib.images.servers
Class WrappedBufferedImageServer
java.lang.Object
qupath.lib.images.servers.AbstractImageServer<BufferedImage>
qupath.lib.images.servers.AbstractTileableImageServer
qupath.lib.images.servers.WrappedBufferedImageServer
- All Implemented Interfaces:
AutoCloseable,ImageServer<BufferedImage>
Implementation of an
ImageServer that simply wraps an existing BufferedImage.
This may help whenever requiring a server, but only having a BufferedImage.
-
Constructor Summary
ConstructorsConstructorDescriptionWrappedBufferedImageServer(String imageName, BufferedImage img) Create anImageServer<BufferedImage>using an image that has been provided directly.WrappedBufferedImageServer(String imageName, BufferedImage img, List<ImageChannel> channels) Create anImageServer<BufferedImage>using an image that has been provided directly. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateID()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.protected BufferedImagereadTile(TileRequest tileRequest) Read a single image tile.Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServer
allowSmoothInterpolation, createDefaultRGBImage, getDefaultColorModel, getEmptyTile, getEmptyTile, getTile, readRegionMethods 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, isEmptyRegion, isRGB, nChannels, nResolutions, nTimepoints, nZSlices, setMetadata, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface qupath.lib.images.servers.ImageServer
getPixelCalibration, readBufferedImage, readRegion, readRegion
-
Constructor Details
-
WrappedBufferedImageServer
Create anImageServer<BufferedImage>using an image that has been provided directly.- Parameters:
imageName- a name to display (may be null)img- the BufferedImage to wrap
-
WrappedBufferedImageServer
Create anImageServer<BufferedImage>using an image that has been provided directly.- Parameters:
imageName- a name to display (may be null)img- the BufferedImage to wrapchannels- the ImageChannels, required in case the preferred channel colors cannot be obtained from the image itself
-
-
Method Details
-
getURIs
Description copied from interface:ImageServerGet 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:
-
createID
Returns a UUID.- Specified by:
createIDin classAbstractImageServer<BufferedImage>- Returns:
-
getServerType
Description copied from interface:ImageServerA string describing the type of server, for example the name of the library used (Openslide, Bioformats...)- Returns:
-
getOriginalMetadata
Description copied from interface:ImageServerGet the original metadata read during creation of the server. This may or may not be correct.- Returns:
- See Also:
-
createServerBuilder
Returns null (does not support ServerBuilders).- Specified by:
createServerBuilderin classAbstractImageServer<BufferedImage>- Returns:
-
readTile
Description copied from class:AbstractTileableImageServerRead a single image tile.- Specified by:
readTilein classAbstractTileableImageServer- Parameters:
tileRequest-- Returns:
- Throws:
IOException
-