Interface ProjectImageEntry<T>

Type Parameters:
T - Depends upon the project used; typically BufferedImage for QuPath
All Superinterfaces:
UriResource

public interface ProjectImageEntry<T> extends UriResource
Class to represent an image entry within a project.

This stores the path to the image, and some optional metadata.

Author:
Pete Bankhead
  • Method Details

    • getID

      String getID()
      Get a unique ID to represent this entry.
      Returns:
    • setImageName

      void setImageName(String name)
      Set the image name for this project entry.
      Parameters:
      name -
    • getImageName

      String getImageName()
      Get a name that may be used for this entry.

      This may be derived automatically from the server path, or set explicitly to be something else. It may also be randomized to support blinded analysis.

      Returns:
      See Also:
    • getOriginalImageName

      String getOriginalImageName()
      Get the original image name, without any randomization. Most UI elements should prefer getImageName() to ensure that the randomization does its job.
      Returns:
    • getEntryPath

      Path getEntryPath()
      Get a path to the data for this image entry, or null if this entry is not stored on the local file system.

      If not null, the path may be a file or a directory and is not guaranteed to exist. Rather, it represents where the data for this entry either is or would be stored.

      Returns:
    • removeMetadataValue

      String removeMetadataValue(String key)
      Remove a metadata value.
      Parameters:
      key -
      Returns:
    • getMetadataValue

      String getMetadataValue(String key)
      Request a metadata value.

      Note that this may return null.

      Parameters:
      key -
      Returns:
    • putMetadataValue

      String putMetadataValue(String key, String value)
      Store a metadata value.

      This is intended as storage of short key-value pairs. Extended text should be stored under setDescription.

      Parameters:
      key -
      value -
      Returns:
    • containsMetadata

      boolean containsMetadata(String key)
      Check if a metadata value is present for a specified key.
      Parameters:
      key -
      Returns:
      true if getDescription() does not return null or an empty string, false otherwise.
    • getDescription

      String getDescription()
      Get a description; this is free text describing the image.
      Returns:
    • setDescription

      void setDescription(String description)
      Set the description.
      Parameters:
      description -
      See Also:
    • clearMetadata

      void clearMetadata()
      Remove all metadata.
    • getMetadataMap

      Map<String,String> getMetadataMap()
      Get an unmodifiable view of the underlying metadata map.
      Returns:
    • getMetadataKeys

      Collection<String> getMetadataKeys()
      Get an unmodifiable collection of the metadata map's keys.
      Returns:
    • getServerBuilder

      ImageServerBuilder.ServerBuilder<T> getServerBuilder()
      Get a ImageServerBuilder.ServerBuilder that can be used to open this image.
      Returns:
    • readImageData

      ImageData<T> readImageData() throws IOException
      Read the ImageData associated with this entry, or create a new ImageData if none is currently present.

      If the full data is not needed, but rather only the objects readHierarchy() can be much faster.

      Returns:
      Throws:
      IOException
      See Also:
    • saveImageData

      void saveImageData(ImageData<T> imageData) throws IOException
      Save the ImageData for this entry using the default storage location for the project.
      Parameters:
      imageData -
      Throws:
      IOException
    • readHierarchy

      PathObjectHierarchy readHierarchy() throws IOException
      Read the PathObjectHierarchy for this entry, or return an empty hierarchy if none is available.
      Returns:
      Throws:
      IOException
      See Also:
    • hasImageData

      boolean hasImageData()
      Check if this entry has saved ImageData already available.
      Returns:
    • getSummary

      String getSummary()
      Get a summary string representing this image entry.
      Returns:
    • getThumbnail

      T getThumbnail() throws IOException
      Request a thumbnail for the image.
      Returns:
      a thumbnail if one has already been set, otherwise null.
      Throws:
      IOException
    • setThumbnail

      void setThumbnail(T img) throws IOException
      Set a thumbnail for the image. This will replace any existing thumbnail.
      Parameters:
      img -
      Throws:
      IOException
    • getServerURIs

      @Deprecated default Collection<URI> getServerURIs() throws IOException
      Deprecated.
      Get a collection of the URIs required by this project's ImageServer.

      The purpose of this is to help query if they can be found. They might not be e.g. if the images have been moved.

      Returns:
      Throws:
      IOException
    • updateServerURIs

      @Deprecated default boolean updateServerURIs(Map<URI,URI> replacements) throws IOException
      Deprecated.
      Update the URIs for the server (optional operation).
      Parameters:
      replacements - a map with current URIs as keys, and desired URIs as values.
      Returns:
      true if changes were made
      Throws:
      IOException
    • getMetadataSummaryString

      default String getMetadataSummaryString()
      Get a formatted string representation of the metadata map's contents.
      Returns:
    • getImages

      Access additional images associated with the project entry, e.g. pixel classifications or aligned slides.
      Returns: