Package qupath.lib.gui.images.servers
Class RenderedImageServer
java.lang.Object
qupath.lib.images.servers.AbstractImageServer<BufferedImage>
qupath.lib.images.servers.AbstractTileableImageServer
qupath.lib.gui.images.servers.RenderedImageServer
- All Implemented Interfaces:
AutoCloseable,qupath.lib.images.servers.GeneratingImageServer<BufferedImage>,qupath.lib.images.servers.ImageServer<BufferedImage>
public class RenderedImageServer
extends qupath.lib.images.servers.AbstractTileableImageServer
implements qupath.lib.images.servers.GeneratingImageServer<BufferedImage>
An ImageServer that can display a rendered image, with optional overlays.
This is intended for use when exporting 'flattened' RGB images.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder to create an ImageServer to display rendered images, with optional overlay layers. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected BufferedImagecreateDefaultRGBImage(int width, int height) protected StringcreateID()static qupath.lib.images.servers.ImageServer<BufferedImage> createRenderedServer(QuPathViewer viewer) Create anImageServerthat returns tiles based on how approximately they would appear within the viewer.static qupath.lib.images.servers.ImageServer<BufferedImage> createRenderedServer(qupath.lib.images.servers.ImageServer<BufferedImage> server, ImageRenderer renderer) Create anImageServerthat converts the image to RGB using the specifiedImageRenderer.protected qupath.lib.images.servers.ImageServerBuilder.ServerBuilder<BufferedImage> qupath.lib.images.servers.ImageServerMetadatagetURIs()protected booleanhasAlpha()protected BufferedImagereadTile(qupath.lib.images.servers.TileRequest tileRequest) Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServer
allowSmoothInterpolation, getDefaultColorModel, getEmptyTile, getEmptyTile, getTile, readRegionMethods inherited from class qupath.lib.images.servers.AbstractImageServer
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
getAssociatedImage, getAssociatedImageList, getBuilder, getCachedTile, getChannel, getDefaultThumbnail, getDownsampleForResolution, getHeight, getImageClass, getMetadata, getPath, getPixelCalibration, getPixelType, getPreferredDownsamples, getTileRequestManager, getWidth, isEmptyRegion, isRGB, nChannels, nResolutions, nTimepoints, nZSlices, readBufferedImage, readRegion, readRegion, readRegion, setMetadata
-
Method Details
-
createRenderedServer
public static qupath.lib.images.servers.ImageServer<BufferedImage> createRenderedServer(QuPathViewer viewer) throws IOException Create anImageServerthat returns tiles based on how approximately they would appear within the viewer. Note that- the server uses fixed downsample values, while the viewer can adapt annotation line thickness continuously - therefore the agreement is not exact
- changing display settings in the viewer may impact how later tiles are rendered
- the server cannot be serialized to JSON
- Parameters:
viewer-- Returns:
- Throws:
IOException- See Also:
-
createRenderedServer
public static qupath.lib.images.servers.ImageServer<BufferedImage> createRenderedServer(qupath.lib.images.servers.ImageServer<BufferedImage> server, ImageRenderer renderer) throws IOException Create anImageServerthat converts the image to RGB using the specifiedImageRenderer.- Parameters:
server-renderer-- Returns:
- Throws:
IOException
-
getURIs
- Specified by:
getURIsin interfacequpath.lib.images.servers.ImageServer<BufferedImage>
-
getServerType
- Specified by:
getServerTypein interfacequpath.lib.images.servers.ImageServer<BufferedImage>
-
getOriginalMetadata
public qupath.lib.images.servers.ImageServerMetadata getOriginalMetadata()- Specified by:
getOriginalMetadatain interfacequpath.lib.images.servers.ImageServer<BufferedImage>
-
readTile
protected BufferedImage readTile(qupath.lib.images.servers.TileRequest tileRequest) throws IOException - Specified by:
readTilein classqupath.lib.images.servers.AbstractTileableImageServer- Throws:
IOException
-
hasAlpha
protected boolean hasAlpha() -
createDefaultRGBImage
- Overrides:
createDefaultRGBImagein classqupath.lib.images.servers.AbstractTileableImageServer
-
createServerBuilder
protected qupath.lib.images.servers.ImageServerBuilder.ServerBuilder<BufferedImage> createServerBuilder()- Specified by:
createServerBuilderin classqupath.lib.images.servers.AbstractImageServer<BufferedImage>
-
createID
- Specified by:
createIDin classqupath.lib.images.servers.AbstractImageServer<BufferedImage>
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classqupath.lib.images.servers.AbstractImageServer<BufferedImage>- Throws:
Exception
-