Commit 356cada581f8dfa063a5b1a6e82c608021676ecd

Authored by Olli-Pekka Kahilakoski
1 parent 53accd20
Exists in master

FIX: Registering tracker location using pedal in calibration

invesalius/gui/dialogs.py
@@ -3553,13 +3553,14 @@ class ObjectCalibrationDialog(wx.Dialog): @@ -3553,13 +3553,14 @@ class ObjectCalibrationDialog(wx.Dialog):
3553 # Called when the button for setting the object fiducial is enabled and either pedal is pressed 3553 # Called when the button for setting the object fiducial is enabled and either pedal is pressed
3554 # or the button is pressed again. 3554 # or the button is pressed again.
3555 # 3555 #
3556 - def set_fiducial_callback():  
3557 - Publisher.sendMessage('Set object fiducial', fiducial_index=index)  
3558 - if self.pedal_connection is not None:  
3559 - self.pedal_connection.remove_callback('fiducial')  
3560 -  
3561 - ctrl.SetValue(False)  
3562 - self.object_fiducial_being_set = None 3556 + def set_fiducial_callback(state):
  3557 + if state:
  3558 + Publisher.sendMessage('Set object fiducial', fiducial_index=index)
  3559 + if self.pedal_connection is not None:
  3560 + self.pedal_connection.remove_callback('fiducial')
  3561 +
  3562 + ctrl.SetValue(False)
  3563 + self.object_fiducial_being_set = None
3563 3564
3564 if ctrl.GetValue(): 3565 if ctrl.GetValue():
3565 self.object_fiducial_being_set = index 3566 self.object_fiducial_being_set = index
invesalius/gui/task_navigator.py
@@ -684,14 +684,15 @@ class NeuronavigationPanel(wx.Panel): @@ -684,14 +684,15 @@ class NeuronavigationPanel(wx.Panel):
684 # Called when the button for setting the tracker fiducial is enabled and either pedal is pressed 684 # Called when the button for setting the tracker fiducial is enabled and either pedal is pressed
685 # or the button is pressed again. 685 # or the button is pressed again.
686 # 686 #
687 - def set_fiducial_callback():  
688 - fiducial_name = const.TRACKER_FIDUCIALS[n]['fiducial_name']  
689 - Publisher.sendMessage('Set tracker fiducial', fiducial_name=fiducial_name)  
690 - if self.pedal_connection is not None:  
691 - self.pedal_connection.remove_callback('fiducial')  
692 -  
693 - ctrl.SetValue(False)  
694 - self.tracker_fiducial_being_set = None 687 + def set_fiducial_callback(state):
  688 + if state:
  689 + fiducial_name = const.TRACKER_FIDUCIALS[n]['fiducial_name']
  690 + Publisher.sendMessage('Set tracker fiducial', fiducial_name=fiducial_name)
  691 + if self.pedal_connection is not None:
  692 + self.pedal_connection.remove_callback('fiducial')
  693 +
  694 + ctrl.SetValue(False)
  695 + self.tracker_fiducial_being_set = None
695 696
696 if ctrl.GetValue(): 697 if ctrl.GetValue():
697 self.tracker_fiducial_being_set = n 698 self.tracker_fiducial_being_set = n