Qudi
|
This is the Logic class for mapping and tracking bright features in the confocal scan. More...
Public Member Functions | |
def | __init__ (self, config, kwargs) |
def | on_activate (self) |
Initialisation performed during activation of the module. | |
def | on_deactivate (self) |
def | user_move_deactivates_poi (self, tag) |
Deactivate the active POI if the confocal microscope scanner position is moved by anything other than the optimizer. | |
def | add_poi (self, position=None, key=None, emit_change=True) |
Creates a new poi and adds it to the list. More... | |
def | get_confocal_image_data (self) |
Get the current confocal xy scan data to hold as image of ROI. | |
def | get_all_pois (self, abc_sort=False) |
Returns a list of the names of all existing POIs. More... | |
def | delete_last_position (self, poikey=None) |
Delete the last position in the history. More... | |
def | delete_poi (self, poikey=None) |
Completely deletes the whole given poi. More... | |
def | optimise_poi (self, poikey=None) |
Starts the optimisation procedure for the given poi. More... | |
def | go_to_poi (self, poikey=None) |
Goes to the given poi and saves it as the current one. More... | |
def | get_poi_position (self, poikey=None) |
Returns the current position of the given poi, calculated from the POI coords in sample and the current sample position. More... | |
def | set_new_position (self, poikey=None, newpos=None) |
def | move_coords (self, poikey=None, newpos=None) |
Updates the coords of a given POI, and adds a position to the POI history, but DOES NOT update the sample position. | |
def | rename_poi (self, poikey=None, name=None, emit_change=True) |
Sets the name of the given poi. More... | |
def | start_periodic_refocus (self, poikey=None) |
Starts the perodic refocussing of the poi. More... | |
def | set_periodic_optimize_duration (self, duration=None) |
Change the duration of the periodic optimize timer during active periodic refocussing. More... | |
def | stop_periodic_refocus (self) |
Stops the perodic refocussing of the poi. More... | |
def | reset_roi (self) |
def | set_active_poi (self, poikey=None) |
Set the active POI object. | |
def | update_poi_tag_in_savelogic (self) |
def | save_poi_map_as_roi (self) |
Save a list of POIs with their coordinates to a file. | |
def | load_roi_from_file (self, filename=None) |
def | dict_to_poi_list (self, val) |
def | poi_list_to_dict (self, val) |
def | active_poi_to_dict (self, val) |
def | dict_to_active_poi (self, val) |
def | triangulate (self, r, a1, b1, c1, a2, b2, c2) |
Reorients a coordinate r that is known relative to reference points a1, b1, c1 to produce a new vector rnew that has exactly the same relation to rotated/shifted/tilted reference positions a2, b2, c2. More... | |
def | reorient_roi (self, ref1_coords, ref2_coords, ref3_coords, ref1_newpos, ref2_newpos, ref3_newpos) |
Move and rotate the ROI to a new position specified by the newpos of 3 reference POIs from the saved ROI. More... | |
def | autofind_pois (self, neighborhood_size=1, min_threshold=10000, max_threshold=1e6) |
Automatically search the xy scan image for POIs. More... | |
Public Attributes | |
go_to_crosshair_after_refocus | |
timer | |
time_left | |
timer_step | |
timer_duration | |
threadlock | |
roi_map_data | |
Static Public Attributes | |
optimizer1 = Connector(interface='OptimizerLogic') | |
scannerlogic = Connector(interface='ConfocalLogic') | |
savelogic = Connector(interface='SaveLogic') | |
poi_list = StatusVar(default=OrderedDict()) | |
roi_name = StatusVar(default='') | |
active_poi = StatusVar(default=None) | |
signal_timer_updated = QtCore.Signal() | |
signal_poi_updated = QtCore.Signal() | |
signal_poi_deleted = QtCore.Signal(str) | |
signal_confocal_image_updated = QtCore.Signal() | |
signal_periodic_opt_started = QtCore.Signal() | |
signal_periodic_opt_duration_changed = QtCore.Signal() | |
signal_periodic_opt_stopped = QtCore.Signal() | |
This is the Logic class for mapping and tracking bright features in the confocal scan.
def poi_manager_logic.PoiManagerLogic.add_poi | ( | self, | |
position = None , |
|||
key = None , |
|||
emit_change = True |
|||
) |
Creates a new poi and adds it to the list.
A position can be provided (such as during re-loading a saved ROI). If no position is provided, then the current crosshair position is used.
def poi_manager_logic.PoiManagerLogic.autofind_pois | ( | self, | |
neighborhood_size = 1 , |
|||
min_threshold = 10000 , |
|||
max_threshold = 1e6 |
|||
) |
Automatically search the xy scan image for POIs.
neighborhood_size | size in microns. Only the brightest POI per neighborhood will be found. |
min_threshold | POIs must have c/s above this threshold. |
max_threshold | POIs must have c/s below this threshold. |
def poi_manager_logic.PoiManagerLogic.delete_last_position | ( | self, | |
poikey = None |
|||
) |
Delete the last position in the history.
string | poikey: the key of the poi |
def poi_manager_logic.PoiManagerLogic.delete_poi | ( | self, | |
poikey = None |
|||
) |
Completely deletes the whole given poi.
string | poikey: the key of the poi |
Does not delete the crosshair and sample.
def poi_manager_logic.PoiManagerLogic.get_all_pois | ( | self, | |
abc_sort = False |
|||
) |
Returns a list of the names of all existing POIs.
Also crosshair and sample are included.
def poi_manager_logic.PoiManagerLogic.get_poi_position | ( | self, | |
poikey = None |
|||
) |
Returns the current position of the given poi, calculated from the POI coords in sample and the current sample position.
string | poikey: the key of the poi |
def poi_manager_logic.PoiManagerLogic.go_to_poi | ( | self, | |
poikey = None |
|||
) |
Goes to the given poi and saves it as the current one.
string | poikey: the key of the poi |
def poi_manager_logic.PoiManagerLogic.optimise_poi | ( | self, | |
poikey = None |
|||
) |
Starts the optimisation procedure for the given poi.
string | poikey: the key of the poi |
This is threaded, so it returns directly. The function _refocus_done handles the data when the optimisation returns.
def poi_manager_logic.PoiManagerLogic.rename_poi | ( | self, | |
poikey = None , |
|||
name = None , |
|||
emit_change = True |
|||
) |
Sets the name of the given poi.
string | poikey: the key of the poi |
string | name: name of the poi to be set |
def poi_manager_logic.PoiManagerLogic.reorient_roi | ( | self, | |
ref1_coords, | |||
ref2_coords, | |||
ref3_coords, | |||
ref1_newpos, | |||
ref2_newpos, | |||
ref3_newpos | |||
) |
Move and rotate the ROI to a new position specified by the newpos of 3 reference POIs from the saved ROI.
ref1_coords | coordinates (from ROI save file) of reference 1. |
ref2_coords | similar, ref2. |
ref3_coords | similar, ref3. |
ref1_newpos | the new (current) position of POI reference 1. |
ref2_newpos | similar, ref2. |
ref3_newpos | similar, ref3. |
def poi_manager_logic.PoiManagerLogic.set_periodic_optimize_duration | ( | self, | |
duration = None |
|||
) |
Change the duration of the periodic optimize timer during active periodic refocussing.
float | duration: (optional) the time between periodic optimization. |
def poi_manager_logic.PoiManagerLogic.start_periodic_refocus | ( | self, | |
poikey = None |
|||
) |
Starts the perodic refocussing of the poi.
float | duration: (optional) the time between periodic optimization |
string | poikey: (optional) the key of the poi to be set and refocussed on. |
def poi_manager_logic.PoiManagerLogic.stop_periodic_refocus | ( | self | ) |
Stops the perodic refocussing of the poi.
def poi_manager_logic.PoiManagerLogic.triangulate | ( | self, | |
r, | |||
a1, | |||
b1, | |||
c1, | |||
a2, | |||
b2, | |||
c2 | |||
) |
Reorients a coordinate r that is known relative to reference points a1, b1, c1 to produce a new vector rnew that has exactly the same relation to rotated/shifted/tilted reference positions a2, b2, c2.
np.array | r: position to be remapped. |
np.array | a1: initial location of ref1. |
np.array | a2: final location of ref1. |
np.array | b1, b2, c1, c2: similar for ref2 and ref3 |