Interface DataProvider
- All Superinterfaces:
AutoCloseable, Closeable
- All Known Subinterfaces:
Datastore, RewritableDatastore
Read-only access to multi-dimensional image data.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Retrieve any image from this DataProvider.getAxes()Retrieve the axis currently in use by this DataProvider.intgetAxisLength(String axis) Deprecated.Returns the image at the given position.getImagesIgnoringAxes(Coords coords, String... ignoreTheseAxes) Returns a list of image in the DataProvider's collection that have identical coords after removing the given axes from both source and target.getImagesMatching(Coords coords) Deprecated.- instead use getImagesIgnoringAxesDeprecated.UsegetNextIndex(String axis)insteadgetName()A dataProvider has a name (not guaranteed to be unique).intgetNextIndex(String axis) Returns the highest index along the given axis plus 1.intProvides total number of images that can be accessed through this DataProvider.Returns Summary Metadata.booleanbooleanisFrozen()A dataProvider is frozen when no more images can be added.voidregisterForEvents(Object obj) void
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getAnyImage
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
-
getAxisLength
Deprecated.UsegetNextIndex(String)instead.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
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
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.- instead use getImagesIgnoringAxesReturns 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
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 collectionignoreTheseAxes- 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.UsegetNextIndex(String axis)insteadCoords 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
-
hasImage
-
getName
String getName()A dataProvider has a name (not guaranteed to be unique).- Returns:
- name of this dataProvider
-
registerForEvents
-
unregisterForEvents
-
getNextIndex(String)instead.