Commit 9c39f5859ed709a1a1887c8d6715df7bc5530a06
1 parent
7932b13b
Exists in
master
and in
68 other branches
ENH: Removed the unused cross in slice_
Showing
1 changed file
with
2 additions
and
54 deletions
Show diff stats
invesalius/data/slice_.py
@@ -16,8 +16,6 @@ | @@ -16,8 +16,6 @@ | ||
16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais | 16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
17 | # detalhes. | 17 | # detalhes. |
18 | #-------------------------------------------------------------------------- | 18 | #-------------------------------------------------------------------------- |
19 | -import random | ||
20 | - | ||
21 | import vtk | 19 | import vtk |
22 | import wx.lib.pubsub as ps | 20 | import wx.lib.pubsub as ps |
23 | 21 | ||
@@ -47,12 +45,6 @@ class Slice(object): | @@ -47,12 +45,6 @@ class Slice(object): | ||
47 | self.__bind_events() | 45 | self.__bind_events() |
48 | 46 | ||
49 | def __bind_events(self): | 47 | def __bind_events(self): |
50 | - # Slice properties | ||
51 | - ps.Publisher().subscribe(self.UpdateCursorPosition, | ||
52 | - 'Update cursor position in slice') | ||
53 | - ps.Publisher().subscribe(self.UpdateCursorPositionSingleAxis, | ||
54 | - 'Update cursor single position in slice') | ||
55 | - | ||
56 | # General slice control | 48 | # General slice control |
57 | ps.Publisher().subscribe(self.CreateSurfaceFromIndex, | 49 | ps.Publisher().subscribe(self.CreateSurfaceFromIndex, |
58 | 'Create surface from index') | 50 | 'Create surface from index') |
@@ -83,21 +75,18 @@ class Slice(object): | @@ -83,21 +75,18 @@ class Slice(object): | ||
83 | 75 | ||
84 | ps.Publisher().subscribe(self.UpdateColourTableBackground,\ | 76 | ps.Publisher().subscribe(self.UpdateColourTableBackground,\ |
85 | 'Change colour table from background image') | 77 | 'Change colour table from background image') |
86 | - | 78 | + |
87 | ps.Publisher().subscribe(self.InputImageWidget, 'Input Image in the widget') | 79 | ps.Publisher().subscribe(self.InputImageWidget, 'Input Image in the widget') |
88 | ps.Publisher().subscribe(self.OnExportMask,'Export mask to file') | 80 | ps.Publisher().subscribe(self.OnExportMask,'Export mask to file') |
89 | 81 | ||
90 | ps.Publisher().subscribe(self.OnCloseProject, 'Close project data') | 82 | ps.Publisher().subscribe(self.OnCloseProject, 'Close project data') |
91 | 83 | ||
92 | - | ||
93 | - | ||
94 | ps.Publisher().subscribe(self.OnEnableStyle, 'Enable style') | 84 | ps.Publisher().subscribe(self.OnEnableStyle, 'Enable style') |
95 | ps.Publisher().subscribe(self.OnDisableStyle, 'Disable style') | 85 | ps.Publisher().subscribe(self.OnDisableStyle, 'Disable style') |
96 | 86 | ||
97 | ps.Publisher().subscribe(self.OnRemoveMasks, 'Remove masks') | 87 | ps.Publisher().subscribe(self.OnRemoveMasks, 'Remove masks') |
98 | ps.Publisher().subscribe(self.OnDuplicateMasks, 'Duplicate masks') | 88 | ps.Publisher().subscribe(self.OnDuplicateMasks, 'Duplicate masks') |
99 | 89 | ||
100 | - | ||
101 | def OnRemoveMasks(self, pubsub_evt): | 90 | def OnRemoveMasks(self, pubsub_evt): |
102 | selected_items = pubsub_evt.data | 91 | selected_items = pubsub_evt.data |
103 | proj = Project() | 92 | proj = Project() |
@@ -420,9 +409,7 @@ class Slice(object): | @@ -420,9 +409,7 @@ class Slice(object): | ||
420 | edited_points, overwrite_surface)) | 409 | edited_points, overwrite_surface)) |
421 | 410 | ||
422 | def GetOutput(self): | 411 | def GetOutput(self): |
423 | - return self.cross.GetOutput() | ||
424 | - | ||
425 | - | 412 | + return self.blend_filter.GetOutput() |
426 | 413 | ||
427 | def SetInput(self, imagedata, mask_dict): | 414 | def SetInput(self, imagedata, mask_dict): |
428 | self.imagedata = imagedata | 415 | self.imagedata = imagedata |
@@ -435,7 +422,6 @@ class Slice(object): | @@ -435,7 +422,6 @@ class Slice(object): | ||
435 | else: | 422 | else: |
436 | self.__load_masks(imagedata, mask_dict) | 423 | self.__load_masks(imagedata, mask_dict) |
437 | imagedata_mask = self.img_colours_mask.GetOutput() | 424 | imagedata_mask = self.img_colours_mask.GetOutput() |
438 | - | ||
439 | 425 | ||
440 | mask_opacity = self.current_mask.opacity | 426 | mask_opacity = self.current_mask.opacity |
441 | 427 | ||
@@ -453,47 +439,9 @@ class Slice(object): | @@ -453,47 +439,9 @@ class Slice(object): | ||
453 | blend_filter.GetOutput().ReleaseDataFlagOn() | 439 | blend_filter.GetOutput().ReleaseDataFlagOn() |
454 | self.blend_filter = blend_filter | 440 | self.blend_filter = blend_filter |
455 | 441 | ||
456 | - # global values | ||
457 | - CURSOR_X = -1 # SAGITAL | ||
458 | - CURSOR_Y = -1 # CORONAL | ||
459 | - CURSOR_Z = -1 # AXIAL | ||
460 | - | ||
461 | - CURSOR_VALUE = 4095 | ||
462 | - CURSOR_RADIUS = 1000 | ||
463 | - | ||
464 | - cross = vtk.vtkImageCursor3D() | ||
465 | - cross.GetOutput().ReleaseDataFlagOn() | ||
466 | - cross.SetInput(blend_filter.GetOutput()) | ||
467 | - cross.SetCursorPosition(CURSOR_X, CURSOR_Y, CURSOR_Z) | ||
468 | - cross.SetCursorValue(CURSOR_VALUE) | ||
469 | - cross.SetCursorRadius(CURSOR_RADIUS) | ||
470 | - cross.Modified() | ||
471 | - self.cross = cross | ||
472 | - | ||
473 | self.window_level = vtk.vtkImageMapToWindowLevelColors() | 442 | self.window_level = vtk.vtkImageMapToWindowLevelColors() |
474 | self.window_level.SetInput(self.imagedata) | 443 | self.window_level.SetInput(self.imagedata) |
475 | 444 | ||
476 | - | ||
477 | - def UpdateCursorPosition(self, pubsub_evt): | ||
478 | - | ||
479 | - new_pos = pubsub_evt.data | ||
480 | - self.cross.SetCursorPosition(new_pos) | ||
481 | - self.cross.Modified() | ||
482 | - self.cross.Update() | ||
483 | - ps.Publisher().sendMessage('Update slice viewer') | ||
484 | - | ||
485 | - def UpdateCursorPositionSingleAxis(self, pubsub_evt): | ||
486 | - axis_pos = pubsub_evt.data | ||
487 | - x, y, z = self.cross.GetCursorPosition() | ||
488 | - new_pos = [x,y,z] | ||
489 | - for key in axis_pos: | ||
490 | - new_pos[key] = axis_pos[key] | ||
491 | - self.cross.SetCursorPosition(new_pos) | ||
492 | - self.cross.Modified() | ||
493 | - self.cross.Update() | ||
494 | - ps.Publisher().sendMessage('Update slice viewer') | ||
495 | - | ||
496 | - | ||
497 | def __create_background(self, imagedata): | 445 | def __create_background(self, imagedata): |
498 | self.imagedata = imagedata | 446 | self.imagedata = imagedata |
499 | 447 |