Class ImageServerBuilder.UriImageSupport<T>

java.lang.Object
qupath.lib.images.servers.ImageServerBuilder.UriImageSupport<T>
Type Parameters:
T -
Enclosing interface:
ImageServerBuilder<T>

public static class ImageServerBuilder.UriImageSupport<T> extends Object
Helper class to summarize which ImageServers can be build by a particular ImageServerBuilder for a given URI, and a level of confidence. This may be used to select which ImageServerBuilder is used to open the image(s).
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createInstance

      public static <T> ImageServerBuilder.UriImageSupport<T> createInstance(Class<? extends ImageServerBuilder<T>> providerClass, float supportLevel, Collection<ImageServerBuilder.ServerBuilder<T>> builders)
      Create a ImageServerBuilder.UriImageSupport for (possibly multiple) images that can be read from a single URI.
      Type Parameters:
      T -
      Parameters:
      providerClass -
      supportLevel -
      builders -
      Returns:
    • createInstance

      public static <T> ImageServerBuilder.UriImageSupport<T> createInstance(Class<? extends ImageServerBuilder<T>> providerClass, float supportLevel, ImageServerBuilder.ServerBuilder<T> builder)
      Create a ImageServerBuilder.UriImageSupport for a single image that can be read from a single URI.
      Type Parameters:
      T -
      Parameters:
      providerClass -
      supportLevel -
      builder -
      Returns:
    • getProviderClass

      public Class<? extends ImageServerBuilder<T>> getProviderClass()
      Get the class of the associated ImageServerBuilder.
      Returns:
    • getBuilders

      public List<ImageServerBuilder.ServerBuilder<T>> getBuilders()
      Get a list of ServerBuilders, one for each image that can be read based on the specified URI. For a 'simple' file that contains a single image, a singleton list should be returned.
      Returns:
    • getSupportLevel

      public float getSupportLevel()
      Estimated 'support level' for a given file path, where support level is a summary of the likelihood that pixel values and metadata will be returned correctly and in a way that achieves good performance.

      The support level should be a value between 0 and 4. The following is a guide to its interpretation:

      • 4 - 'ideal' support, e.g. the image was written by the library behind the ImageServer
      • 3 - good support
      • 2 - unknown support, i.e. worth a try
      • 1 - partial/poor support, i.e. there are known limitations and all higher-scoring possibilities should be tried first
      • 0 - no support
      The use of floating point enables subclasses to make more subtle evaluations of performance, e.g. if an ImageServer is particularly strong for RGB images, but falls short of guaranteeing ideal performance.

      In practice, this is used to rank potential builders so that the 'best' ones are tried first for new image paths, and those with 0 support may be ignored.

      Returns: