Class OpenslideImageServer
java.lang.Object
qupath.lib.images.servers.AbstractImageServer<BufferedImage>
qupath.lib.images.servers.AbstractTileableImageServer
qupath.lib.images.servers.openslide.OpenslideImageServer
- All Implemented Interfaces:
AutoCloseable
,ImageServer<BufferedImage>
ImageServer implementation using OpenSlide.
- Author:
- Pete Bankhead
-
Constructor Summary
ConstructorDescriptionOpenslideImageServer
(URI uri, String... args) Create an ImageServer using OpenSlide for the specified file. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected String
createID()
Create a unique ID for the server, which can be returned as the default value ofAbstractImageServer.getPath()
.protected ImageServerBuilder.ServerBuilder
<BufferedImage> Create a ServerBuilder, which can be used to construct an identical ImageServer.Retrieve a JSON string representation of the properties, as stored as key-value pairs by OpenSlide.getAssociatedImage
(String name) Get the image for a given associated image name.Get a list of 'associated images', e.g.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.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
finalize, 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
-
OpenslideImageServer
Create an ImageServer using OpenSlide for the specified file.The only supported arg is
--no-crop
, to specify that any bounding box should not be applied (which was the default in QuPath <= v0.1.2).- Parameters:
uri
-args
-- Throws:
IOException
-
-
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
Description copied from class:AbstractImageServer
Create a unique ID for the server, which can be returned as the default value ofAbstractImageServer.getPath()
. A suggested implementation isgetClass().getName() + ": " + URI + parameters
This will be called on demand wheneverAbstractImageServer.getPath()
is first required.- Specified by:
createID
in classAbstractImageServer<BufferedImage>
- Returns:
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classAbstractImageServer<BufferedImage>
-
dumpMetadata
Retrieve a JSON string representation of the properties, as stored as key-value pairs by OpenSlide.- 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:
-
readTile
Description copied from class:AbstractTileableImageServer
Read a single image tile.- Specified by:
readTile
in classAbstractTileableImageServer
- Parameters:
tileRequest
-- Returns:
- Throws:
IOException
-
getAssociatedImageList
Description copied from interface:ImageServer
Get a list of 'associated images', e.g. thumbnails or slide overview images.Each associated image is simply a T that does not warrant (or require) a full ImageServer, and most likely would never be analyzed.
- Specified by:
getAssociatedImageList
in interfaceImageServer<BufferedImage>
- Overrides:
getAssociatedImageList
in classAbstractImageServer<BufferedImage>
- Returns:
- See Also:
-
createServerBuilder
Description copied from class:AbstractImageServer
Create a ServerBuilder, which can be used to construct an identical ImageServer. This should also include the current metadata. It is permissible to return null for an ImageServer that cannot be recreated via aImageServerBuilder.ServerBuilder
.- Specified by:
createServerBuilder
in classAbstractImageServer<BufferedImage>
- Returns:
-
getAssociatedImage
Description copied from interface:ImageServer
Get the image for a given associated image name.- Specified by:
getAssociatedImage
in interfaceImageServer<BufferedImage>
- Overrides:
getAssociatedImage
in classAbstractImageServer<BufferedImage>
- Parameters:
name
-- Returns:
- See Also:
-
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:
-