Commit 6a51200e2b07c67702d9359d05f4de1d4093441d
1 parent
b87bcfe2
Exists in
master
and in
6 other branches
FIX: Added comentary in the TestOperationPosition method and removed some blank lines
Showing
1 changed file
with
3 additions
and
10 deletions
Show diff stats
invesalius/data/viewer_slice.py
@@ -224,7 +224,6 @@ class Viewer(wx.Panel): | @@ -224,7 +224,6 @@ class Viewer(wx.Panel): | ||
224 | self.interactor.Render() | 224 | self.interactor.Render() |
225 | ps.Publisher().sendMessage('Update slice viewer') | 225 | ps.Publisher().sendMessage('Update slice viewer') |
226 | 226 | ||
227 | - | ||
228 | def OnCrossMove(self, obj, evt_vtk): | 227 | def OnCrossMove(self, obj, evt_vtk): |
229 | coord = self.GetCoordinate() | 228 | coord = self.GetCoordinate() |
230 | # Update position in other slices | 229 | # Update position in other slices |
@@ -238,9 +237,7 @@ class Viewer(wx.Panel): | @@ -238,9 +237,7 @@ class Viewer(wx.Panel): | ||
238 | ps.Publisher().sendMessage(('Set scroll position', 'AXIAL'), | 237 | ps.Publisher().sendMessage(('Set scroll position', 'AXIAL'), |
239 | coord[2]) | 238 | coord[2]) |
240 | 239 | ||
241 | - | ||
242 | def GetCoordinate(self): | 240 | def GetCoordinate(self): |
243 | - | ||
244 | # Find position | 241 | # Find position |
245 | mouse_x, mouse_y = self.interactor.GetEventPosition() | 242 | mouse_x, mouse_y = self.interactor.GetEventPosition() |
246 | self.pick.Pick(mouse_x, mouse_y, 0, self.ren) | 243 | self.pick.Pick(mouse_x, mouse_y, 0, self.ren) |
@@ -281,7 +278,6 @@ class Viewer(wx.Panel): | @@ -281,7 +278,6 @@ class Viewer(wx.Panel): | ||
281 | return coord | 278 | return coord |
282 | 279 | ||
283 | def GetCoordinateCursor(self): | 280 | def GetCoordinateCursor(self): |
284 | - | ||
285 | # Find position | 281 | # Find position |
286 | mouse_x, mouse_y = self.interactor.GetEventPosition() | 282 | mouse_x, mouse_y = self.interactor.GetEventPosition() |
287 | self.pick.Pick(mouse_x, mouse_y, 0, self.ren) | 283 | self.pick.Pick(mouse_x, mouse_y, 0, self.ren) |
@@ -289,7 +285,6 @@ class Viewer(wx.Panel): | @@ -289,7 +285,6 @@ class Viewer(wx.Panel): | ||
289 | return x, y, z | 285 | return x, y, z |
290 | 286 | ||
291 | def GetCoordinateCursorEdition(self): | 287 | def GetCoordinateCursorEdition(self): |
292 | - | ||
293 | # Find position | 288 | # Find position |
294 | mouse_x, mouse_y = self.interactor.GetEventPosition() | 289 | mouse_x, mouse_y = self.interactor.GetEventPosition() |
295 | self.pick.Pick(mouse_x, mouse_y, 0, self.ren) | 290 | self.pick.Pick(mouse_x, mouse_y, 0, self.ren) |
@@ -349,7 +344,6 @@ class Viewer(wx.Panel): | @@ -349,7 +344,6 @@ class Viewer(wx.Panel): | ||
349 | self.SetInput(imagedata) | 344 | self.SetInput(imagedata) |
350 | 345 | ||
351 | def SetInput(self, imagedata): | 346 | def SetInput(self, imagedata): |
352 | - | ||
353 | self.imagedata = imagedata | 347 | self.imagedata = imagedata |
354 | 348 | ||
355 | ren = self.ren | 349 | ren = self.ren |
@@ -434,7 +428,6 @@ class Viewer(wx.Panel): | @@ -434,7 +428,6 @@ class Viewer(wx.Panel): | ||
434 | self.ren.Render() | 428 | self.ren.Render() |
435 | 429 | ||
436 | def __update_display_extent(self): | 430 | def __update_display_extent(self): |
437 | - | ||
438 | pos = self.slice_number | 431 | pos = self.slice_number |
439 | e = self.imagedata.GetWholeExtent() | 432 | e = self.imagedata.GetWholeExtent() |
440 | 433 | ||
@@ -479,6 +472,9 @@ class Viewer(wx.Panel): | @@ -479,6 +472,9 @@ class Viewer(wx.Panel): | ||
479 | self.interactor.Render() | 472 | self.interactor.Render() |
480 | 473 | ||
481 | def TestOperationPosition(self, coord): | 474 | def TestOperationPosition(self, coord): |
475 | + """ | ||
476 | + Test if coord is into the imagedata limits. | ||
477 | + """ | ||
482 | x, y, z = coord | 478 | x, y, z = coord |
483 | xi, yi, zi = 0, 0, 0 | 479 | xi, yi, zi = 0, 0, 0 |
484 | xf, yf, zf = self.imagedata.GetDimensions() | 480 | xf, yf, zf = self.imagedata.GetDimensions() |
@@ -487,6 +483,3 @@ class Viewer(wx.Panel): | @@ -487,6 +483,3 @@ class Viewer(wx.Panel): | ||
487 | and zi <= z <= zf: | 483 | and zi <= z <= zf: |
488 | return True | 484 | return True |
489 | return False | 485 | return False |
490 | - | ||
491 | - | ||
492 | - |