Commit 1b75e4d8d5397f5e3b5b0d6c6d0a7920550851d3
1 parent
63b10a32
Exists in
rotvol
Showing and hidding mask when using reorient image
Showing
3 changed files
with
13 additions
and
2 deletions
Show diff stats
invesalius/data/slice_.py
... | ... | @@ -158,6 +158,7 @@ class Slice(object): |
158 | 158 | Publisher.subscribe(self.__set_mask_name, 'Change mask name') |
159 | 159 | Publisher.subscribe(self.__show_mask, 'Show mask') |
160 | 160 | Publisher.subscribe(self.__hide_current_mask, 'Hide current mask') |
161 | + Publisher.subscribe(self.__show_current_mask, 'Show current mask') | |
161 | 162 | Publisher.subscribe(self.__clean_current_mask, 'Clean current mask') |
162 | 163 | |
163 | 164 | Publisher.subscribe(self.__set_current_mask_threshold_limits, |
... | ... | @@ -402,6 +403,12 @@ class Slice(object): |
402 | 403 | value = False |
403 | 404 | Publisher.sendMessage('Show mask', (index, value)) |
404 | 405 | |
406 | + def __show_current_mask(self, pubsub_evt): | |
407 | + if self.current_mask: | |
408 | + index = self.current_mask.index | |
409 | + value = True | |
410 | + Publisher.sendMessage('Show mask', (index, value)) | |
411 | + | |
405 | 412 | def __clean_current_mask(self, pubsub_evt): |
406 | 413 | if self.current_mask: |
407 | 414 | self.current_mask.clean() | ... | ... |
invesalius/data/styles.py
... | ... | @@ -1435,7 +1435,7 @@ class ReorientImageInteractorStyle(DefaultInteractorStyle): |
1435 | 1435 | |
1436 | 1436 | def SetUp(self): |
1437 | 1437 | self.draw_lines() |
1438 | - Publisher.sendMessage('Show mask', (self.viewer.slice_.current_mask.index, False)) | |
1438 | + Publisher.sendMessage('Hide current mask') | |
1439 | 1439 | Publisher.sendMessage('Reload actual slice') |
1440 | 1440 | |
1441 | 1441 | def CleanUp(self): |
... | ... | @@ -1445,7 +1445,7 @@ class ReorientImageInteractorStyle(DefaultInteractorStyle): |
1445 | 1445 | self.viewer.slice_.rotations = [0, 0, 0] |
1446 | 1446 | self.viewer.slice_.q_orientation = np.array((1, 0, 0, 0)) |
1447 | 1447 | self._discard_buffers() |
1448 | - Publisher.sendMessage('Show mask', (self.viewer.slice_.current_mask.index, True)) | |
1448 | + Publisher.sendMessage('Show current mask') | |
1449 | 1449 | |
1450 | 1450 | def OnLeftClick(self, obj, evt): |
1451 | 1451 | if self._over_center: | ... | ... |
invesalius/gui/data_notebook.py
... | ... | @@ -364,6 +364,7 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
364 | 364 | |
365 | 365 | Publisher.subscribe(self.OnChangeCurrentMask, 'Change mask selected') |
366 | 366 | Publisher.subscribe(self.__hide_current_mask, 'Hide current mask') |
367 | + Publisher.subscribe(self.__show_current_mask, 'Show current mask') | |
367 | 368 | Publisher.subscribe(self.OnCloseProject, 'Close project data') |
368 | 369 | |
369 | 370 | def OnKeyEvent(self, event): |
... | ... | @@ -435,6 +436,9 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
435 | 436 | def __hide_current_mask(self, pubsub_evt): |
436 | 437 | self.SetItemImage(self.current_index, 0) |
437 | 438 | |
439 | + def __show_current_mask(self, pubsub_evt): | |
440 | + self.SetItemImage(self.current_index, 1) | |
441 | + | |
438 | 442 | def __init_columns(self): |
439 | 443 | |
440 | 444 | self.InsertColumn(0, "", wx.LIST_FORMAT_CENTER) | ... | ... |