Package qupath.imagej.images.servers
Class ImageJServer
java.lang.Object
qupath.lib.images.servers.AbstractImageServer<BufferedImage>
qupath.lib.images.servers.AbstractTileableImageServer
qupath.imagej.images.servers.ImageJServer
- All Implemented Interfaces:
AutoCloseable,ImageServer<BufferedImage>,PathObjectReader
ImageServer that uses ImageJ's image-reading capabilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected StringcreateID()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.Get a String representing the image metadata.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.Read a collection of objects from the source.readTile(TileRequest tile) Read a single image tile.Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServer
allowSmoothInterpolation, createDefaultRGBImage, 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
getPixelCalibration, readBufferedImage, readRegion, readRegion
-
Constructor Details
-
ImageJServer
Constructor.- Parameters:
uri- URI representing the local file or an ImageJ-compatible URLargs- optional arguments (not currently used)- Throws:
IOException
-
-
Method Details
-
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.
-
dumpMetadata
Get a String representing the image metadata.Currently, this reflects the contents of the ImageJ 'Show info' command, which is tied to the 'current' slice and therefore not complete for all slices of a multichannel/multidimensional image. This behavior may change in the future.
- Returns:
- a String representing image metadata in ImageJ's own form
-
getURIs
Description 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().- Specified by:
getURIsin interfaceImageServer<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:
-
readTile
Description copied from class:AbstractTileableImageServerRead a single image tile.- Specified by:
readTilein classAbstractTileableImageServer- Parameters:
tile-- Returns:
-
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>- Returns:
- See Also:
-
createServerBuilder
Description 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 classAbstractImageServer<BufferedImage>- Returns:
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractImageServer<BufferedImage>- Throws:
Exception
-