Commit 2150d4498d50bb8610f34da8427af8d8f321031f
1 parent
47d41bbc
Exists in
ff_mask_improv
Better progress dialog messages
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
invesalius/data/styles.py
| @@ -1781,6 +1781,8 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): | @@ -1781,6 +1781,8 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): | ||
| 1781 | self.fill_value = 254 | 1781 | self.fill_value = 254 |
| 1782 | 1782 | ||
| 1783 | self._dlg_title = _(u"Fill holes") | 1783 | self._dlg_title = _(u"Fill holes") |
| 1784 | + self._progr_title = _(u"Fill hole") | ||
| 1785 | + self._progr_msg = _(u"Filling hole ...") | ||
| 1784 | 1786 | ||
| 1785 | self.AddObserver("LeftButtonPressEvent", self.OnFFClick) | 1787 | self.AddObserver("LeftButtonPressEvent", self.OnFFClick) |
| 1786 | 1788 | ||
| @@ -1839,7 +1841,6 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): | @@ -1839,7 +1841,6 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): | ||
| 1839 | bstruct = np.zeros((3, 3, 1), dtype='uint8') | 1841 | bstruct = np.zeros((3, 3, 1), dtype='uint8') |
| 1840 | bstruct[:, :, 0] = _bstruct | 1842 | bstruct[:, :, 0] = _bstruct |
| 1841 | 1843 | ||
| 1842 | - print bstruct | ||
| 1843 | if self.config.target == '2D': | 1844 | if self.config.target == '2D': |
| 1844 | floodfill.floodfill_threshold(mask, [[x, y, z]], self.t0, self.t1, self.fill_value, bstruct, mask) | 1845 | floodfill.floodfill_threshold(mask, [[x, y, z]], self.t0, self.t1, self.fill_value, bstruct, mask) |
| 1845 | b_mask = self.viewer.slice_.buffer_slices[self.orientation].mask | 1846 | b_mask = self.viewer.slice_.buffer_slices[self.orientation].mask |
| @@ -1857,7 +1858,7 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): | @@ -1857,7 +1858,7 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): | ||
| 1857 | with futures.ThreadPoolExecutor(max_workers=1) as executor: | 1858 | with futures.ThreadPoolExecutor(max_workers=1) as executor: |
| 1858 | future = executor.submit(floodfill.floodfill_threshold, mask, [[x, y, z]], self.t0, self.t1, self.fill_value, bstruct, mask) | 1859 | future = executor.submit(floodfill.floodfill_threshold, mask, [[x, y, z]], self.t0, self.t1, self.fill_value, bstruct, mask) |
| 1859 | 1860 | ||
| 1860 | - dlg = wx.ProgressDialog("Filling ...", "Doido", parent=None, style=wx.PD_APP_MODAL) | 1861 | + dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=None, style=wx.PD_APP_MODAL) |
| 1861 | while not future.done(): | 1862 | while not future.done(): |
| 1862 | dlg.Pulse() | 1863 | dlg.Pulse() |
| 1863 | time.sleep(0.1) | 1864 | time.sleep(0.1) |
| @@ -1923,6 +1924,8 @@ class RemoveMaskPartsInteractorStyle(FloodFillMaskInteractorStyle): | @@ -1923,6 +1924,8 @@ class RemoveMaskPartsInteractorStyle(FloodFillMaskInteractorStyle): | ||
| 1923 | self.fill_value = 1 | 1924 | self.fill_value = 1 |
| 1924 | 1925 | ||
| 1925 | self._dlg_title = _(u"Remove parts") | 1926 | self._dlg_title = _(u"Remove parts") |
| 1927 | + self._progr_title = _(u"Remove part") | ||
| 1928 | + self._progr_msg = _(u"Removing part ...") | ||
| 1926 | 1929 | ||
| 1927 | 1930 | ||
| 1928 | def get_style(style): | 1931 | def get_style(style): |