public interface Storage
Note that the Storage interface does not expose any "setter" methods (e.g. putImage(), setSummaryMetadata(), etc.). It is expected that any read/write Storage listen for the relevant events published by the Datastore instead.
Modifier and Type | Method and Description |
---|---|
void |
close()
Release any resources used by the Storage, for example open file
descriptors.
|
void |
freeze()
Freeze the Storage, preventing any changes to its contents.
|
Image |
getAnyImage()
Return any Image, or null if there are no images.
|
java.util.List<java.lang.String> |
getAxes()
Return a List of all axis names for Images we know about.
|
Image |
getImage(Coords coords)
Retrieve the Image located at the specified coordinates.
|
java.util.List<Image> |
getImagesIgnoringAxes(Coords coords,
java.lang.String... ignoreTheseAxes)
Retrieve a list of images with Coords identical to the given Coords instance,
except for the axes listed in the exception list.
|
java.util.List<Image> |
getImagesMatching(Coords coords)
Retrieve a list of all images whose Coords match the given incomplete
Coords instance.
|
int |
getMaxIndex(java.lang.String axis)
Return the largest stored position along the specified axis.
|
Coords |
getMaxIndices()
Return a Coords that provides the maximum index along all available axes.
|
int |
getNumImages()
Return the number of images in this dataset.
|
SummaryMetadata |
getSummaryMetadata()
Retrieve the SummaryMetadata associated with this dataset.
|
java.lang.Iterable<Coords> |
getUnorderedImageCoords()
Return an Iterable that provides access to all image coordinates in the
Storage, in arbitrary order.
|
boolean |
hasImage(Coords coords)
Returns whether or not an image exists at the specified coordinates.
|
void |
putImage(Image image)
Insert an Image into the Storage, so that it may be returned by later
getImage() calls.
|
void freeze() throws java.io.IOException
java.io.IOException
void putImage(Image image) throws java.io.IOException
image
- Image to be inserted.java.io.IOException
Image getImage(Coords coords) throws java.io.IOException
coords
- Coordinates specifying which image to retrievejava.io.IOException
boolean hasImage(Coords coords)
coords
- Coordinates to testImage getAnyImage()
java.lang.Iterable<Coords> getUnorderedImageCoords()
java.util.List<Image> getImagesMatching(Coords coords) throws java.io.IOException
<"z" = 9>
would return all Images whose position along the "z" axis is 9 (note that
this means that Images with no defined position along that axis will
not be returned). The result may be empty.coords
- Coordinates specifying images to matchjava.io.IOException
java.util.List<Image> getImagesIgnoringAxes(Coords coords, java.lang.String... ignoreTheseAxes) throws java.io.IOException
t=1,z=3>
and axes "c", the following
Coords would match: <t=1, z=3>
, <t=1, z=3, c=1>
, <t=1, z=3, c=2>
.coords
- coord looking for matching imagesignoreTheseAxes
- Axes to be ignored in the images collection when
looking for matchesjava.io.IOException
- happens with disk based storageint getMaxIndex(java.lang.String axis)
axis
- axis of interestjava.util.List<java.lang.String> getAxes()
Coords getMaxIndices()
SummaryMetadata getSummaryMetadata()
int getNumImages()
void close() throws java.io.IOException
java.io.IOException