Online processing of an image sequence

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

Online processing of an image sequence

yiftachd
Hi,

I would appreciate your help because I'm a bit lost.. Using matlab, I'm
trying to create a sequence of images, and do a really simple processing
(measure the average intensity of the frame) in the time interval between
images. I tried to use snapAndAddImage() based on the example in the
MicroManager website  here
<https://micro-manager.org/w/images/c/ce/ManualAcq.bsh>  . The imaging works
great, but I couldn't manage to retrieve the images immediately after they
were taken. I tried to use mmc.getImage() and got the following error:

java.lang.Exception: Camera image buffer read failed.

        at mmcorej.MMCoreJJNI.CMMCore_getImage__SWIG_0(Native Method)

        at mmcorej.CMMCore.getImage(CMMCore.java:932)


mmc.getImage() worked fine when I used mmc.snapImage(), so I guess it's not
a camera problem...


I also tried mmc.getLastTaggedImage() and got:

java.lang.Exception: Circular buffer is empty.

        at mmcorej.MMCoreJJNI.CMMCore_getLastImageMD__SWIG_0(Native Method)

        at mmcorej.CMMCore.getLastImageMD(CMMCore.java:1048)

        at mmcorej.CMMCore.getLastTaggedImage(CMMCore.java:172)


Thank you very much in advance,
Yiftach




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


_______________________________________________
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: Online processing of an image sequence

Stuurman, Nico
Hi Yiftach,

On 6/18/2019 6:54 AM, yiftachd wrote:

> I would appreciate your help because I'm a bit lost.. Using matlab, I'm
> trying to create a sequence of images, and do a really simple processing
> (measure the average intensity of the frame) in the time interval between
> images. I tried to use snapAndAddImage() based on the example in the
> MicroManager website  here
> <https://micro-manager.org/w/images/c/ce/ManualAcq.bsh>  . The imaging works
> great, but I couldn't manage to retrieve the images immediately after they
> were taken. I tried to use mmc.getImage() and got the following error:
>
> java.lang.Exception: Camera image buffer read failed.
>
> at mmcorej.MMCoreJJNI.CMMCore_getImage__SWIG_0(Native Method)
>
> at mmcorej.CMMCore.getImage(CMMCore.java:932)
>
>
> mmc.getImage() worked fine when I used mmc.snapImage(), so I guess it's not
> a camera problem...

mmc.getImage() only works immediately after mmc.snapImage().  The
function gui.snapAndAddImage used in the Manual Acquisition script
itself calls both mmc.snapImage() and mmc.getImage(), so your "second"
call to mmc.getImage() will return an error, since the camera no longer
has an image for you.

Instead of gui.snapAndAddImage, use mmc.snapImage() and mmc.getImage()
(or better, the TaggedImage variants), and insert the image into the
"Acquisition" yourself.

At this point in time, I strongly recomend to use 2.0-gamma instead of
1.4, especially for scripting.  1.4 is in maintenance mode, and the
scripting interface is not well developed.  2.0-gamma lets you do much
more, and - once you are used to it - should also be a lot easier.

> I also tried mmc.getLastTaggedImage() and got:
>
> java.lang.Exception: Circular buffer is empty.
>
> at mmcorej.MMCoreJJNI.CMMCore_getLastImageMD__SWIG_0(Native Method)
>
> at mmcorej.CMMCore.getLastImageMD(CMMCore.java:1048)
>
> at mmcorej.CMMCore.getLastTaggedImage(CMMCore.java:172)

Since you did not put anything into the circular buffer, you will not
get anything out of it either;)

Best,

Nic



_______________________________________________
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: Online processing of an image sequence

yiftachd
Thank you very much!



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


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