Commit 14a26332a515904308eeed6e625cf3d9f8178731
1 parent
ae401042
Exists in
master
and in
68 other branches
ADD: adding of the code window and level for the 2D
Showing
1 changed file
with
19 additions
and
7 deletions
Show diff stats
invesalius/data/viewer_slice.py
| ... | ... | @@ -137,13 +137,18 @@ class Viewer(wx.Panel): |
| 137 | 137 | "RightButtonReleaseEvent":self.OnUnZoom |
| 138 | 138 | }, |
| 139 | 139 | 'ZOOMSELECT':{ |
| 140 | - "RightButtonReleaseEvent":self.OnUnZoom | |
| 140 | + "RightButtonReleaseEvent":self.OnUnZoom | |
| 141 | 141 | }, |
| 142 | 142 | 'CHANGESLICE':{ |
| 143 | - "MouseMoveEvent": self.OnChangeSliceMove, | |
| 144 | - "LeftButtonPressEvent": self.OnChangeSliceClick, | |
| 145 | - "LeftButtonReleaseEvent": self.OnReleaseModes | |
| 146 | - } | |
| 143 | + "MouseMoveEvent": self.OnChangeSliceMove, | |
| 144 | + "LeftButtonPressEvent": self.OnChangeSliceClick, | |
| 145 | + "LeftButtonReleaseEvent": self.OnReleaseModes | |
| 146 | + }, | |
| 147 | + 'WINDOWLEVEL':{ | |
| 148 | + "MouseMoveEvent": self.OnWindowLevelMove, | |
| 149 | + "LeftButtonPressEvent": self.OnWindowLevelClick, | |
| 150 | + "LeftButtonReleaseEvent": self.OnReleaseModes | |
| 151 | + } | |
| 147 | 152 | } |
| 148 | 153 | |
| 149 | 154 | # Bind method according to current mode |
| ... | ... | @@ -189,14 +194,21 @@ class Viewer(wx.Panel): |
| 189 | 194 | self.interactor.SetCursor(wx.CursorFromImage(ICON_IMAGE)) |
| 190 | 195 | |
| 191 | 196 | def WindowLevelMode(self, pubsub_evt): |
| 192 | - #self.append_mode('WINDOWLEVEL') | |
| 193 | - print "Window And Level" | |
| 197 | + self.append_mode('WINDOWLEVEL') | |
| 198 | + proj = project.Project() | |
| 199 | + self.interactor.Render() | |
| 194 | 200 | |
| 195 | 201 | def ChangeSliceMode(self, pubsub_evt): |
| 196 | 202 | self.append_mode('CHANGESLICE') |
| 197 | 203 | self.mouse_pressed = 0 |
| 198 | 204 | self.interactor.SetCursor(wx.StockCursor(wx.CURSOR_SIZENS)) |
| 199 | 205 | |
| 206 | + def OnWindowLevelMove(self, evt, obj): | |
| 207 | + print 'Move...' | |
| 208 | + | |
| 209 | + def OnWindowLevelClick(self, evt, obj): | |
| 210 | + print 'Click' | |
| 211 | + | |
| 200 | 212 | def OnChangeSliceMove(self, evt, obj): |
| 201 | 213 | |
| 202 | 214 | min = 0 | ... | ... |