Commit 3f0357e348b60f2e00ea4a8350c9acda9bb7d46d

Authored by Thiago Franco de Moraes
1 parent 7adbbad0
Exists in master

InVesalius main windows was being hiden when using region growing in 3D

invesalius/data/styles.py
@@ -1459,7 +1459,7 @@ class WatershedProgressWindow(object): @@ -1459,7 +1459,7 @@ class WatershedProgressWindow(object):
1459 1459
1460 self.dlg = wx.ProgressDialog(self.title, 1460 self.dlg = wx.ProgressDialog(self.title,
1461 self.msg, 1461 self.msg,
1462 - parent = None, 1462 + parent = wx.GetApp().GetTopWindow(),
1463 style = self.style) 1463 style = self.style)
1464 1464
1465 self.dlg.Bind(wx.EVT_BUTTON, self.Cancel) 1465 self.dlg.Bind(wx.EVT_BUTTON, self.Cancel)
@@ -2349,7 +2349,7 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): @@ -2349,7 +2349,7 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle):
2349 with futures.ThreadPoolExecutor(max_workers=1) as executor: 2349 with futures.ThreadPoolExecutor(max_workers=1) as executor:
2350 future = executor.submit(floodfill.floodfill_threshold, mask, [[x, y, z]], self.t0, self.t1, self.fill_value, bstruct, mask) 2350 future = executor.submit(floodfill.floodfill_threshold, mask, [[x, y, z]], self.t0, self.t1, self.fill_value, bstruct, mask)
2351 2351
2352 - dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=None, style=wx.PD_APP_MODAL) 2352 + dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=wx.GetApp().GetTopWindow(), style=wx.PD_APP_MODAL)
2353 while not future.done(): 2353 while not future.done():
2354 dlg.Pulse() 2354 dlg.Pulse()
2355 time.sleep(0.1) 2355 time.sleep(0.1)
@@ -2787,7 +2787,7 @@ class FloodFillSegmentInteractorStyle(DefaultInteractorStyle): @@ -2787,7 +2787,7 @@ class FloodFillSegmentInteractorStyle(DefaultInteractorStyle):
2787 with futures.ThreadPoolExecutor(max_workers=1) as executor: 2787 with futures.ThreadPoolExecutor(max_workers=1) as executor:
2788 future = executor.submit(self.do_rg_confidence, image, mask, (x, y, z), bstruct) 2788 future = executor.submit(self.do_rg_confidence, image, mask, (x, y, z), bstruct)
2789 2789
2790 - dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=None, style=wx.PD_APP_MODAL) 2790 + dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=wx.GetApp().GetTopWindow(), style=wx.PD_APP_MODAL|wx.PD_AUTO_HIDE)
2791 while not future.done(): 2791 while not future.done():
2792 dlg.Pulse() 2792 dlg.Pulse()
2793 time.sleep(0.1) 2793 time.sleep(0.1)
@@ -2798,11 +2798,10 @@ class FloodFillSegmentInteractorStyle(DefaultInteractorStyle): @@ -2798,11 +2798,10 @@ class FloodFillSegmentInteractorStyle(DefaultInteractorStyle):
2798 with futures.ThreadPoolExecutor(max_workers=1) as executor: 2798 with futures.ThreadPoolExecutor(max_workers=1) as executor:
2799 future = executor.submit(floodfill.floodfill_threshold, image, [[x, y, z]], t0, t1, 1, bstruct, out_mask) 2799 future = executor.submit(floodfill.floodfill_threshold, image, [[x, y, z]], t0, t1, 1, bstruct, out_mask)
2800 2800
2801 - dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=None, style=wx.PD_APP_MODAL) 2801 + dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=wx.GetApp().GetTopWindow(), style=wx.PD_APP_MODAL|wx.PD_AUTO_HIDE)
2802 while not future.done(): 2802 while not future.done():
2803 dlg.Pulse() 2803 dlg.Pulse()
2804 time.sleep(0.1) 2804 time.sleep(0.1)
2805 -  
2806 dlg.Destroy() 2805 dlg.Destroy()
2807 2806
2808 mask[out_mask.astype('bool')] = self.config.fill_value 2807 mask[out_mask.astype('bool')] = self.config.fill_value
invesalius/gui/dialogs.py
@@ -2745,7 +2745,7 @@ class SelectPartsOptionsDialog(wx.Dialog): @@ -2745,7 +2745,7 @@ class SelectPartsOptionsDialog(wx.Dialog):
2745 self.Destroy() 2745 self.Destroy()
2746 2746
2747 class FFillSegmentationOptionsDialog(wx.Dialog): 2747 class FFillSegmentationOptionsDialog(wx.Dialog):
2748 - def __init__(self, config, ID=-1, title=_(u"Region growing"), style=wx.DEFAULT_DIALOG_STYLE|wx.FRAME_FLOAT_ON_PARENT|wx.STAY_ON_TOP): 2748 + def __init__(self, config, ID=-1, title=_(u"Region growing"), style=wx.DEFAULT_DIALOG_STYLE|wx.FRAME_FLOAT_ON_PARENT):
2749 wx.Dialog.__init__(self, wx.GetApp().GetTopWindow(), ID, title=title, style=style) 2749 wx.Dialog.__init__(self, wx.GetApp().GetTopWindow(), ID, title=title, style=style)
2750 2750
2751 self.config = config 2751 self.config = config