MMCorePy: intervalMs is ignored when doing sequence acquisition

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

MMCorePy: intervalMs is ignored when doing sequence acquisition

schollz
First of all, thanks so much for this software - its a huge benefit to our
lab.

I'm wondering if anyone can help me with the behavior of `intervalMs`. I
have found that for my camera (Prime95B), the `intervalMs` in MMCorePy does
not seem to work.

Here is a the smallest code to reproduce the problem. I'm using a Prime95B
and the problem might just be related to my specific camera.



which prints



Basically it is somehow acquiring 5 frames at 2000 millisecond intervals in
~0.5 seconds. So this tells me that its just limited by exposure, and not
actually using the interval. And in fact, the result doesn't change if I
change `2000.0` to any other number. So it seems that MMCorePy is just
ignoring the interval for sequence acquisitions (I found similar behavior on
continuous acquisition).

I'm on Windows 10 and using Python 2.7.15. I am using the latest release of
MM1.4 (nightly build) and I have also tried the latest nightly build of
Micro-Manager-2.0beta and both have the same problem.

Everything else I have done with MMCorePy works great. Setting/getting
properties works fine,  circular buffers work, metadata capture works, and
all continuous captures work - except that it is ignoring the interval. This
is not a problem with the GUI version of MM  - Live Capture seems to work
just fine with intervals. I'm only having the problem with MMCorePy.


(post mirrored from Github:
https://github.com/micro-manager/micro-manager/issues/634, I'll update the
GH issue to point here)



-----

---

Zack Scholl, Ph.D.
Senior Fellow
Department of Hematology
UW Medicine, Seattle, WA
[hidden email]
--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

---

Zack Scholl, Ph.D.
Senior Fellow
Department of Hematology
UW Medicine, Seattle, WA
schollz@uw.edu
Reply | Threaded
Open this post in threaded view
|

Re: MMCorePy: intervalMs is ignored when doing sequence acquisition

JonD
Administrator
Hi Zack,


schollz wrote
> I'm wondering if anyone can help me with the behavior of `intervalMs`. I
> have found that for my camera (Prime95B), the `intervalMs` in MMCorePy
> does
> not seem to work.

Kudos for posting a SSCCE on Github! (somehow it didn't come through in the
mail).

The MMCore documentation for startSequenceAcquisition [1] says that only
Andor cameras support the 'intervalMs' parameter.  Not sure if there are any
other cameras that do.  I can see from the Core code that the intervalMs
value is simply passed to the camera device adapter which has an API method
with the same name and parameters, so you'd have to inspect the camera
device adapter code to see how the parameter is used.

Here is another relevant thread about the intervalMs [2].  I'm not sure why
Nico's reply said device adapters "can not" instead of "do not".

Hopefully someone else can comment on whether there is a good way to take
repeated images at a specified interval using only MMCore.

Jon

[1]
https://valelab4.ucsf.edu/~MM/doc/MMCore/html/class_c_m_m_core.html#a2eea979db6e3244d017524bb57471d11

[2]
http://micro-manager.3463995.n2.nabble.com/Problem-with-startSequenceAcquisition-td4947753.html#a4948506





--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: MMCorePy: intervalMs is ignored when doing sequence acquisition

schollz
Thanks! That forum post from eight years ago is highly relevant [1] - its the
exact issue. Also it looks like the code for my camera (PVCAM) does indeed
not use `interval_ms` at all. [2]

The issue is solved (kinda) using snapImage(), as I can program a
"time.sleep()" in the loop so that I can adjust to the FPS I need using a
constant exposure (~10ms).

However, as noted in [1], snapImage() is only fast enough to get up to
~10-15 FPS (i.e. no time.sleep) whereas the startSequenceAcquisition() can
reach up to 80FPS on our sCMOS. I can combine the two methods, but this
means that a FPS of ~15-80 is not going to be possible...

I think that this is okay for us though because if we want more than 15 FPS
we usually just want to go as fast as possible. Also, I haven't tried but I
maybe can just do manually triggering on the camera with a pulse generated
from LabView.

Still, if there any ideas I would be open to them!


[1]:
http://micro-manager.3463995.n2.nabble.com/Problem-with-startSequenceAcquisition-td4947753.html#a4948506

[2]:
https://github.com/micro-manager/micro-manager/blob/master/DeviceAdapters/PVCAM/PVCAMUniversal.cpp#L1646-L1709



-----

---

Zack Scholl, Ph.D.
Senior Fellow
Department of Hematology
UW Medicine, Seattle, WA
[hidden email]
--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

---

Zack Scholl, Ph.D.
Senior Fellow
Department of Hematology
UW Medicine, Seattle, WA
schollz@uw.edu
Reply | Threaded
Open this post in threaded view
|

Re: MMCorePy: intervalMs is ignored when doing sequence acquisition

Nico Stuurman-2
In reply to this post by JonD
On 6/14/18 4:11 PM, JonD wrote:
> Hi Zack,
>
> Here is another relevant thread about the intervalMs [2].  I'm not
> sure why
> Nico's reply said device adapters "can not" instead of "do not".

Looking at that post again, I meant to convey that most camera's
interfaces (apis, etc..) have no facilities to implement intervals in
sequence acquisitions (hence an adapter can not implement it, since the
camera intreface does not support it).  Whenever a camera interface
supports intervals, then an adapter can implement them.

> Hopefully someone else can comment on whether there is a good way to take
> repeated images at a specified interval using only MMCore.

For intervals of 2 seconds, I would certainly trust the timers in the
computer and snapping images should get you very close.  If it is
critical, set the camera in external trigger mode and provide triggers
at the desired intervals.

Best,


Nico

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general