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
.
- Author:
- Pete Bankhead
-
Constructor Summary
ConstructorDescriptionWrappedBufferedImageServer
(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 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.protected BufferedImage
readTile
(TileRequest tileRequest) Read a single image tile.Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServer
allowSmoothInterpolation, createDefaultRGBImage, getDefaultColorModel, getEmptyTile, getEmptyTile, getTile, readRegion
Methods inherited from class qupath.lib.images.servers.AbstractImageServer
close, finalize, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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: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:
-
createID
Returns a UUID.- Specified by:
createID
in classAbstractImageServer<BufferedImage>
- Returns:
-
getServerType
Description copied from interface:ImageServer
A string describing the type of server, for example the name of the library used (Openslide, Bioformats...)- Returns:
-
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:
-
createServerBuilder
Returns null (does not support ServerBuilders).- Specified by:
createServerBuilder
in classAbstractImageServer<BufferedImage>
- Returns:
-
readTile
Description copied from class:AbstractTileableImageServer
Read a single image tile.- Specified by:
readTile
in classAbstractTileableImageServer
- Parameters:
tileRequest
-- Returns:
- Throws:
IOException
-