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


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,

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)
   for ipos in range (pos.size()):
      stage_pos = pos.get(ipos)
      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