Interface RewritableDatastore
- All Superinterfaces:
AutoCloseable, Closeable, DataProvider, Datastore
RewritableDatastores are Datastores that allow images and SummaryMetadata
to be deleted or overwritten after they have been inserted. They also
publish additional events when those actions are performed. You can create
an RewritableDatastore using the DataManager. Note that not all types of
Datastores support rewriting (e.g. file-based Datastores).
-
Nested Class Summary
Nested classes/interfaces inherited from interface Datastore
Datastore.SaveMode -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete all images from the Datastore.voiddeleteImage(Coords coords) Delete an image from the Datastore.voiddeleteImagesMatching(Coords coords) Delete all images from the Datastore whose coordinates match the provided Coords object, which may be underspecified.voidInsert an image into the Datastore.voidsetSummaryMetadata(SummaryMetadata metadata) Set the SummaryMetadata.Methods inherited from interface DataProvider
close, getAnyImage, getAxes, getAxisLength, getImage, getImagesIgnoringAxes, getImagesMatching, getMaxIndices, getName, getNextIndex, getNumImages, getSummaryMetadata, getUnorderedImageCoords, hasImage, isFrozen, registerForEvents, unregisterForEventsMethods inherited from interface Datastore
freeze, getAnnotation, getSavePath, hasAnnotation, save, save, save, save, setName, setSavePath, setStorage
-
Method Details
-
putImage
Insert an image into the Datastore. Posts a NewImageEvent to the event bus. Unlike the base Datastore method, this method will allow images to be overwritten (i.e. will not cause a DatastoreRewriteException), if an image with the same coordinates is already in the Datastore. An ImageOverwrittenEvent will be published on the Datastore's EventBus if this occurs. This method will also update the axisOrder property of the Datastore's SummaryMetadata, if appropriate.- Specified by:
putImagein interfaceDatastore- Parameters:
image- Micro-Manager Image object- Throws:
DatastoreFrozenException- if the freeze() method has been called.IllegalArgumentException- if the image's axes do not match the axes of images previously added to the Datastore. All images in a Datastore are required to have the same set of axes in their Coords objects.IOException- if an IO error occurs
-
setSummaryMetadata
Set the SummaryMetadata. Posts a NewSummaryMetadataEvent to the event bus. Unlike with standard Datastores, this method may be called multiple times.- Specified by:
setSummaryMetadatain interfaceDatastore- Parameters:
metadata- Object representing the summary metadata- Throws:
DatastoreFrozenException- if the freeze() method has been called.IOException- if an IO error occurs
-
deleteImage
Delete an image from the Datastore. Posts an ImageDeletedEvent to the event bus. Throws an IllegalArgumentException if the provided coordinates do not correspond to any image in the Datastore.- Parameters:
coords- Coordinates of the image to remove.- Throws:
IOException- if an IO error occurred.IllegalArgumentException- if the coords do not match any image.
-
deleteImagesMatching
Delete all images from the Datastore whose coordinates match the provided Coords object, which may be underspecified. All images whose coordinate positions match all positions in the Coords will be deleted (with a corresponding ImageDeletedEvent posted on the Datastore's event bus). For example, calling this method with a Coords of<"z" = 9>would delete all Images whose Z coordinate is 9. Calling this method with an empty Coords object will delete every image in the Datastore, as per deleteAllImages() except without posting a DatastoreClearedEvent. This method may potentially remove no images.- Parameters:
coords- Potentially-underspecified coordinates of the image(s) to remove.- Throws:
IOException- if an IO error occurred.
-
deleteAllImages
Delete all images from the Datastore. An ImageDeletedEvent will be published on the Datastore's event bus for each image, as will a DatastoreClearedEvent.- Throws:
IOException- if an IO error occurred.
-