public interface AcquisitionManager
Modifier and Type | Method and Description |
---|---|
void |
abortAcquisition()
Abort any ongoing acquisition as soon as possible, without user dialog.
|
void |
attachRunnable(int frame,
int position,
int channel,
int slice,
java.lang.Runnable runnable)
Attach a runnable to the acquisition engine.
|
ChannelSpec.Builder |
channelSpecBuilder()
Provides and empty ChannelSpec Builder.
|
void |
clearRunnables()
Remove runnables from the acquisition engine.
|
Metadata |
generateMetadata(Image image,
boolean includeHardwareState)
Generate a new Metadata that contains pre-populated fields based on the
current state of the program and the provided Image.
|
SummaryMetadata |
generateSummaryMetadata()
Generate a new SummaryMetadata that contains pre-populated fields based
on the current state of the program.
|
SequenceSettings |
getAcquisitionSettings()
Return current acquisition settings as shown in the Multi-D Acquisition
dialog.
|
void |
haltAcquisition()
Halt any ongoing acquisition as soon as possible, prompting users with a
dialog for confirmation.
|
boolean |
isAcquisitionRunning()
Returns true when an acquisition is currently running (note: this
function will not return true if live mode, snap, or "Camera -->
Album" is currently running.
|
boolean |
isOurAcquisition(java.lang.Object source)
Test the provided Object, and return true if it corresponds to the
"source" object that Micro-Manager's acquisition system uses when
publishing AcquisitionStartedEvent and AcquisitionEndedEvent.
|
boolean |
isPaused()
Returns true if the acquisition is currently paused.
|
void |
loadAcquisition(java.lang.String path)
Load a file containing a SequenceSettings object, and apply the settings
found in it to the Multi-D Acquisition (MDA) dialog.
|
SequenceSettings |
loadSequenceSettings(java.lang.String path)
Load a SequenceSettings file and return the SequenceSettings object.
|
Datastore |
runAcquisition()
Executes Acquisition with settings as in the MDA dialog.
|
Datastore |
runAcquisition(java.lang.String name,
java.lang.String root)
Executes Acquisition with current settings but allows for changing the data path.
|
Datastore |
runAcquisitionNonblocking()
As runAcquisition, but will return as soon as the acquisition is set up
and started; useful for code that wants access to the Datastore for the
acquisition before it finishes.
|
Datastore |
runAcquisitionWithSettings(SequenceSettings settings,
boolean shouldBlock)
Execute an acquisition using the provided SequenceSettings.
|
void |
saveSequenceSettings(SequenceSettings settings,
java.lang.String path)
Save the provided SequenceSettings object to disk at the specified path.
|
SequenceSettings.Builder |
sequenceSettingsBuilder()
Provides an empty Sequence Settings Builder.
|
void |
setAcquisitionSettings(SequenceSettings settings)
Apply new acquisition settings.
|
void |
setPause(boolean state)
Pause/Unpause a running acquisition.
|
java.util.List<Image> |
snap()
Snap images using the current camera(s) and return them.
|
SequenceSettings.Builder sequenceSettingsBuilder()
ChannelSpec.Builder channelSpecBuilder()
Datastore runAcquisition() throws java.lang.IllegalThreadStateException
java.lang.IllegalThreadStateException
- if the acquisition is started on the EDTDatastore runAcquisition(java.lang.String name, java.lang.String root) throws java.lang.IllegalThreadStateException
name
- Name of this acquisition.root
- Place in the file system where data can be stored.java.lang.IllegalThreadStateException
- if the acquisition is started on the
EDT.Datastore runAcquisitionNonblocking() throws java.lang.IllegalThreadStateException
java.lang.IllegalThreadStateException
- if the acquisition is started on the EDTDatastore runAcquisitionWithSettings(SequenceSettings settings, boolean shouldBlock) throws java.lang.IllegalThreadStateException
settings
- SequenceSettings to use for the acquisition, or null
to use the settings in the MDA dialog.shouldBlock
- if true, the method will block until the acquisition
is completed.java.lang.IllegalThreadStateException
- if the acquisition is started on the
EDT.void haltAcquisition()
void abortAcquisition()
void loadAcquisition(java.lang.String path) throws java.io.IOException
path
- File path to the SequenceSettings object.java.io.IOException
- if the sequence settings cannot be loaded.SequenceSettings loadSequenceSettings(java.lang.String path) throws java.io.IOException
path
- File path to the SequenceSettings object.java.io.IOException
- if there was an error reading the file.void saveSequenceSettings(SequenceSettings settings, java.lang.String path) throws java.io.IOException
settings
- SequenceSettings object to save.path
- Path to save the SequenceSettings to.java.io.IOException
- if there was an error writing the file to disk.boolean isAcquisitionRunning()
void setPause(boolean state)
state
- true if paused, false if no longer pausedboolean isPaused()
void attachRunnable(int frame, int position, int channel, int slice, java.lang.Runnable runnable)
frame
- 0-based frame numberposition
- 0-based position numberchannel
- 0-based channel numberslice
- 0-based (z) slice numberrunnable
- code to be runvoid clearRunnables()
SequenceSettings getAcquisitionSettings()
void setAcquisitionSettings(SequenceSettings settings)
settings
- acquisition settingsjava.util.List<Image> snap() throws java.lang.Exception
java.lang.Exception
- If there is an error when communicating with the Core
(for example, because Live mode is on), or if the current hardware
configuration contains no cameras.SummaryMetadata generateSummaryMetadata()
Metadata generateMetadata(Image image, boolean includeHardwareState) throws java.lang.Exception
Additionally, if the includeHardwareState boolean is set to true, then the current state of the system state cache (i.e. Micro-Manager's understanding of all device property values) will be included in the scopeData property. As with the stage positions, these values do not necessarily reflect reality; they are just the last-known values in the cache.
image
- Image whose metadata should be populated.includeHardwareState
- if true, then the scopeData field will be
populated in the result Metadata.java.lang.Exception
- If there were any errors communicating with the Core to
get required values.boolean isOurAcquisition(java.lang.Object source)
source
- Result of calling getSource() on an AcquisitionStartedEvent
or AcquisitionEndedEvent.