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,7 +665,6 @@ class EditorInteractorStyle(DefaultInteractorStyle): | ||
| 665 | 665 | ||
| 666 | 666 | ||
| 667 | class WaterShedInteractorStyle(DefaultInteractorStyle): | 667 | class WaterShedInteractorStyle(DefaultInteractorStyle): |
| 668 | - matrix = None | ||
| 669 | def __init__(self, viewer): | 668 | def __init__(self, viewer): |
| 670 | DefaultInteractorStyle.__init__(self, viewer) | 669 | DefaultInteractorStyle.__init__(self, viewer) |
| 671 | 670 | ||
| @@ -695,11 +694,7 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): | @@ -695,11 +694,7 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): | ||
| 695 | Publisher.subscribe(self.set_operation, 'Set watershed operation') | 694 | Publisher.subscribe(self.set_operation, 'Set watershed operation') |
| 696 | 695 | ||
| 697 | def SetUp(self): | 696 | def SetUp(self): |
| 698 | - self.viewer.slice_.do_threshold_to_all_slices() | ||
| 699 | mask = self.viewer.slice_.current_mask.matrix | 697 | mask = self.viewer.slice_.current_mask.matrix |
| 700 | - mask[0] = 1 | ||
| 701 | - mask[:, 0, :] = 1 | ||
| 702 | - mask[:, :, 0] = 1 | ||
| 703 | self._create_mask() | 698 | self._create_mask() |
| 704 | self.viewer.slice_.to_show_aux = 'watershed' | 699 | self.viewer.slice_.to_show_aux = 'watershed' |
| 705 | self.viewer.OnScrollBar() | 700 | self.viewer.OnScrollBar() |
| @@ -1028,6 +1023,7 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): | @@ -1028,6 +1023,7 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): | ||
| 1028 | def expand_watershed(self, pubsub_evt): | 1023 | def expand_watershed(self, pubsub_evt): |
| 1029 | markers = self.matrix | 1024 | markers = self.matrix |
| 1030 | image = self.viewer.slice_.matrix | 1025 | image = self.viewer.slice_.matrix |
| 1026 | + self.viewer.slice_.do_threshold_to_all_slices() | ||
| 1031 | mask = self.viewer.slice_.current_mask.matrix[1:, 1:, 1:] | 1027 | mask = self.viewer.slice_.current_mask.matrix[1:, 1:, 1:] |
| 1032 | ww = self.viewer.slice_.window_width | 1028 | ww = self.viewer.slice_.window_width |
| 1033 | wl = self.viewer.slice_.window_level | 1029 | wl = self.viewer.slice_.window_level |