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, qupath.lib.images.servers.ImageServer<BufferedImage>, qupath.lib.objects.PathObjectReader

public class BioFormatsImageServer extends qupath.lib.images.servers.AbstractTileableImageServer implements qupath.lib.objects.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

    Constructors
    Constructor
    Description
    Create an ImageServer using the Bio-Formats library.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    protected qupath.lib.images.servers.ImageServerBuilder.ServerBuilder<BufferedImage>
    Returns a builder capable of creating a server like this one.
    Retrieve a string representation of the metadata OME-XML.
     
     
    Get the underlying file.
    Get the format String, as returned by Bio-Formats IFormatReader.getFormat().
    Get the MetadataStore, as used by Bio-Formats.
    qupath.lib.images.servers.ImageServerMetadata
     
    int
    Get the series index, as used by Bio-Formats.
     
     
    Collection<qupath.lib.objects.PathObject>
     
    readTile(qupath.lib.images.servers.TileRequest tileRequest)
     
    void
    setMetadata(qupath.lib.images.servers.ImageServerMetadata metadata)
     

    Methods inherited from class qupath.lib.images.servers.AbstractTileableImageServer

    allowSmoothInterpolation, createDefaultRGBImage, getDefaultColorModel, getEmptyTile, getEmptyTile, getTile, readRegion

    Methods 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, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods 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:
      FormatException
      IOException
      loci.common.services.DependencyException
      loci.common.services.ServiceException
      URISyntaxException
  • Method Details

    • getFormat

      public String getFormat()
      Get the format String, as returned by Bio-Formats IFormatReader.getFormat().
      Returns:
    • getURIs

      public Collection<URI> getURIs()
      Specified by:
      getURIs in interface qupath.lib.images.servers.ImageServer<BufferedImage>
    • createID

      public String createID()
      Specified by:
      createID in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • setMetadata

      public void setMetadata(qupath.lib.images.servers.ImageServerMetadata metadata)
      Specified by:
      setMetadata in interface qupath.lib.images.servers.ImageServer<BufferedImage>
      Overrides:
      setMetadata in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • createServerBuilder

      protected qupath.lib.images.servers.ImageServerBuilder.ServerBuilder<BufferedImage> createServerBuilder()
      Returns a builder capable of creating a server like this one.
      Specified by:
      createServerBuilder in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • getSeries

      public int getSeries()
      Get the series index, as used by Bio-Formats.
      Returns:
    • readTile

      public BufferedImage readTile(qupath.lib.images.servers.TileRequest tileRequest) throws IOException
      Specified by:
      readTile in class qupath.lib.images.servers.AbstractTileableImageServer
      Throws:
      IOException
    • getServerType

      public String getServerType()
      Specified by:
      getServerType in interface qupath.lib.images.servers.ImageServer<BufferedImage>
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
      Throws:
      Exception
    • getMetadataStore

      public OMEPyramidStore getMetadataStore()
      Get the MetadataStore, as used by Bio-Formats. This can be used to query metadata values not otherwise accessible.
      Returns:
    • dumpMetadata

      public String dumpMetadata()
      Retrieve a string representation of the metadata OME-XML.
      Returns:
    • getAssociatedImageList

      public List<String> getAssociatedImageList()
      Specified by:
      getAssociatedImageList in interface qupath.lib.images.servers.ImageServer<BufferedImage>
      Overrides:
      getAssociatedImageList in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • getAssociatedImage

      public BufferedImage getAssociatedImage(String name)
      Specified by:
      getAssociatedImage in interface qupath.lib.images.servers.ImageServer<BufferedImage>
      Overrides:
      getAssociatedImage in class qupath.lib.images.servers.AbstractImageServer<BufferedImage>
    • getFile

      public File getFile()
      Get the underlying file.
      Returns:
    • getOriginalMetadata

      public qupath.lib.images.servers.ImageServerMetadata getOriginalMetadata()
      Specified by:
      getOriginalMetadata in interface qupath.lib.images.servers.ImageServer<BufferedImage>
    • readPathObjects

      public Collection<qupath.lib.objects.PathObject> readPathObjects()
      Specified by:
      readPathObjects in interface qupath.lib.objects.PathObjectReader