public class Acquisition extends Object implements AcquisitionAPI
| Modifier and Type | Field and Description |
|---|---|
protected CountDownLatch |
abortRequested_ |
mmcorej.CMMCore |
core_ |
protected AcqEngJDataSink |
dataSink_ |
boolean |
debugMode_ |
protected CountDownLatch |
eventsFinished_ |
protected LinkedBlockingDeque<mmcorej.TaggedImage> |
firstDequeue_ |
protected String |
slm_ |
protected boolean |
started_ |
protected mmcorej.org.json.JSONObject |
summaryMetadata_ |
protected String |
xyStage_ |
protected String |
zStage_ |
AFTER_CAMERA_HOOK, AFTER_EXPOSURE_HOOK, AFTER_HARDWARE_HOOK, BEFORE_HARDWARE_HOOK, BEFORE_Z_DRIVE_HOOK, EVENT_GENERATION_HOOK| Constructor and Description |
|---|
Acquisition(AcqEngJDataSink sink)
Primary constructor for creating Acquisitons.
|
Acquisition(AcqEngJDataSink sink,
boolean initialize)
Version in which initialization can be handled by a subclass.
|
Acquisition(AcqEngJDataSink sink,
Consumer<mmcorej.org.json.JSONObject> summaryMetadataProcessor)
Version of the constructor that accepts a function that can modify SummaryMetadata as needed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Cancel any pending events and shutdown.
|
void |
abort(Exception e)
Auto abort caused by an exception during acquisition.
|
void |
addAcqNotificationListener(AcqNotificationListener listener)
Add a AcqNotificationListener to receive asynchronous notifications about the acquisition.
|
void |
addHook(AcquisitionHook h,
int type)
Add a an arbitrary piece of code (i.e.
|
void |
addImageMetadataProcessor(Consumer<mmcorej.org.json.JSONObject> processor)
Add a Consumer that will receive the metadata JSONObject for each image
that is generated and modify it as needed.
|
void |
addImageProcessor(TaggedImageProcessor p)
Add an image processor for modifying images before saving or diverting
them to some other purpose
|
void |
addTagsToTaggedImage(mmcorej.org.json.JSONObject tags,
HashMap<String,String> moreTags)
Add provided tags (Key-Value pairs of type String) to the Tagged Image tags.
|
void |
addToImageMetadata(mmcorej.org.json.JSONObject tags) |
void |
addToOutput(mmcorej.TaggedImage ti) |
boolean |
anythingAcquired()
Returns true once any data has been acquired
|
boolean |
areEventsFinished()
returns true if all acquisition events have been processed and
hardware control is complete.
|
void |
blockUnlessAborted(long timeoutMs) |
void |
blockUntilEventsFinished(Double timeoutSeconds)
Block until all acquisitions events are finished or timeout is reached.
|
void |
checkForExceptions()
Throws an exception if an exception occured on a thread managed by the acquisiton
|
void |
finish()
Signal the acquisition to complete once all events are done
|
Iterable<AcquisitionHook> |
getAfterCameraHooks() |
Iterable<AcquisitionHook> |
getAfterExposureHooks() |
Iterable<AcquisitionHook> |
getAfterHardwareHooks() |
Iterable<AcquisitionHook> |
getBeforeHardwareHooks() |
Iterable<AcquisitionHook> |
getBeforeZDriveHooks() |
AcqEngJDataSink |
getDataSink()
Don't delete, called by python side.
|
Iterable<AcquisitionHook> |
getEventGenerationHooks() |
int |
getImageTransferQueueCount() |
int |
getImageTransferQueueSize() |
long |
getStartTimeMs() |
mmcorej.org.json.JSONObject |
getSummaryMetadata()
Get the summary metadata for this acquisition
|
protected void |
initialize()
1) Get the names of core devices to be used in acquisition.
|
boolean |
isAbortRequested()
Wether abort has been called.
|
boolean |
isDebugMode()
Should debug logging be printed
|
boolean |
isPaused()
Return if acquisition is paused (i.e.
|
boolean |
isStarted()
return if acquisition is started by the first call to submitEventIterator
|
void |
postNotification(AcqNotification notification) |
void |
setDebugMode(boolean debug)
Don't delete, called by python side.
|
void |
setPaused(boolean pause)
Pause or unpause
|
void |
setStartTimeMs(long time) |
void |
start()
Call to ready acquisition to start receiving acquisition events.
|
Future |
submitEventIterator(Iterator<AcquisitionEvent> evt)
Submit a list of acquisition events for acquisition.
|
void |
waitForCompletion()
Block until everything finished.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitanyAcquisitionsRunningprotected String xyStage_
protected String zStage_
protected String slm_
protected volatile CountDownLatch eventsFinished_
protected volatile CountDownLatch abortRequested_
protected mmcorej.org.json.JSONObject summaryMetadata_
protected AcqEngJDataSink dataSink_
public final mmcorej.CMMCore core_
protected LinkedBlockingDeque<mmcorej.TaggedImage> firstDequeue_
public boolean debugMode_
protected volatile boolean started_
public Acquisition(AcqEngJDataSink sink)
After this constructor returns, the Acquisiton will be ready to be given instructions by calling submitEventIterator. However, if any acquisition hooks or image processors are desired, they should be added before the first call of submitEventIterator
public Acquisition(AcqEngJDataSink sink, Consumer<mmcorej.org.json.JSONObject> summaryMetadataProcessor)
public Acquisition(AcqEngJDataSink sink, boolean initialize)
public void postNotification(AcqNotification notification)
public void addAcqNotificationListener(AcqNotificationListener listener)
AcquisitionAPIaddAcqNotificationListener in interface AcquisitionAPIpublic AcqEngJDataSink getDataSink()
getDataSink in interface AcquisitionAPIpublic void setDebugMode(boolean debug)
setDebugMode in interface AcquisitionAPIpublic boolean isDebugMode()
AcquisitionAPIisDebugMode in interface AcquisitionAPIpublic boolean isAbortRequested()
AcquisitionAPIisAbortRequested in interface AcquisitionAPIpublic void checkForExceptions()
throws Exception
AcquisitionAPIcheckForExceptions in interface AcquisitionAPIExceptionpublic void abort(Exception e)
abort in interface AcquisitionAPIe - Exception causing the abortpublic void abort()
AcquisitionAPIabort in interface AcquisitionAPIpublic void addToImageMetadata(mmcorej.org.json.JSONObject tags)
public void addTagsToTaggedImage(mmcorej.org.json.JSONObject tags,
HashMap<String,String> moreTags)
throws mmcorej.org.json.JSONException
"Tags".tags - Tagged Image tagsmoreTags - User-provided tags as Key-Value pairsmmcorej.org.json.JSONExceptionpublic Future submitEventIterator(Iterator<AcquisitionEvent> evt)
AcquisitionAPIIf start() has not already been called on the acquisition, it will automatically be called here
submitEventIterator in interface AcquisitionAPIpublic void addImageProcessor(TaggedImageProcessor p)
AcquisitionAPIaddImageProcessor in interface AcquisitionAPIpublic void addHook(AcquisitionHook h, int type)
AcquisitionAPIaddHook in interface AcquisitionAPIh - Code to runtype - BEFORE_HARDWARE_HOOK, AFTER_HARDWARE_HOOK, AFTER_SAVE_HOOKpublic void waitForCompletion()
waitForCompletion in interface AcquisitionAPIprotected void initialize()
public void start()
AcquisitionAPIThis method is no longer needed, because it is called automatically when the first call to submitEventIterator is made
start in interface AcquisitionAPIpublic long getStartTimeMs()
public void setStartTimeMs(long time)
public boolean isPaused()
AcquisitionAPIisPaused in interface AcquisitionAPIpublic boolean isStarted()
AcquisitionAPIisStarted in interface AcquisitionAPIpublic void setPaused(boolean pause)
AcquisitionAPIsetPaused in interface AcquisitionAPIpublic mmcorej.org.json.JSONObject getSummaryMetadata()
AcquisitionAPIgetSummaryMetadata in interface AcquisitionAPIpublic boolean anythingAcquired()
AcquisitionAPIanythingAcquired in interface AcquisitionAPIpublic void addImageMetadataProcessor(Consumer<mmcorej.org.json.JSONObject> processor)
AcquisitionAPIaddImageMetadataProcessor in interface AcquisitionAPIpublic Iterable<AcquisitionHook> getEventGenerationHooks()
public Iterable<AcquisitionHook> getBeforeHardwareHooks()
public Iterable<AcquisitionHook> getBeforeZDriveHooks()
public Iterable<AcquisitionHook> getAfterHardwareHooks()
public Iterable<AcquisitionHook> getAfterCameraHooks()
public Iterable<AcquisitionHook> getAfterExposureHooks()
public void addToOutput(mmcorej.TaggedImage ti)
public void finish()
AcquisitionAPIfinish in interface AcquisitionAPIpublic boolean areEventsFinished()
AcquisitionAPIareEventsFinished in interface AcquisitionAPIpublic void blockUntilEventsFinished(Double timeoutSeconds) throws InterruptedException
AcquisitionAPIblockUntilEventsFinished in interface AcquisitionAPItimeoutSeconds - wait a maximum of this many seconds.InterruptedExceptionpublic int getImageTransferQueueSize()
public int getImageTransferQueueCount()
public void blockUnlessAborted(long timeoutMs)
Copyright © 2025. All rights reserved.