Class BioFormatsImageServer
java.lang.Object
qupath.lib.images.servers.AbstractImageServer<BufferedImage>
qupath.lib.images.servers.AbstractTileableImageServer
qupath.lib.images.servers.bioformats.BioFormatsImageServer
- All Implemented Interfaces:
AutoCloseable,ImageServer<BufferedImage>,PathObjectReader
QuPath ImageServer that uses the Bio-Formats library to read image data.
See http://www.openmicroscopy.org/site/products/bio-formats
See also https://docs.openmicroscopy.org/bio-formats/6.5.1/developers/matlab-dev.html#improving-reading-performance
-
Constructor Summary
ConstructorsConstructorDescriptionBioFormatsImageServer(URI uri, String... args) Create an ImageServer using the Bio-Formats library. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createID()Create a unique ID for the server, which can be returned as the default value ofAbstractImageServer.getPath().protected ImageServerBuilder.ServerBuilder<BufferedImage> Returns a builder capable of creating a server like this one.Retrieve a string representation of the metadata OME-XML.getAssociatedImage(String name) Get the image for a given associated image name.Get a list of 'associated images', e.g.getFile()Get the underlying file.Get the format String, as returned by Bio-FormatsIFormatReader.getFormat().Get the MetadataStore, as used by Bio-Formats.Get the original metadata read during creation of the server.intGet the series index, as used by Bio-Formats.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 tileRequest) Read a single image tile.voidsetMetadata(ImageServerMetadata metadata) Set the metadata to use, e.g.Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServer
allowSmoothInterpolation, createDefaultRGBImage, getDefaultColorModel, getEmptyTile, getEmptyTile, getTile, readRegionMethods inherited from class qupath.lib.images.servers.AbstractImageServer
getBuilder, getCache, getCachedTile, getChannel, getDefaultThumbnail, getDownsampleForResolution, getHeight, getImageClass, getMetadata, getPath, getPixelType, getPreferredDownsamples, getThumbnailDownsampleFactor, getTileRequestManager, getWidth, isEmptyRegion, isRGB, nChannels, nResolutions, nTimepoints, nZSlices, 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
-
BioFormatsImageServer
public BioFormatsImageServer(URI uri, String... args) throws FormatException, IOException, loci.common.services.DependencyException, loci.common.services.ServiceException, URISyntaxException Create an ImageServer using the Bio-Formats library.This requires an absolute URI, where an integer fragment can be used to define the series number.
- Parameters:
uri- for the image that should be opened; this might include a sub-image as a query or fragment.args- optional arguments- Throws:
FormatExceptionIOExceptionloci.common.services.DependencyExceptionloci.common.services.ServiceExceptionURISyntaxException
-
-
Method Details
-
getFormat
Get the format String, as returned by Bio-FormatsIFormatReader.getFormat().- Returns:
-
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:
-
setMetadata
Description copied from interface:ImageServerSet the metadata to use, e.g. to change the pixel size in microns.- Specified by:
setMetadatain interfaceImageServer<BufferedImage>- Overrides:
setMetadatain classAbstractImageServer<BufferedImage>- Parameters:
metadata-
-
createServerBuilder
Returns a builder capable of creating a server like this one.- Specified by:
createServerBuilderin classAbstractImageServer<BufferedImage>- Returns:
-
getSeries
public int getSeries()Get the series index, as used by Bio-Formats.- Returns:
-
readTile
Description copied from class:AbstractTileableImageServerRead a single image tile.- Specified by:
readTilein classAbstractTileableImageServer- Parameters:
tileRequest-- Returns:
- Throws:
IOException
-
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:
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractImageServer<BufferedImage>- Throws:
Exception
-
getMetadataStore
Get the MetadataStore, as used by Bio-Formats. This can be used to query metadata values not otherwise accessible.- Returns:
-
dumpMetadata
Retrieve a string representation of the metadata OME-XML.- Returns:
-
getAssociatedImageList
Description copied from interface:ImageServerGet a list of 'associated images', e.g. thumbnails or slide overview images.Each associated image is simply a T that does not warrant (or require) a full ImageServer, and most likely would never be analyzed.
- Specified by:
getAssociatedImageListin interfaceImageServer<BufferedImage>- Overrides:
getAssociatedImageListin classAbstractImageServer<BufferedImage>- Returns:
- See Also:
-
getAssociatedImage
Description copied from interface:ImageServerGet the image for a given associated image name.- Specified by:
getAssociatedImagein interfaceImageServer<BufferedImage>- Overrides:
getAssociatedImagein classAbstractImageServer<BufferedImage>- Parameters:
name-- Returns:
- See Also:
-
getFile
Get the underlying file.- 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:
-
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.
-