Qudi
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
poi_manager_logic.PoiManagerLogic Class Reference

This is the Logic class for mapping and tracking bright features in the confocal scan. More...

Inheritance diagram for poi_manager_logic.PoiManagerLogic:
Inheritance graph
[legend]
Collaboration diagram for poi_manager_logic.PoiManagerLogic:
Collaboration graph
[legend]

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()
 

Detailed Description

This is the Logic class for mapping and tracking bright features in the confocal scan.

Member Function Documentation

◆ add_poi()

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.

Returns
int: key of this new poi

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.

◆ autofind_pois()

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.

Parameters
neighborhood_sizesize in microns. Only the brightest POI per neighborhood will be found.
min_thresholdPOIs must have c/s above this threshold.
max_thresholdPOIs must have c/s below this threshold.

◆ delete_last_position()

def poi_manager_logic.PoiManagerLogic.delete_last_position (   self,
  poikey = None 
)

Delete the last position in the history.

Parameters
stringpoikey: the key of the poi
Returns
int: error code (0:OK, -1:error)

◆ delete_poi()

def poi_manager_logic.PoiManagerLogic.delete_poi (   self,
  poikey = None 
)

Completely deletes the whole given poi.

Parameters
stringpoikey: the key of the poi
Returns
int: error code (0:OK, -1:error)

Does not delete the crosshair and sample.

◆ get_all_pois()

def poi_manager_logic.PoiManagerLogic.get_all_pois (   self,
  abc_sort = False 
)

Returns a list of the names of all existing POIs.

Returns
string[]: List of names of the POIs

Also crosshair and sample are included.

◆ get_poi_position()

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.

Parameters
stringpoikey: the key of the poi
Returns

◆ go_to_poi()

def poi_manager_logic.PoiManagerLogic.go_to_poi (   self,
  poikey = None 
)

Goes to the given poi and saves it as the current one.

Parameters
stringpoikey: the key of the poi
Returns
int: error code (0:OK, -1:error)

◆ optimise_poi()

def poi_manager_logic.PoiManagerLogic.optimise_poi (   self,
  poikey = None 
)

Starts the optimisation procedure for the given poi.

Parameters
stringpoikey: the key of the poi
Returns
int: error code (0:OK, -1:error)

This is threaded, so it returns directly. The function _refocus_done handles the data when the optimisation returns.

◆ rename_poi()

def poi_manager_logic.PoiManagerLogic.rename_poi (   self,
  poikey = None,
  name = None,
  emit_change = True 
)

Sets the name of the given poi.

Parameters
stringpoikey: the key of the poi
stringname: name of the poi to be set
Returns
int: error code (0:OK, -1:error)

◆ reorient_roi()

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.

Parameters
ref1_coordscoordinates (from ROI save file) of reference 1.
ref2_coordssimilar, ref2.
ref3_coordssimilar, ref3.
ref1_newposthe new (current) position of POI reference 1.
ref2_newpossimilar, ref2.
ref3_newpossimilar, ref3.

◆ set_periodic_optimize_duration()

def poi_manager_logic.PoiManagerLogic.set_periodic_optimize_duration (   self,
  duration = None 
)

Change the duration of the periodic optimize timer during active periodic refocussing.

Parameters
floatduration: (optional) the time between periodic optimization.

◆ start_periodic_refocus()

def poi_manager_logic.PoiManagerLogic.start_periodic_refocus (   self,
  poikey = None 
)

Starts the perodic refocussing of the poi.

Parameters
floatduration: (optional) the time between periodic optimization
stringpoikey: (optional) the key of the poi to be set and refocussed on.
Returns
int: error code (0:OK, -1:error)

◆ stop_periodic_refocus()

def poi_manager_logic.PoiManagerLogic.stop_periodic_refocus (   self)

Stops the perodic refocussing of the poi.

Returns
int: error code (0:OK, -1:error)

◆ triangulate()

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.

Parameters
np.arrayr: position to be remapped.
np.arraya1: initial location of ref1.
np.arraya2: final location of ref1.
np.arrayb1, b2, c1, c2: similar for ref2 and ref3

The documentation for this class was generated from the following file: