Interface ProjectImageEntry<T>

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

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

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

  • 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

      @Deprecated default String removeMetadataValue(String key)
      Deprecated.
      v0.6.0, use MinimalMetadataStore.getMetadata() instead to directly access the metadata.
      Remove a metadata value.
      Parameters:
      key -
      Returns:
    • getMetadataValue

      @Deprecated default String getMetadataValue(String key)
      Deprecated.
      v0.6.0, use MinimalMetadataStore.getMetadata() instead to directly access the metadata.
      Request a metadata value.

      Note that this may return null.

      Parameters:
      key -
      Returns:
    • putMetadataValue

      @Deprecated default String putMetadataValue(String key, String value)
      Deprecated.
      v0.6.0, use MinimalMetadataStore.getMetadata() instead to directly access the metadata.
      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

      @Deprecated default boolean containsMetadata(String key)
      Deprecated.
      v0.6.0, use MinimalMetadataStore.getMetadata() instead to directly access the metadata.
      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

      @Deprecated default void clearMetadata()
      Deprecated.
      v0.6.0, use MinimalMetadataStore.getMetadata() instead to directly access the metadata.
      Remove all metadata.
    • getMetadataMap

      @Deprecated default Map<String,String> getMetadataMap()
      Deprecated.
      v0.6.0, use MinimalMetadataStore.getMetadata() instead to directly access the metadata.
      Get an unmodifiable view of the underlying metadata map.
      Returns:
    • getMetadataKeys

      @Deprecated default Collection<String> getMetadataKeys()
      Deprecated.
      v0.6.0, use MinimalMetadataStore.getMetadata() instead to directly access the metadata.
      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
    • 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:
    • getTags

      Set<String> getTags()
      Returns a modifiable set containing tag values.

      The returned set may or may not be thread-safe. Implementing classes must document the thread-safeness of the set.

      Returns:
      the set of tags of this entry