LoadSLMSequence() and the Matlab API

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

LoadSLMSequence() and the Matlab API

JB Lugagne
Hi,

I am trying to pass a sequence of images to my SLM (a Polygon400 DMD) via
Matlab. The following (and multiple variants thereof) does not work:
mmc.loadSLMSequence(DMDname, mov(:));
with 'mov' a 3D Matlab array of uint8's

Note that the following works in Matlab:
mmc.setSLMimage(DMDname,img(:));
with 'img' a 2D Matlab array of uint8's

Anybody knows how to pass a sequence of images to the SLM in Matlab? I'm
using MM2.0 via Matlab 2018b on Win10.

Thank you,
Jean-Baptiste



--
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: LoadSLMSequence() and the Matlab API

JB Lugagne
I have made some progress. By transforming my 3D matlab matrix into a java
ArrayList, I am able to use the LoadSLMSequence.

The following works (as in, doesn't produce an error):

javamov = java.util.ArrayList;
for f = 1:100
    frame = mov(:,:,f);
    javamov.add(frame(:));
end

mmc.loadSLMSequence(mmc.getSLMDevice,javamov)

mov is the right type and dimensions for my Polygon400.


However, nothing happens once I try to start the sequence with:
mmc.startSLMSequence(mmc.getSLMDevice)

Whatever image was displayed before disappears and nothing happens.
Am I missing something? Anybody has an idea?

Thank you
Jean-Baptiste.



--
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: LoadSLMSequence() and the Matlab API

JB Lugagne
Alright I finally got this to work with the help of the Mightex support team.
The following works for me in Matlab, and similar code also works in
beanshell:

javamov = java.util.ArrayList;
for f = 1:100
    frame = mov(:,:,f);
    javamov.add(frame(:));
end

mmc.setProperty(mmc.getSLMDevice,"TriggerType",0)
mmc.loadSLMSequence(mmc.getSLMDevice,javamov)
mmc.startSLMSequence(mmc.getSLMDevice)

for f = 1:100
    mmc.setProperty(mmc.getSLMDevice,"CommandTrigger",f)
    pause(.1)
end

mmc.stopSLMSequence(mmc.getSLMDevice)

for some reason the displaySLMimage function never worked, but this
commandtrigger property does the trick. It actually doesnt matter if you
send the f value in the second loop or just 1 or whatever else all the time,
it always pops the next image in the sequence, when my understanding of how
commandtrigger should work is that sending a certain value (here f) should
display the frame that is in that position in the sequence (the f-th frame
of javamov in our example). But this works for my purposes.



--
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