Interface DataProvider

All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
Datastore, RewritableDatastore

public interface DataProvider extends Closeable
Read-only access to multi-dimensional image data.
  • Method Details

    • close

      void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getAnyImage

      Image getAnyImage() throws IOException
      Retrieve any image from this DataProvider.
      Returns:
      a random image from the collection kept by the DataProvider
      Throws:
      IOException - when error occurs loading the data from storage
    • getAxes

      List<String> getAxes()
      Retrieve the axis currently in use by this DataProvider.
      Returns:
      List with Axis being used in no particular order
    • getAxisLength

      @Deprecated int getAxisLength(String axis)
      Deprecated.
      Returns the highest index plus 1 along the given axis. If the axis is not (yet) represented in the data set, it will return 0.

      If the axis is present in the data set, but no Coords with that axes are found (Coords for an axis can not be zero), it will return 1.

      Missing images for any given axis are ignored, e.g. if the DataProvider has images 0, 1, 3, 4 for a given axis, it will return 5. Do not expect all images along a given axis to be present in the DataProvider.

      Parameters:
      axis - Axis for which the next index is requested.
      Returns:
      Next Index for the given axis.
    • getNextIndex

      int getNextIndex(String axis)
      Returns the highest index along the given axis plus 1. If the axis is not (yet) represented in the data set, it will return 0.

      If the axis is present in the data set, but no Coords with that axes are found (Coords for an axis can not be zero), it will return 1.

      Missing images for any given axis are ignored, e.g. if the DataProvider has images 0, 1, 3, 4 for a given axis, it will return 5. Do not expect all images along a given axis to be present in the DataProvider.

      Parameters:
      axis - Axis for which the next index is requested.
      Returns:
      Next Index for the given axis.
    • getImage

      Image getImage(Coords coords) throws IOException
      Returns the image at the given position.
      Parameters:
      coords - Coords specifying the multi-dimensional index to the image
      Returns:
      desired Image
      Throws:
      IOException - when error occurs loading the data from storage
    • getImagesMatching

      @Deprecated List<Image> getImagesMatching(Coords coords) throws IOException
      Deprecated.
      - instead use getImagesIgnoringAxes
      Returns a list of images that have coords matching the given one.
      Parameters:
      coords - specification of multi-dimensional index that needs to be present in the Coords of the images that will be returned
      Returns:
      Matching Images
      Throws:
      IOException - when error occurs loading the data from storage
    • getImagesIgnoringAxes

      List<Image> getImagesIgnoringAxes(Coords coords, String... ignoreTheseAxes) throws IOException
      Returns a list of image in the DataProvider's collection that have identical coords after removing the given axes from both source and target.
      Parameters:
      coords - Coords to look for in the provider's collection
      ignoreTheseAxes - Axes that will be removed from copy of Coords in the collection before checking for identity
      Returns:
      images in the dataProvider's collection with the desired Coords
      Throws:
      IOException - when error occurs loading the data from storage
    • isFrozen

      boolean isFrozen()
      A dataProvider is frozen when no more images can be added.
      Returns:
      True if no more images can be added
    • getMaxIndices

      @Deprecated Coords getMaxIndices()
      Deprecated.
      Coords with highest possible index along each axis.
      Returns:
      Coords with highest possible index along each axis
    • getNumImages

      int getNumImages()
      Provides total number of images that can be accessed through this DataProvider. TODO: does this include blank images/empty Coords?
      Returns:
      total number of images that can be accessed through this DataProvider
    • getSummaryMetadata

      SummaryMetadata getSummaryMetadata()
      Returns Summary Metadata.
      Returns:
      summarymetadata of this dataProvides
    • getUnorderedImageCoords

      Iterable<Coords> getUnorderedImageCoords()
    • hasImage

      boolean hasImage(Coords coords)
    • getName

      String getName()
      A dataProvider has a name (not guaranteed to be unique).
      Returns:
      name of this dataProvider
    • registerForEvents

      void registerForEvents(Object obj)
    • unregisterForEvents

      void unregisterForEvents(Object obj)