Commit ade84989f26d2e7fe39ac6fa7d81f3a82d5974ca
1 parent
27f9a4ea
Exists in
master
and in
51 other branches
only applying threshold to all slices when the user expands the watershed
Showing
1 changed file
with
1 additions
and
5 deletions
Show diff stats
invesalius/data/styles.py
... | ... | @@ -665,7 +665,6 @@ class EditorInteractorStyle(DefaultInteractorStyle): |
665 | 665 | |
666 | 666 | |
667 | 667 | class WaterShedInteractorStyle(DefaultInteractorStyle): |
668 | - matrix = None | |
669 | 668 | def __init__(self, viewer): |
670 | 669 | DefaultInteractorStyle.__init__(self, viewer) |
671 | 670 | |
... | ... | @@ -695,11 +694,7 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): |
695 | 694 | Publisher.subscribe(self.set_operation, 'Set watershed operation') |
696 | 695 | |
697 | 696 | def SetUp(self): |
698 | - self.viewer.slice_.do_threshold_to_all_slices() | |
699 | 697 | mask = self.viewer.slice_.current_mask.matrix |
700 | - mask[0] = 1 | |
701 | - mask[:, 0, :] = 1 | |
702 | - mask[:, :, 0] = 1 | |
703 | 698 | self._create_mask() |
704 | 699 | self.viewer.slice_.to_show_aux = 'watershed' |
705 | 700 | self.viewer.OnScrollBar() |
... | ... | @@ -1028,6 +1023,7 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): |
1028 | 1023 | def expand_watershed(self, pubsub_evt): |
1029 | 1024 | markers = self.matrix |
1030 | 1025 | image = self.viewer.slice_.matrix |
1026 | + self.viewer.slice_.do_threshold_to_all_slices() | |
1031 | 1027 | mask = self.viewer.slice_.current_mask.matrix[1:, 1:, 1:] |
1032 | 1028 | ww = self.viewer.slice_.window_width |
1033 | 1029 | wl = self.viewer.slice_.window_level | ... | ... |