.. java:import:: ch.epfl.leb.alica AlicaLogger .. java:import:: ch.epfl.leb.alica.interfaces Analyzer .. java:import:: ch.epfl.leb.alica ImagingMode .. java:import:: com.google.common.eventbus Subscribe .. java:import:: ij.gui Roi .. java:import:: mmcorej TaggedImage .. java:import:: org.json JSONException .. java:import:: org.json JSONObject .. java:import:: org.micromanager Studio .. java:import:: org.micromanager.data Coords .. java:import:: org.micromanager.data Datastore .. java:import:: org.micromanager.data Image .. java:import:: org.micromanager.data DataProviderHasNewImageEvent .. java:import:: org.micromanager.events AcquisitionEndedEvent .. java:import:: org.micromanager.events AcquisitionStartedEvent .. java:import:: org.micromanager.events LiveModeEvent AnalysisWorker ============== .. java:package:: ch.epfl.leb.alica.workers :noindex: .. java:type:: public class AnalysisWorker extends Thread This thread continuously queries either the MMCore, or the processing pipeline of the live mode for new images, and calls the analyzer's processImage() method on them as fast as it can. Always the latest image is taken for analysis, so it is possible for images to be skipped. It also gathers some statistics for display by the GUI. :author: Marcel Stefko Constructors ------------ AnalysisWorker ^^^^^^^^^^^^^^ .. java:constructor:: public AnalysisWorker(Coordinator coordinator, Studio studio, Analyzer analyzer, ImagingMode imaging_mode) :outertype: AnalysisWorker Initialize the worker. :param coordinator: parent Coordinator :param studio: for logging and image queries :param analyzer: this Analyzer's processImage() method is called on gathered images :param imaging_mode: Methods ------- acquisitionEnded ^^^^^^^^^^^^^^^^ .. java:method:: @Subscribe public void acquisitionEnded(AcquisitionEndedEvent evt) :outertype: AnalysisWorker If the imaging mode is NEXT_ACQUISITION, the coordinator will asked to stop. :param evt: acquisition stopped acquisitionStarted ^^^^^^^^^^^^^^^^^^ .. java:method:: @Subscribe public void acquisitionStarted(AcquisitionStartedEvent evt) :outertype: AnalysisWorker If the imaging mode is NEXT_ACQUISITION, the NewImageWatcher will be informed. :param evt: new acquisition started event getAnalyzerShortDescription ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public String getAnalyzerShortDescription() :outertype: AnalysisWorker Returns the current description of the analyzer's output. :return: A string describing the analyzer's current output. getCurrentFPS ^^^^^^^^^^^^^ .. java:method:: public int getCurrentFPS() :outertype: AnalysisWorker :return: number of analyzed frames in the last second getCurrentImageCount ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public int getCurrentImageCount() :outertype: AnalysisWorker :return: number of analyzed frames since last counter reset, which could be either caused by live mode start, or acquisition start. getLastAnalysisTime ^^^^^^^^^^^^^^^^^^^ .. java:method:: public long getLastAnalysisTime() :outertype: AnalysisWorker :return: duration of last analysis in milliseconds getNewImageFromCoreAndAnalyze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public void getNewImageFromCoreAndAnalyze() throws InterruptedException :outertype: AnalysisWorker Acquire the new image directly from MMCore and send for analysis. :throws java.lang.InterruptedException: if waiting is interrupted getNewImageFromWatcherAndAnalyze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public void getNewImageFromWatcherAndAnalyze() throws InterruptedException :outertype: AnalysisWorker Grabs new images from the Datastore associated with the NewImageWatcher, analyzes it. :throws java.lang.InterruptedException: liveModeStarted ^^^^^^^^^^^^^^^ .. java:method:: @Subscribe public void liveModeStarted(LiveModeEvent evt) :outertype: AnalysisWorker Called by the MMCore to signalize there is a new live mode. If the imaging mode is LIVE, the NewImageWatcher will be informed. :param evt: new live mode event queryAnalyzerForBatchOutput ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public double queryAnalyzerForBatchOutput() :outertype: AnalysisWorker Analyzer's internal state might change, and the output is passed on to the controller. :return: batched output of analyzer queryAnalyzerForIntermittentOutput ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public double queryAnalyzerForIntermittentOutput() :outertype: AnalysisWorker Used for GUI rendering. :return: intermittent output of the analyzer requestStop ^^^^^^^^^^^ .. java:method:: public void requestStop() :outertype: AnalysisWorker Stops the analyzer after finalizing the current analysis. run ^^^ .. java:method:: @Override public void run() :outertype: AnalysisWorker setLastImageCoords ^^^^^^^^^^^^^^^^^^ .. java:method:: void setLastImageCoords(Coords coords) :outertype: AnalysisWorker Called by the NewImageWatcher to update last coords :param coords: new Coords setROI ^^^^^^ .. java:method:: public void setROI(Roi roi) :outertype: AnalysisWorker Set the ROI for Analyzer :param roi: ROI to be set