Interface Datastore
- All Superinterfaces:
AutoCloseable, Closeable, DataProvider
- All Known Subinterfaces:
RewritableDatastore
Read/write access to multi-dimensional image data.
Important: Custom Datastore implementations are not
supported (consider creating a custom storage instead).
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidfreeze()Freeze this Datastore so it cannot be further modified.getAnnotation(String tag) Get an annotation, creating it if it doesn't exist.Get the intended or actual path where the data will be stored.booleanhasAnnotation(String tag) Return whether an annotation with the given tag exists.voidInsert an image into the Datastore.booleanDeprecated.Saves the datastore to an interactively determined path.voidsave(Datastore.SaveMode mode, String path) Saves the datastore to the given path using the given format (SaveMode) Will save synchronously (i.e.voidsave(Datastore.SaveMode mode, String path, boolean blocking) Saves the datastore to the given path using the given format (SaveMode).voidSets the name of the Datastore.voidsetSavePath(String path) Set the intended path where the data will be stored.voidsetStorage(Storage storage) Sets the data storage implementation for this 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, unregisterForEvents
-
Method Details
-
setStorage
Sets the data storage implementation for this Datastore.- Parameters:
storage- data storage to be used henceforth
-
putImage
Insert an image into the Datastore. Posts a NewImageEvent to the event bus.- Parameters:
image- Micro-Manager Image object- Throws:
IOException- if an IO error occursDatastoreFrozenException- if the freeze() method has been called.DatastoreRewriteException- if an Image with the same coordinates already exists in the Datastore.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.
-
setSummaryMetadata
Set the SummaryMetadata. Posts a NewSummaryMetadataEvent to the event bus. This method may only be called once for a given Datastore, and must be called before adding any images.- Parameters:
metadata- Object representing the summary metadata- Throws:
IOException- if an IO error occursDatastoreFrozenException- if the freeze() method has been called.DatastoreRewriteException- if the Datastore already has SummaryMetadata or already has images.
-
hasAnnotation
Return whether an annotation with the given tag exists.- Parameters:
tag- the tag for the annotation- Returns:
- true if the annotation exists; false otherwise
- Throws:
IOException- if an IO error occurs
-
getAnnotation
Get an annotation, creating it if it doesn't exist.- Parameters:
tag- tag for the annotation- Returns:
- Annotation for th given tag
- Throws:
IOException- if an IO error occurs
-
freeze
Freeze this Datastore so it cannot be further modified.- Throws:
IOException- if an IO error occurs
-
setSavePath
Set the intended path where the data will be stored.In the current Micro-Manager file format, this path is used as the enclosing directory.
- Parameters:
path- the file path (without extension)- Throws:
UnsupportedOperationException- if this is an on-disk datastore
-
getSavePath
String getSavePath()Get the intended or actual path where the data will be stored.If this is an in-memory datastore, returns whatever was set by
setSavePath(String). If this is an on-disk datastore, returns the actual path.- Returns:
- the file path where the data is (to be) saved
-
save
Deprecated.Usesave(Component, boolean)insteadDeprecated.- Parameters:
parent- Window on top of which to display the dialog prompt; may be null.- Returns:
- true if data was saved; false if user canceled
- Throws:
IOException- if an IO error occurs
-
save
Saves the datastore to an interactively determined path. Opens a file dialog prompting user for a storage location.- Parameters:
parent- Window on top of which to display a dialog prompting the user for a location to save. After displayingblocking- if true will return after saving, otherwise will return quickly and continue saving on another thread- Returns:
- Path chosen by user to save the data, null if dialog was canceled
- Throws:
IOException- if an IO error occurs
-
save
Saves the datastore to the given path using the given format (SaveMode) Will save synchronously (i.e. this function will block)- Parameters:
mode- File format to save topath- File path used to save the data- Throws:
IOException- if an IO error occurs
-
save
Saves the datastore to the given path using the given format (SaveMode).- Parameters:
mode- File format to save topath- File path used to save the datablocking- when true, will block while saving data, otherwise will return immediately- Throws:
IOException- if an IO error occurs
-
setName
Sets the name of the Datastore. Posts a DatastoreNewNameEvent.- Parameters:
name- new name of the Datastore
-
save(Component, boolean)instead