diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 8a33f8f..48c84fb 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -27,6 +27,7 @@ class Slice(object): 'Update cursor position in slice') ps.Publisher().subscribe(self.UpdateCursorPositionSingleAxis, 'Update cursor single position in slice') + # General slice control ps.Publisher().subscribe(self.CreateSurfaceFromIndex, 'Create surface from index') @@ -55,10 +56,7 @@ class Slice(object): def __get_mask_data_for_surface_creation(self, pubsub_evt): mask_index = pubsub_evt.data CreateSurfaceFromIndex - - - - + def __add_mask(self, pubsub_evt): mask_name = pubsub_evt.data self.CreateMask(name=mask_name) @@ -280,6 +278,8 @@ class Slice(object): def GetOutput(self): return self.cast_filter.GetOutput() + + def SetInput(self, imagedata): self.imagedata = imagedata @@ -338,7 +338,6 @@ class Slice(object): self.cast_filter.Update() ps.Publisher().sendMessage('Update slice viewer') - def UpdateCursorPositionSingleAxis(self, pubsub_evt): axis_pos = pubsub_evt.data x, y, z = self.cross.GetCursorPosition() diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index 0e2180a..fa2269f 100755 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -36,7 +36,7 @@ class Viewer(wx.Panel): self.SetBackgroundColour(colour) # Interactor aditional style - self.modes = ['DEFAULT'] + self.modes = []#['DEFAULT'] self.mouse_pressed = 0 self.__init_gui() @@ -195,8 +195,10 @@ class Viewer(wx.Panel): for coord in pixels: ps.Publisher().sendMessage(evt_msg, coord) - self.OnCrossMove(None, None) - + # FIXME: This is idiot, but is the only way that brush operations are + # working when cross is disabled + ps.Publisher().sendMessage('Update slice viewer') + ps.Publisher().sendMessage('Update slice viewer') def OnBrushMove(self, obj, evt_vtk): coord = self.GetCoordinateCursor() @@ -216,6 +218,8 @@ class Viewer(wx.Panel): for coord in pixels: ps.Publisher().sendMessage(evt_msg, coord) self.interactor.Render() + ps.Publisher().sendMessage('Update slice viewer') + def OnCrossMove(self, obj, evt_vtk): coord = self.GetCoordinate() -- libgit2 0.21.2