dystrack.manager.transmitters#
Functions to transmit coordinates to the microscope.
- dystrack.manager.transmitters.send_coords_txt(fpath, z_pos=None, y_pos=None, x_pos=None, msg='_', precision=4)#
Communicate new position for stage movement to the microscope through a text file, which should be monitored by the microscope software’s macro.
- Parameters:
fpath (path-like) – Path to the coordinate text file.
z_pos (numeric, optional, default 0.0) – Cooordinates of the new imaging position. For any that are None, the string value “nan” will be written in place of a coordinate number.
y_pos (numeric, optional, default 0.0) – Cooordinates of the new imaging position. For any that are None, the string value “nan” will be written in place of a coordinate number.
x_pos (numeric, optional, default 0.0) – Cooordinates of the new imaging position. For any that are None, the string value “nan” will be written in place of a coordinate number.
msg (str, optional, default "_") – String message to write in 4th column of text file. WARNING: It is recommended to keep this a relatively short string, i.e. under 1000 chars in length, so that the file write operation happens in a single buffer flush. Otherwise, there may be a risk of race condition where the microscope reads a half-finished file. In other words, do not abuse this to send extra data to the scope; instead write them to a separate file within your pipeline function and modify the microscope macro to read the data from that file after the new positions have been read from the coordinate file.
precision (int, optional, default 4) – Number of decimal places to write for coordinate values.
- dystrack.manager.transmitters.send_coords_winreg(z_pos=None, y_pos=None, x_pos=None, codeM='focus', errMsg=None)#
Communicate new position for stage movement to the microscope through the Windows registry, then prime it for imaging in the way expected by the MyPiC Pipeline Constructor macro. The actual acquisition will be triggered once the scope is idle.
- Parameters:
z_pos (numeric, optional, default None) – Cooordinates of the new imaging position. For any that are None, the registry entry is left unchanged.
y_pos (numeric, optional, default None) – Cooordinates of the new imaging position. For any that are None, the registry entry is left unchanged.
x_pos (numeric, optional, default None) – Cooordinates of the new imaging position. For any that are None, the registry entry is left unchanged.
codeM (str, optional, default "focus") – Action for the microscope to take. Default is “focus”, which triggers a move to the updated coordinates and acquisition as soon as the scope is idle. See MyPiC documentation for more information.
errMsg (str, optional, default None) – An optional error message for MyPiC to copy to its log file.