Interface Datastore

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

public interface Datastore extends DataProvider
Read/write access to multi-dimensional image data. Important: Custom Datastore implementations are not supported (consider creating a custom storage instead).
  • Method Details

    • setStorage

      void setStorage(Storage storage)
      Sets the data storage implementation for this Datastore.
      Parameters:
      storage - data storage to be used henceforth
    • putImage

      void putImage(Image image) throws IOException
      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 occurs
      DatastoreFrozenException - 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

      void setSummaryMetadata(SummaryMetadata metadata) throws IOException
      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 occurs
      DatastoreFrozenException - if the freeze() method has been called.
      DatastoreRewriteException - if the Datastore already has SummaryMetadata or already has images.
    • hasAnnotation

      boolean hasAnnotation(String tag) throws IOException
      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

      Annotation getAnnotation(String tag) throws IOException
      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

      void freeze() throws IOException
      Freeze this Datastore so it cannot be further modified.
      Throws:
      IOException - if an IO error occurs
    • setSavePath

      void setSavePath(String path)
      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 boolean save(Component parent) throws IOException
      Deprecated.
      Deprecated.
      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

      String save(Component parent, boolean blocking) throws IOException
      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 displaying
      blocking - 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

      void save(Datastore.SaveMode mode, String path) throws IOException
      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 to
      path - File path used to save the data
      Throws:
      IOException - if an IO error occurs
    • save

      void save(Datastore.SaveMode mode, String path, boolean blocking) throws IOException
      Saves the datastore to the given path using the given format (SaveMode).
      Parameters:
      mode - File format to save to
      path - File path used to save the data
      blocking - when true, will block while saving data, otherwise will return immediately
      Throws:
      IOException - if an IO error occurs
    • setName

      void setName(String name)
      Sets the name of the Datastore. Posts a DatastoreNewNameEvent.
      Parameters:
      name - new name of the Datastore