"Safe" pausing multi-D acquisition / monitoring progress of a current acquisition

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

"Safe" pausing multi-D acquisition / monitoring progress of a current acquisition

PAVAK SHAH-4
Hi All,

I've recently started my first major effort to integrate some custom code with MM 2.0g and am having trouble finding a bit of functionality in the API. The goal is for my MATLAB code to "safely" pause an acquisition during the interval between timepoints, do some stuff, then move back to the first stage position before unpausing (in case the "stuff" takes longer to accomplish than the interval). 

At the moment, I can see how to grab a handle to the datastore containing the current acquisition and monitor the number of frames acquired to check if the acquisition should be in a "safe" state (ie. the number of frames is an integer multiple of the number of slices and stage positions acquired), but this is a bit clunky. 

The "messages" window seems to be able to receive updates about the current status of the acquisition, but I can't find obvious documentation as to where that data is coming from?

If someone can point me in the right direction I'd be greatly appreciative!

Thank you,
Pavak


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: "Safe" pausing multi-D acquisition / monitoring progress of a current acquisition

PAVAK SHAH-3
Relating to this, I found the getNextWakeTime method in the acquisition engine, but the returned value (which seems to be a number roughly 82E6 ms) doesn't look like posix time. Does anyone know how to compare this value against the current physical time?

Thanks,
Pavak

On Tue, Mar 10, 2020, 11:38 AM PAVAK SHAH <[hidden email]> wrote:
Hi All,

I've recently started my first major effort to integrate some custom code with MM 2.0g and am having trouble finding a bit of functionality in the API. The goal is for my MATLAB code to "safely" pause an acquisition during the interval between timepoints, do some stuff, then move back to the first stage position before unpausing (in case the "stuff" takes longer to accomplish than the interval). 

At the moment, I can see how to grab a handle to the datastore containing the current acquisition and monitor the number of frames acquired to check if the acquisition should be in a "safe" state (ie. the number of frames is an integer multiple of the number of slices and stage positions acquired), but this is a bit clunky. 

The "messages" window seems to be able to receive updates about the current status of the acquisition, but I can't find obvious documentation as to where that data is coming from?

If someone can point me in the right direction I'd be greatly appreciative!

Thank you,
Pavak


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: "Safe" pausing multi-D acquisition / monitoring progress of a current acquisition

Nico Stuurman-2
In reply to this post by PAVAK SHAH-4
Hi Pavak,

> I've recently started my first major effort to integrate some custom
> code with MM 2.0g and am having trouble finding a bit of functionality
> in the API. The goal is for my MATLAB code to "safely" pause an
> acquisition during the interval between timepoints, do some stuff,
> then move back to the first stage position before unpausing (in case
> the "stuff" takes longer to accomplish than the interval).

Try:

mm.acquisitions().setPause(true);

You'll have to test if the acquisition engine behaves correctly (i.e.
moves back before taking the next image after unpausing). Regretfully,
the acquisition engine is written in Clojure and difficult to modify.

Best,


Nico


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: "Safe" pausing multi-D acquisition / monitoring progress of a current acquisition

PAVAK SHAH-4
Hi Nico,

Unfortunately this doesn't seem to be the case. Pausing in the middle of a z stack pauses between frames (instead of waiting for the stack / position / timepoint to finish) and the position isn't automatically reset if the stage is moved while paused. 

This itself isn't a bad idea since having a faithful and immediate pause option is probably useful for some. It's easy enough to explicitly move back to Pos0 before the next timepoint starts.

Checking the frame count is sufficient for me to tell if a timepoint has finished, but it would be very helpful to be able to look up how much time is remaining until the next timepoint starts.

The alerts window seems to know how to do this, and I can see from the API how to create new alerts, but it's not clear how to access the "time to next frame" alert that the acq engine seems to be generating. getNextWakeTime seems to fit the bill, but I can't figure out how to interpret the output (other than that it's in ms) so I can check how much time is available for my code to execute safely in the interval.

Thanks!
Pavak


On Wed, Mar 11, 2020, 10:01 AM Nico Stuurman <[hidden email]> wrote:
Hi Pavak,

> I've recently started my first major effort to integrate some custom
> code with MM 2.0g and am having trouble finding a bit of functionality
> in the API. The goal is for my MATLAB code to "safely" pause an
> acquisition during the interval between timepoints, do some stuff,
> then move back to the first stage position before unpausing (in case
> the "stuff" takes longer to accomplish than the interval).

Try:

mm.acquisitions().setPause(true);

You'll have to test if the acquisition engine behaves correctly (i.e.
moves back before taking the next image after unpausing). Regretfully,
the acquisition engine is written in Clojure and difficult to modify.

Best,


Nico


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general