Commit 739f5d15b1ee866b24e9da5568d0aa38e8a9adfc
1 parent
fd0ab6bd
Exists in
master
and in
56 other branches
Added a method to hide the current mask
Showing
1 changed file
with
11 additions
and
1 deletions
Show diff stats
invesalius/data/slice_.py
| ... | ... | @@ -85,7 +85,7 @@ class Slice(object): |
| 85 | 85 | self.histogram = None |
| 86 | 86 | self._matrix = None |
| 87 | 87 | |
| 88 | - self._type_projection = const.PROJECTION_MIDA | |
| 88 | + self._type_projection = const.PROJECTION_NORMAL | |
| 89 | 89 | self.n_border = 3.0 |
| 90 | 90 | |
| 91 | 91 | self.spacing = (1.0, 1.0, 1.0) |
| ... | ... | @@ -138,6 +138,7 @@ class Slice(object): |
| 138 | 138 | 'Change mask colour') |
| 139 | 139 | Publisher.subscribe(self.__set_mask_name, 'Change mask name') |
| 140 | 140 | Publisher.subscribe(self.__show_mask, 'Show mask') |
| 141 | + Publisher.subscribe(self.__hide_current_mask, 'Hide current mask') | |
| 141 | 142 | |
| 142 | 143 | Publisher.subscribe(self.__set_current_mask_threshold_limits, |
| 143 | 144 | 'Update threshold limits') |
| ... | ... | @@ -351,6 +352,12 @@ class Slice(object): |
| 351 | 352 | if not value: |
| 352 | 353 | Publisher.sendMessage('Select mask name in combo', -1) |
| 353 | 354 | |
| 355 | + def __hide_current_mask(self, pubsub_evt): | |
| 356 | + if self.current_mask: | |
| 357 | + index = self.current_mask.index | |
| 358 | + value = False | |
| 359 | + self.ShowMask(index, value) | |
| 360 | + | |
| 354 | 361 | def edit_mask_pixel(self, operation, index, position, radius, orientation): |
| 355 | 362 | mask = self.buffer_slices[orientation].mask |
| 356 | 363 | image = self.buffer_slices[orientation].image |
| ... | ... | @@ -815,6 +822,9 @@ class Slice(object): |
| 815 | 822 | |
| 816 | 823 | def SetTypeProjection(self, tprojection): |
| 817 | 824 | if self._type_projection != tprojection: |
| 825 | + if self._type_projection == const.PROJECTION_NORMAL: | |
| 826 | + self.__hide_current_mask(None) | |
| 827 | + | |
| 818 | 828 | self._type_projection = tprojection |
| 819 | 829 | for buffer_ in self.buffer_slices.values(): |
| 820 | 830 | buffer_.discard_buffer() | ... | ... |