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, 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 timeout_ms) |
void |
blockUntilEventsFinished(Double timeoutSeconds)
Blcok 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() |
AcqEngJDataSink |
getDataSink()
Don't delete, called by python side
|
Iterable<AcquisitionHook> |
getEventGenerationHooks() |
int |
getImageTransferQueueCount() |
int |
getImageTransferQueueSize() |
long |
getStartTime_ms() |
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()
Has abort 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 |
setStartTime_ms(long time) |
void |
start()
Call to ready acquisition to start receiving acquisiton events.
|
Future |
submitEventIterator(Iterator<AcquisitionEvent> evt)
Submit a list of acquisition events for acquisition.
|
void |
waitForCompletion()
Block until acquisition finished and all resources complete.
|
protected 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)
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 abort(Exception e)
abort in interface AcquisitionAPIe - public void checkForExceptions()
throws Exception
AcquisitionAPIcheckForExceptions in interface AcquisitionAPIExceptionpublic 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)
AcquisitionAPIsubmitEventIterator 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()
AcquisitionAPIwaitForCompletion in interface AcquisitionAPIprotected void initialize()
public void start()
AcquisitionAPIstart in interface AcquisitionAPIpublic long getStartTime_ms()
public void setStartTime_ms(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> 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 AcquisitionAPIInterruptedExceptionpublic int getImageTransferQueueSize()
public int getImageTransferQueueCount()
public void blockUnlessAborted(long timeout_ms)
Copyright © 2024. All rights reserved.