Commit 4054e4ec4ad86d11838c4f0d3fee4a2f8630ec0d
1 parent
55ce1205
Exists in
master
Review comments: Fix bugs in NeuronavigationPanel when closing project
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
invesalius/gui/task_navigator.py
... | ... | @@ -561,7 +561,7 @@ class Tracker(): |
561 | 561 | # TODO: const.DISCTRACK is not a tracker, so discoupling it from the actual trackers |
562 | 562 | # would make this cleaner. |
563 | 563 | # |
564 | - elif new_tracker == const.DISCTRACK and trck: | |
564 | + elif new_tracker == const.DISCTRACK: | |
565 | 565 | self.ResetTrackerFiducials() |
566 | 566 | Publisher.sendMessage('Update status text in GUI', |
567 | 567 | label=_("Disconnecting tracker ...")) |
... | ... | @@ -1106,10 +1106,9 @@ class NeuronavigationPanel(wx.Panel): |
1106 | 1106 | else: |
1107 | 1107 | btn_nav.SetValue(False) |
1108 | 1108 | |
1109 | - def ResetImageFiducials(self): | |
1109 | + def ResetUI(self): | |
1110 | 1110 | for m in range(0, 3): |
1111 | 1111 | self.btns_coord[m].SetValue(False) |
1112 | - self.fiducials[m, :] = [np.nan, np.nan, np.nan] | |
1113 | 1112 | for n in range(0, 3): |
1114 | 1113 | self.numctrls_coord[m][n].SetValue(0.0) |
1115 | 1114 | |
... | ... | @@ -1118,10 +1117,8 @@ class NeuronavigationPanel(wx.Panel): |
1118 | 1117 | self.UpdateFiducialRegistrationError() |
1119 | 1118 | |
1120 | 1119 | def OnCloseProject(self): |
1121 | - self.ResetTrackerFiducials() | |
1122 | - self.ResetImageFiducials() | |
1123 | - self.navigation.ResetICP() | |
1124 | 1120 | self.OnChooseTracker(False, self.select_tracker_elem) |
1121 | + self.ResetUI() | |
1125 | 1122 | Publisher.sendMessage('Update object registration') |
1126 | 1123 | Publisher.sendMessage('Update track object state', flag=False, obj_name=False) |
1127 | 1124 | Publisher.sendMessage('Delete all markers') |
... | ... | @@ -1130,6 +1127,9 @@ class NeuronavigationPanel(wx.Panel): |
1130 | 1127 | Publisher.sendMessage("Set cross visibility", visibility=0) |
1131 | 1128 | # TODO: Reset camera initial focus |
1132 | 1129 | Publisher.sendMessage('Reset cam clipping range') |
1130 | + self.navigation.StopNavigation() | |
1131 | + self.navigation.__init__() | |
1132 | + self.tracker.__init__() | |
1133 | 1133 | |
1134 | 1134 | |
1135 | 1135 | class ObjectRegistrationPanel(wx.Panel): | ... | ... |