I seek help to put together a script with runnables for plate acquisition
with our Nikon Ti setup. We use the HCS plugin to create positions for image
acquisition using the MDA functionality, but long-distance moves impose to
look for focus beyond the range of PFS (and since the range we need to scan
is large, HardwareFocusExtender is too slow). We have already established a
procedure to find focus reliably. However, we have troubles when we want to
acquire slices after having found the focus. In particular, while the slices
of the first image are acquired as expected, the slices of the next
positions are acquired at the wrong Z position.
At the moment, I suspect that I fail at updating the value of a global
variable from a runnable…
Our script has 2 runnables, one called at every position which looks for the
focus and stores the corresponding Z in a global variable, and one called at
every slice to move the z drive to focus. Here is a stripped-down version:
By setting `setPos` to a constant float value, I figured out that the slice
offset is added to the position "automatically" i.e. despite always using
the same value for setPosition(), getPosition() was moving around as
expected from the slices settings of the MDA window.
Now, if I use `setPos = ref_Z`, the following print() call has the correct
value, but getPosition() returns weird values. In particular, starting from
the second position, some slices seem to be at the ref_Z of the current
position while others are at the ref_Z of the previous position. I don’t
understand how print() calls the correct value, but getPosition() does not.
Can they maybe be called in different thread where the variable have
This makes me suspect that I somehow don't manage to create ref_Z as a
global position or that I should maybe use a modifier so that it's properly
passed whenever the runnable runs.
I would really appreciate help to understand this issue and achieve the
Thank you very much.
Thomas Julou | Computational & Systems Biology | Biozentrum – University of Basel | Klingelbergstrasse 50/70 CH-4056 Basel | +41 (0)61 267 16 21
On 5/6/2020 3:00 AM, julou wrote:
> We're really stuck on this one :-/
> It'd be very helpful if someone could comment on whether this is not the way
> to do it, or on how to properly handle variables between runnables.
Sorry for the lack of response to the original email. I re-read it, but
there is so much that I do not understand that I do not know what to ask
to clarify. If you can drill the problem down to a very small example
that can be reproduced with the demo configuration, then we may be able
to figure this one out.