Importing Coordinates from multi-d acquisition stage position list through pycromanager

Hi,

I was wondering what the best way to import XY coordinates saved in the position list in pycromanager? Of course one way would be to save the text file, and parse it for coordinates separately, but I thought using a function inside the studio could help - although I haven’t had any luck with core.getPositionList or any studio functions.

Thank you,
Misha

from pycromanager import Bridge
bridge = Bridge()
mm = bridge.get_studio()
pm = mm.positions()
pos_list = pm.get_position_list()
for idx in range(pos_list.get_number_of_positions()):
   pos = pos_list.get_position(idx)
   pos.go_to_position(pos, mmc)
   print(pos.get_label())
   for ipos in range (pos.size()):
      stage_pos = pos.get(ipos)
      print(stage_pos.get_stage_device_label())
      print("x: ", stage_pos.x, ", y: ", stage_pos.y, "z: ", stage_pos.z)

Did not run it in one go, so there may be small errors here and there.

Thank you Nico! This worked great. I functionalized your code for easily transferring position coordinates for automated scripts.

1 Like