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 | 16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
17 | 17 | # detalhes. |
18 | 18 | #-------------------------------------------------------------------------- |
19 | -import random | |
20 | - | |
21 | 19 | import vtk |
22 | 20 | import wx.lib.pubsub as ps |
23 | 21 | |
... | ... | @@ -47,12 +45,6 @@ class Slice(object): |
47 | 45 | self.__bind_events() |
48 | 46 | |
49 | 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 | 48 | # General slice control |
57 | 49 | ps.Publisher().subscribe(self.CreateSurfaceFromIndex, |
58 | 50 | 'Create surface from index') |
... | ... | @@ -83,21 +75,18 @@ class Slice(object): |
83 | 75 | |
84 | 76 | ps.Publisher().subscribe(self.UpdateColourTableBackground,\ |
85 | 77 | 'Change colour table from background image') |
86 | - | |
78 | + | |
87 | 79 | ps.Publisher().subscribe(self.InputImageWidget, 'Input Image in the widget') |
88 | 80 | ps.Publisher().subscribe(self.OnExportMask,'Export mask to file') |
89 | 81 | |
90 | 82 | ps.Publisher().subscribe(self.OnCloseProject, 'Close project data') |
91 | 83 | |
92 | - | |
93 | - | |
94 | 84 | ps.Publisher().subscribe(self.OnEnableStyle, 'Enable style') |
95 | 85 | ps.Publisher().subscribe(self.OnDisableStyle, 'Disable style') |
96 | 86 | |
97 | 87 | ps.Publisher().subscribe(self.OnRemoveMasks, 'Remove masks') |
98 | 88 | ps.Publisher().subscribe(self.OnDuplicateMasks, 'Duplicate masks') |
99 | 89 | |
100 | - | |
101 | 90 | def OnRemoveMasks(self, pubsub_evt): |
102 | 91 | selected_items = pubsub_evt.data |
103 | 92 | proj = Project() |
... | ... | @@ -420,9 +409,7 @@ class Slice(object): |
420 | 409 | edited_points, overwrite_surface)) |
421 | 410 | |
422 | 411 | def GetOutput(self): |
423 | - return self.cross.GetOutput() | |
424 | - | |
425 | - | |
412 | + return self.blend_filter.GetOutput() | |
426 | 413 | |
427 | 414 | def SetInput(self, imagedata, mask_dict): |
428 | 415 | self.imagedata = imagedata |
... | ... | @@ -435,7 +422,6 @@ class Slice(object): |
435 | 422 | else: |
436 | 423 | self.__load_masks(imagedata, mask_dict) |
437 | 424 | imagedata_mask = self.img_colours_mask.GetOutput() |
438 | - | |
439 | 425 | |
440 | 426 | mask_opacity = self.current_mask.opacity |
441 | 427 | |
... | ... | @@ -453,47 +439,9 @@ class Slice(object): |
453 | 439 | blend_filter.GetOutput().ReleaseDataFlagOn() |
454 | 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 | 442 | self.window_level = vtk.vtkImageMapToWindowLevelColors() |
474 | 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 | 445 | def __create_background(self, imagedata): |
498 | 446 | self.imagedata = imagedata |
499 | 447 | ... | ... |