From cf4a4dbc97bf175b1bb2f5c16053cbd1ff6ab729 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Wed, 4 Sep 2013 16:05:55 -0300 Subject: [PATCH] Added a new pubsub message to 'Set projection type' --- invesalius/data/slice_.py | 5 +++++ invesalius/data/viewer_slice.py | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 4f962f7..d1105a7 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -154,6 +154,7 @@ class Slice(object): Publisher.subscribe(self.UpdateColourTableBackgroundWidget,\ 'Change colour table from background image from widget') + Publisher.subscribe(self._set_projection_type, 'Set projection type') Publisher.subscribe(self.InputImageWidget, 'Input Image in the widget') @@ -824,6 +825,10 @@ class Slice(object): def GetOutput(self): return self.blend_filter.GetOutput() + def _set_projection_type(self, pubsub_evt): + tprojection = pubsub_evt.data + self.SetTypeProjection(tprojection) + def SetTypeProjection(self, tprojection): if self._type_projection != tprojection: if self._type_projection == const.PROJECTION_NORMAL: diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index 71fb3ef..fda085d 100755 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -1138,6 +1138,7 @@ class Viewer(wx.Panel): elif evt.GetKeyCode() in projections: print "PROJECTION MANOLO!" self.slice_.SetTypeProjection(projections[evt.GetKeyCode()]) + Publisher.sendMessage('Set projection type', projections[evt.GetKeyCode()]) self.ReloadActualSlice() self.UpdateSlice3D(pos) -- libgit2 0.21.2