From 21f2f380c88fd29bc5fd1675de138d817596584b Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Tue, 16 Aug 2016 16:36:37 -0300 Subject: [PATCH] Showing a dialog interface --- invesalius/data/floodfill.pyx | 12 +++++++++--- invesalius/data/styles.py | 3 +-- invesalius/data/viewer_slice.py | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/invesalius/data/floodfill.pyx b/invesalius/data/floodfill.pyx index 2ffbb23..e5f9aab 100644 --- a/invesalius/data/floodfill.pyx +++ b/invesalius/data/floodfill.pyx @@ -123,10 +123,16 @@ def floodfill_threshold(np.ndarray[image_t, ndim=3] data, list seeds, int t0, in c = stack.front() stack.pop_front() + x = c.x + y = c.y + z = c.z + + out[z, y, x] = fill + for i in xrange(neighbor_iter.size()): - xo = c.x + neighbor_iter[i][0] - yo = c.y + neighbor_iter[i][1] - zo = c.z + neighbor_iter[i][2] + xo = x + neighbor_iter[i][0] + yo = y + neighbor_iter[i][1] + zo = z + neighbor_iter[i][2] if 0 <= xo < w and 0 <= yo < h and 0 <= zo < d and out[zo, yo, xo] != fill and t0 <= data[zo, yo, xo] <= t1: out[zo, yo, xo] = fill diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 24110a4..3faeba7 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -1777,8 +1777,6 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): dlg_ffill = dialogs.FFillOptionsDialog(self.config) dlg_ffill.Show() - self.viewer.slice_.do_threshold_to_all_slices() - self.AddObserver("LeftButtonPressEvent", self.OnFFClick) def OnFFClick(self, obj, evt): @@ -1816,6 +1814,7 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): (0, 1, 0), (0, 0, -1), (0, 0, 1)) + self.viewer.slice_.do_threshold_to_all_slices() else: neighbor_iter = ((-1, 0, 0), (1, 0, 0), diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index d0ffea0..c9cbead 100755 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -1344,7 +1344,7 @@ class Viewer(wx.Panel): actor = vtk.vtkImageActor() # TODO: Create a option to let the user set if he wants to interpolate # the slice images. - #actor.InterpolateOff() + actor.InterpolateOff() slice_data = sd.SliceData() slice_data.SetOrientation(self.orientation) slice_data.renderer = renderer -- libgit2 0.21.2