diff --git a/.gitignore b/.gitignore index 92b5689..1a21d13 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ invesalius/gui/widgets/*.pyc invesalius/reader/*.log invesalius/reader/*.pyc +.idea + *.pyc *.swp *.so diff --git a/invesalius/data/coordinates.py b/invesalius/data/coordinates.py index daa0f0e..4635634 100644 --- a/invesalius/data/coordinates.py +++ b/invesalius/data/coordinates.py @@ -20,6 +20,7 @@ from math import sin, cos import numpy as np +from time import sleep from random import uniform @@ -211,7 +212,7 @@ def DebugCoord(trk_init, trck_id, ref_mode): :param trck_id: id of tracking device :return: six coordinates x, y, z, alfa, beta and gama """ - + sleep(0.2) if ref_mode: probe = np.array([uniform(1, 200), uniform(1, 200), uniform(1, 200), uniform(1, 200), uniform(1, 200), uniform(1, 200)]) diff --git a/invesalius/data/coregistration.py b/invesalius/data/coregistration.py index c82df2a..2098504 100644 --- a/invesalius/data/coregistration.py +++ b/invesalius/data/coregistration.py @@ -74,8 +74,8 @@ class Coregistration(threading.Thread): # TODO: Optimize the value of sleep for each tracking device. # Debug tracker is not working with 0.175 so changed to 0.2 # However, 0.2 is too low update frequency ~5 Hz. Need optimization URGENTLY. - sleep(.3) - # sleep(0.175) + #sleep(.3) + sleep(0.175) if self._pause_: return diff --git a/invesalius/data/viewer_volume.py b/invesalius/data/viewer_volume.py index 5fa6bca..dfd3602 100755 --- a/invesalius/data/viewer_volume.py +++ b/invesalius/data/viewer_volume.py @@ -674,7 +674,8 @@ class Viewer(wx.Panel): # Need to be outside condition for sphere marker position update # self.ren.ResetCameraClippingRange() # self.ren.ResetCamera() - self.interactor.Render() + #self.interactor.Render() + self.Refresh() def OnExportSurface(self, pubsub_evt): filename, filetype = pubsub_evt.data diff --git a/invesalius/gui/task_navigator.py b/invesalius/gui/task_navigator.py index ad8f8eb..73c786f 100644 --- a/invesalius/gui/task_navigator.py +++ b/invesalius/gui/task_navigator.py @@ -141,7 +141,7 @@ class InnerFoldPanel(wx.Panel): fold_panel.AddFoldPanelWindow(item, mtw, Spacing= 0, leftSpacing=0, rightSpacing=0) - + # Check box for camera update in volume rendering during navigation tooltip = wx.ToolTip(_("Update camera in volume")) checkcamera = wx.CheckBox(self, -1, _('Volume camera')) @@ -174,7 +174,7 @@ class InnerFoldPanel(wx.Panel): self.SetSizer(sizer) self.Update() self.SetAutoLayout(1) - + def UpdateExternalTrigger(self, evt, ctrl): Publisher.sendMessage('Update trigger state', ctrl.GetValue()) @@ -633,23 +633,28 @@ class MarkersPanel(wx.Panel): for id_n in range(self.lc.GetItemCount()): item = self.lc.GetItem(id_n, 4) if item.GetText() == marker_id: - if marker_id == "LEI" or marker_id == "REI" or marker_id == "NAI": - self.lc.Focus(item.GetId()) - break + for i in const.BTNS_IMG: + if marker_id in const.BTNS_IMG[i].values()[0]: + self.lc.Focus(item.GetId()) + break + self.DeleteMarker() else: - if self.lc.GetFocusedItem() is not -1 and self.lc.GetItemCount(): - index = self.lc.GetFocusedItem() - del self.list_coord[index] - self.lc.DeleteItem(index) - for n in range(0, self.lc.GetItemCount()): - self.lc.SetStringItem(n, 0, str(n+1)) - self.marker_ind -= 1 - Publisher.sendMessage('Remove marker', index) + if self.lc.GetFocusedItem() is not -1: + self.DeleteMarker() elif not self.lc.GetItemCount(): pass else: dlg.NoMarkerSelected() + def DeleteMarker(self): + index = self.lc.GetFocusedItem() + del self.list_coord[index] + self.lc.DeleteItem(index) + for n in range(0, self.lc.GetItemCount()): + self.lc.SetStringItem(n, 0, str(n+1)) + self.marker_ind -= 1 + Publisher.sendMessage('Remove marker', index) + def OnCreateMarker(self, evt): # OnCreateMarker is used for both pubsub and button click events # Pubsub is used for markers created with fiducial buttons, trigger and create marker button @@ -674,8 +679,9 @@ class MarkersPanel(wx.Panel): size = float(line[6]) if len(line) == 8: - if line[7] == "LEI" or line[7] == "REI" or line[7] == "NAI": - Publisher.sendMessage('Load image fiducials', (line[7], coord)) + for i in const.BTNS_IMG: + if line[7] in const.BTNS_IMG[i].values()[0]: + Publisher.sendMessage('Load image fiducials', (line[7], coord)) else: line.append("") self.CreateMarker(coord, colour, size, line[7]) @@ -690,7 +696,7 @@ class MarkersPanel(wx.Panel): else: Publisher.sendMessage('Show all markers', self.lc.GetItemCount()) ctrl.SetLabel('Hide') - + def OnSaveMarkers(self, evt): filename = dlg.ShowSaveMarkersDialog("markers.txt") if filename: @@ -709,7 +715,7 @@ class MarkersPanel(wx.Panel): text_file.writelines(line) text_file.close() - + def OnSelectColour(self, evt, ctrl): self.marker_colour = [colour/255.0 for colour in ctrl.GetValue()] -- libgit2 0.21.2