Class PixelClassificationImageServer
- All Implemented Interfaces:
- AutoCloseable,- ImageServer<BufferedImage>
- 
Constructor SummaryConstructorsConstructorDescriptionPixelClassificationImageServer(ImageData<BufferedImage> imageData, PixelClassifier classifier) Constructor.PixelClassificationImageServer(ImageData<BufferedImage> imageData, PixelClassifier classifier, String customID, ColorModel colorModel) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected StringcreateID()Returns a random UUID.protected ImageServerBuilder.ServerBuilder<BufferedImage> Returns null (does not support ServerBuilders).getCachedTile(TileRequest tile) Get a cached tile, or null if the tile has not been cached.Get the PixelClassifier performing the classification.protected ColorModelGet an appropriate colormodel that may be used.Get the underlying ImageData used for classification.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.voidRead all the tiles.protected BufferedImagereadTile(TileRequest tileRequest) Read a single image tile.voidsetMetadata(ImageServerMetadata metadata) Not allowed - throws anUnsupportedOperationException.Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServerallowSmoothInterpolation, createDefaultRGBImage, getEmptyTile, getEmptyTile, getTile, readRegionMethods inherited from class qupath.lib.images.servers.AbstractImageServerclose, getAssociatedImage, getAssociatedImageList, getBuilder, getCache, getChannel, getDefaultThumbnail, getDownsampleForResolution, getHeight, getImageClass, getMetadata, getPath, getPixelType, getPreferredDownsamples, getThumbnailDownsampleFactor, getTileRequestManager, getWidth, isEmptyRegion, isRGB, nChannels, nResolutions, nTimepoints, nZSlices, 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
- 
Constructor Details- 
PixelClassificationImageServerpublic PixelClassificationImageServer(ImageData<BufferedImage> imageData, PixelClassifier classifier) Constructor.An ImageDatais required because some forms of classification may required additional image properties (e.g. image type, stains), not simply anImageServer.- Parameters:
- imageData-
- classifier-
 
- 
PixelClassificationImageServerpublic PixelClassificationImageServer(ImageData<BufferedImage> imageData, PixelClassifier classifier, String customID, ColorModel colorModel) Constructor.- Parameters:
- imageData-
- classifier-
- customID- optionally provide a custom ID (path). This is when the default (based upon the- ImageDataand- PixelClassifierisn't sufficient), e.g. because the classifier can change output based upon- ImageDatastatus.
- colorModel- optional colormodel
 
 
- 
- 
Method Details- 
readAllTilespublic void readAllTiles()Read all the tiles. This is useful for a classifier that can be applied in full to an image without causing memory issues (e.g. a density map), particularly if it is is dependent upon a changing property of the image (e.g. its object hierarchy). After calling this method, tiles will be returned from an internal cache rather than being computed anew.
- 
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:
- Throws:
- IOException
 
- 
createIDReturns a random UUID.- Specified by:
- createIDin class- AbstractImageServer<BufferedImage>
- 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:
 
- 
getImageDataGet the underlying ImageData used for classification.- Returns:
 
- 
getClassifierGet the PixelClassifier performing the classification.- 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:
 
- 
setMetadataNot allowed - throws anUnsupportedOperationException.- Specified by:
- setMetadatain interface- ImageServer<BufferedImage>
- Overrides:
- setMetadatain class- AbstractImageServer<BufferedImage>
- Parameters:
- metadata-
- Throws:
- UnsupportedOperationException
 
- 
getCachedTileDescription copied from class:AbstractImageServerGet a cached tile, or null if the tile has not been cached.This is useful whenever it is important to return quickly rather than wait for a tile to be fetched or generated. Warning! The cached tile is returned directly (with no defensive copying) for performance. This means that it must not be modified by the code that requests it. If there is any chance the tile may be modified (or passed to untrusted code), then make sure to make a defensive copy, e.g. using BufferedImageTools.duplicate(java.awt.image.BufferedImage)if using a buffered image.- Specified by:
- getCachedTilein interface- ImageServer<BufferedImage>
- Overrides:
- getCachedTilein class- AbstractImageServer<BufferedImage>
- Parameters:
- tile-
- Returns:
- the tile if it has been cached, or null if no cached tile is available for the request.
 
- 
readTileDescription copied from class:AbstractTileableImageServerRead a single image tile.- Specified by:
- readTilein class- AbstractTileableImageServer
- Parameters:
- tileRequest-
- Returns:
- Throws:
- IOException
 
- 
createServerBuilderReturns null (does not support ServerBuilders).- Specified by:
- createServerBuilderin class- AbstractImageServer<BufferedImage>
- Returns:
 
 
-