Commit cf4a4dbc97bf175b1bb2f5c16053cbd1ff6ab729
1 parent
7bcf6df2
Exists in
master
and in
56 other branches
Added a new pubsub message to 'Set projection type'
Showing
2 changed files
with
6 additions
and
0 deletions
Show diff stats
invesalius/data/slice_.py
| @@ -154,6 +154,7 @@ class Slice(object): | @@ -154,6 +154,7 @@ class Slice(object): | ||
| 154 | 154 | ||
| 155 | Publisher.subscribe(self.UpdateColourTableBackgroundWidget,\ | 155 | Publisher.subscribe(self.UpdateColourTableBackgroundWidget,\ |
| 156 | 'Change colour table from background image from widget') | 156 | 'Change colour table from background image from widget') |
| 157 | + Publisher.subscribe(self._set_projection_type, 'Set projection type') | ||
| 157 | 158 | ||
| 158 | Publisher.subscribe(self.InputImageWidget, 'Input Image in the widget') | 159 | Publisher.subscribe(self.InputImageWidget, 'Input Image in the widget') |
| 159 | 160 | ||
| @@ -824,6 +825,10 @@ class Slice(object): | @@ -824,6 +825,10 @@ class Slice(object): | ||
| 824 | def GetOutput(self): | 825 | def GetOutput(self): |
| 825 | return self.blend_filter.GetOutput() | 826 | return self.blend_filter.GetOutput() |
| 826 | 827 | ||
| 828 | + def _set_projection_type(self, pubsub_evt): | ||
| 829 | + tprojection = pubsub_evt.data | ||
| 830 | + self.SetTypeProjection(tprojection) | ||
| 831 | + | ||
| 827 | def SetTypeProjection(self, tprojection): | 832 | def SetTypeProjection(self, tprojection): |
| 828 | if self._type_projection != tprojection: | 833 | if self._type_projection != tprojection: |
| 829 | if self._type_projection == const.PROJECTION_NORMAL: | 834 | if self._type_projection == const.PROJECTION_NORMAL: |
invesalius/data/viewer_slice.py
| @@ -1138,6 +1138,7 @@ class Viewer(wx.Panel): | @@ -1138,6 +1138,7 @@ class Viewer(wx.Panel): | ||
| 1138 | elif evt.GetKeyCode() in projections: | 1138 | elif evt.GetKeyCode() in projections: |
| 1139 | print "PROJECTION MANOLO!" | 1139 | print "PROJECTION MANOLO!" |
| 1140 | self.slice_.SetTypeProjection(projections[evt.GetKeyCode()]) | 1140 | self.slice_.SetTypeProjection(projections[evt.GetKeyCode()]) |
| 1141 | + Publisher.sendMessage('Set projection type', projections[evt.GetKeyCode()]) | ||
| 1141 | self.ReloadActualSlice() | 1142 | self.ReloadActualSlice() |
| 1142 | 1143 | ||
| 1143 | self.UpdateSlice3D(pos) | 1144 | self.UpdateSlice3D(pos) |