Package qupath.lib.images.servers
Class SparseImageServer
java.lang.Object
qupath.lib.images.servers.AbstractImageServer<BufferedImage>
qupath.lib.images.servers.AbstractTileableImageServer
qupath.lib.images.servers.SparseImageServer
- All Implemented Interfaces:
- AutoCloseable,- ImageServer<BufferedImage>
An ImageServer that combines regions from multiple separate ImageServers, 
 repositioning these as necessary to generate one larger field of view.
 
Regions are currently defined within a JSON file passed as the 'path' argument, and this also contains the full paths to the other ImageServers.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder to create a newSparseImageServer.static classHelper class for SparseImageServers, capable of returning the appropriate ImageServer for different ImageRegions and different resolutions.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()protected StringcreateID()Returns a UUID.protected ImageServerBuilder.ServerBuilder<BufferedImage> Create a ServerBuilder, which can be used to construct an identical ImageServer.protected ColorModelGet an appropriate colormodel that may be used.Get the manager, which defines from whence the regions originate.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.static List<SparseImageServer> splitConnectedRegions(SparseImageServer server, double distancePixels, boolean permitBoundsOverlap) Split aSparseImageServerinto multiple servers, whereby each split server represents one connected region.Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServerallowSmoothInterpolation, createDefaultRGBImage, getEmptyTile, getEmptyTile, getTile, readRegionMethods inherited from class qupath.lib.images.servers.AbstractImageServergetAssociatedImage, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface qupath.lib.images.servers.ImageServergetPixelCalibration, readBufferedImage, readRegion, readRegion
- 
Method Details- 
getDefaultColorModelDescription copied from class:AbstractTileableImageServerGet an appropriate colormodel that may be used. The default implementation uses the default RGB color model for RGB images, or else requests a low-resolution thumbnail to extract the color model from it. If neither implementation is sufficient, subclasses should override this method.- Overrides:
- getDefaultColorModelin class- AbstractTileableImageServer
- Returns:
 
- 
getURIsDescription 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:
 
- 
createIDReturns a UUID.- Specified by:
- createIDin class- AbstractImageServer<BufferedImage>
- Returns:
 
- 
getManagerGet the manager, which defines from whence the regions originate.- Returns:
 
- 
getServerTypeDescription copied from interface:ImageServerA string describing the type of server, for example the name of the library used (Openslide, Bioformats...)- Returns:
 
- 
getOriginalMetadataDescription copied from interface:ImageServerGet the original metadata read during creation of the server. This may or may not be correct.- Returns:
- See Also:
 
- 
createServerBuilderDescription copied from class:AbstractImageServerCreate 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:
- createServerBuilderin class- AbstractImageServer<BufferedImage>
- Returns:
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Overrides:
- closein class- AbstractImageServer<BufferedImage>
- Throws:
- Exception
 
- 
readTileDescription copied from class:AbstractTileableImageServerRead a single image tile.- Specified by:
- readTilein class- AbstractTileableImageServer
- Parameters:
- tileRequest-
- Returns:
- Throws:
- IOException
 
- 
splitConnectedRegionspublic static List<SparseImageServer> splitConnectedRegions(SparseImageServer server, double distancePixels, boolean permitBoundsOverlap) throws IOException Split aSparseImageServerinto multiple servers, whereby each split server represents one connected region. This can be useful whenever a sparse server contains (for example) multiple pieces of tissue with a substantial gap between them, because it allows each piece to be treated as a separate image.- Parameters:
- server- the sparse server to be split
- distancePixels- the maximum separation between regions for them to be considered part of the same server after splitting. Must be a positive value or zero; suggested default is 1.
- permitBoundsOverlap- if true, the bounding boxes for each server may overlap. If unsure, it is strongly advised to use 'false', since otherwise part of a returned server may be 'empty' because the corresponding region was assigned to another server, creating the misleading impression there was nothing there.
- Returns:
- Throws:
- IOException
 
 
-