Quantcast

Beanshell script replicating Multi-D. Acq

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

Beanshell script replicating Multi-D. Acq

MonikaP
Dear All,

I am trying to write a Beanshell script that acquires Z-stacks at
different positions from position list - like Multi-D. Acq. I am running
into some problems.

If I already have a Position List, I can do:
PositionList pl = new PositionList();
pl=gui.getPositionList();
and then get postions from the list in a for loop:
pos = pl.getPosition(i);

what is the easiest way to move the XYStage to pos?

Perhaps somebody has an example script of multi-dimensional XYZ
acquisition? I was googling, but couldn't find anything that worked for
me. The fact that some of the functions changed in the meantime and some
examples online contain deprecated functions doesn't make it easier. :)

Regards,
Monika Pawłowska



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Beanshell script replicating Multi-D. Acq

JonD
MonikaP wrote
If I already have a Position List, I can do:
PositionList pl = new PositionList();
pl=gui.getPositionList();
and then get postions from the list in a for loop:
pos = pl.getPosition(i);

what is the easiest way to move the XYStage to pos?
It is non-obvious but I had to figure it out a while ago for a plugin.  I'll translate my solution to script form without having actually tried it.

First make sure your code can use org.micromanager.api.MultiStagePosition, e.g. put this at the top of your script:

import org.micromanager.api.MultiStagePosition;
 
Then use this call, where i is the index you are trying to move to (index starts at 0).  I believe this will move all the axis that have been enabled in the position list, not necessarily just X and Y.

MultiStagePosition.goToPosition(positionList.getPosition(i), mmc);

Jon

-------------------------------------------
Jon Daniels
Applied Scientific Instrumentation
29391 West Enid Rd, Eugene, OR 97402
Phone: (541) 461-8181 x118
-------------------------------------------
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Beanshell script replicating Multi-D. Acq

MonikaP
JonD wrote
MultiStagePosition.goToPosition(positionList.getPosition(i), mmc);
Thanks! This works!

But I'm baffled now, because MultiStagePosition is a class so I'd expect that you have to create an object first, like:

MultiStagePosition mps = new MultiStagePosition();
msp.goToPosition(pos, mmc);

which I tried and doesn't work.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Beanshell script replicating Multi-D. Acq

MonikaP
EDIT: Ok, I get it now. goToPosition is a static method, which means that it belongs to the class and not object.
Loading...