Class ChannelDisplayTransformServer
- All Implemented Interfaces:
AutoCloseable,ImageServer<BufferedImage>,PathObjectReader
Note: This class may move or be removed in a later version.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ImageServer<BufferedImage> createColorTransformServer(ImageServer<BufferedImage> server, List<ChannelDisplayInfo> channels) Create anImageServerfor which the channels are created dynamically from a list of ChannelDisplayInfos.protected StringcreateID()Create a unique ID for the server, which can be returned as the default value ofAbstractImageServer.getPath().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...)Read a collection of objects from the source.readRegion(RegionRequest request) Read a 2D(+C) image region for a specifiedRegionRequest.Methods inherited from class qupath.lib.images.servers.TransformingImageServer
getURIs, getWrappedServerMethods 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
-
Method Details
-
createColorTransformServer
public static ImageServer<BufferedImage> createColorTransformServer(ImageServer<BufferedImage> server, List<ChannelDisplayInfo> channels) Create anImageServerfor which the channels are created dynamically from a list of ChannelDisplayInfos.- Parameters:
server- the server providing the underlying datachannels-ChannelDisplayInfoobjects defining how the pixels from the wrapped server should be converted to channels in the new server- Returns:
-
createServerBuilder
Returns null (does not support ServerBuilders).- Specified by:
createServerBuilderin classAbstractImageServer<BufferedImage>- Returns:
-
createID
Description copied from class:AbstractImageServerCreate 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:
createIDin classAbstractImageServer<BufferedImage>- Returns:
-
readRegion
Description copied from interface:ImageServerRead a 2D(+C) image region for a specifiedRegionRequest. Coordinates and bounding box dimensions from the request are in pixel units, at the full image resolution (i.e. when downsample = 1).All channels are always returned.
No specific checking is guaranteed to ensure that the request is valid, e.g. if it extends beyond the image boundary then it is likely (but not certain) that the returned image will be cropped accordingly - but some implementations may contain empty padding instead. Therefore it is up to the caller to ensure that the requests are within range.
However, it is expected that any returnable region will be at least 1x1 pixel in size, even if via high downsampling one might otherwise expect a 0x0 image. This is consistent with the idea of pixels representing point samples rather than little squares.
Note: One should avoid returning null, as this cannot be stored as a value in some map implementations that may be used for caching.
- Specified by:
readRegionin interfaceImageServer<BufferedImage>- Overrides:
readRegionin classTransformingImageServer<BufferedImage>- Parameters:
request- the region for which pixels are requested- Returns:
- pixels for the region being requested
- Throws:
IOException- See Also:
-
getServerType
Description copied from interface:ImageServerA string describing the type of server, for example the name of the library used (Openslide, Bioformats...)- Specified by:
getServerTypein interfaceImageServer<BufferedImage>- Returns:
-
getOriginalMetadata
Description copied from interface:ImageServerGet the original metadata read during creation of the server. This may or may not be correct.- Specified by:
getOriginalMetadatain interfaceImageServer<BufferedImage>- Overrides:
getOriginalMetadatain classTransformingImageServer<BufferedImage>- Returns:
- See Also:
-
readPathObjects
Description copied from interface:PathObjectReaderRead a collection of objects from the source.- Specified by:
readPathObjectsin interfacePathObjectReader- Returns:
- a collection of objects, or empty list if no objects are available.
- Throws:
IOException
-