diff --git a/invesalius/control.py b/invesalius/control.py index c142044..abef7c0 100755 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -248,9 +248,6 @@ class Controller(): mask._set_class_index(proj.last_mask_index) self.mask_dict_copy = proj.mask_dict.copy() - surface = srf.Surface() - surface._set_class_index(proj.last_surface_index) - self.LoadProject() Publisher.sendMessage('Update threshold limits', diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py index c7e19d6..5eb7310 100644 --- a/invesalius/data/surface.py +++ b/invesalius/data/surface.py @@ -315,13 +315,12 @@ class SurfaceManager(): # self.actors_dict. proj = prj.Project() surface = proj.surface_dict[index] - if surface.is_shown: - Publisher.sendMessage('Update surface info in GUI', - (index, surface.name, - surface.colour, surface.volume, - surface.transparency)) + Publisher.sendMessage('Update surface info in GUI', + (index, surface.name, + surface.colour, surface.volume, + surface.transparency)) self.last_surface_index = index - #self.ShowActor(index, True) + self.ShowActor(index, True) def OnLoadSurfaceDict(self, pubsub_evt): diff --git a/invesalius/gui/data_notebook.py b/invesalius/gui/data_notebook.py index 63f90f3..7344c74 100644 --- a/invesalius/gui/data_notebook.py +++ b/invesalius/gui/data_notebook.py @@ -685,10 +685,9 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): def __bind_events_wx(self): self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) self.Bind(wx.EVT_LIST_END_LABEL_EDIT, self.OnEditLabel) - self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected_) + #self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected_) self.Bind(wx.EVT_KEY_UP, self.OnKeyEvent) - def OnKeyEvent(self, event): keycode = event.GetKeyCode() # Delete key @@ -697,13 +696,11 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): elif (keycode == wx.WXK_DELETE): self.RemoveSurfaces() - def OnHideSurface(self, pubsub_evt): surface_dict = pubsub_evt.data for key in surface_dict: if not surface_dict[key].is_shown: self.SetItemImage(key, False) - def RemoveSurfaces(self): """ @@ -729,7 +726,6 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): else: dlg.SurfaceSelectionRequiredForRemoval() - def OnCloseProject(self, pubsub_evt): self.DeleteAllItems() self.surface_list_index = {} @@ -790,7 +786,6 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): self.image_gray = Image.open("../icons/object_colour.jpg") - def OnEditLabel(self, evt): Publisher.sendMessage('Change surface name', (evt.GetIndex(), evt.GetLabel())) evt.Skip() @@ -798,7 +793,6 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): def OnItemActivated(self, evt): self.ToggleItem(evt.m_itemIndex) evt.Skip() - def OnCheckItem(self, index, flag): Publisher.sendMessage('Show surface', (index, flag)) @@ -836,8 +830,6 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): if index not in self.surface_list_index: image = self.CreateColourBitmap(colour) image_index = self.imagelist.Add(image) - - index_list = self.surface_list_index.keys() self.surface_list_index[index] = image_index @@ -847,8 +839,6 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): else: self.InsertNewItem(index, name, volume, transparency, colour) - - def InsertNewItem(self, index=0, label="Surface 1", volume="0 mm3", transparency="0%%", colour=None): self.InsertStringItem(index, "") @@ -865,7 +855,6 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): self.SetStringItem(index, 2, volume) self.SetStringItem(index, 3, transparency) self.SetItemImage(index, 1) - def CreateColourBitmap(self, colour): """ diff --git a/invesalius/project.py b/invesalius/project.py index b434673..4aee827 100755 --- a/invesalius/project.py +++ b/invesalius/project.py @@ -303,13 +303,13 @@ class Project(object): m = msk.Mask() m.OpenPList(filepath) self.mask_dict[m.index] = m - self.surface_dict = {} # Opening the surfaces + self.surface_dict = {} for index in project["surfaces"]: filename = project["surfaces"][index] filepath = os.path.join(dirpath, filename) - s = srf.Surface() + s = srf.Surface(int(index)) s.OpenPList(filepath) self.surface_dict[s.index] = s @@ -322,7 +322,6 @@ class Project(object): measure.Load(measurements[index]) self.measurement_dict[int(index)] = measure - def Compress(folder, filename): tmpdir, tmpdir_ = os.path.split(folder) current_dir = os.path.abspath(".") -- libgit2 0.21.2