Commit 21f2f380c88fd29bc5fd1675de138d817596584b
1 parent
c0e80828
Exists in
ff_mask
Showing a dialog interface
Showing
3 changed files
with
11 additions
and
6 deletions
Show diff stats
invesalius/data/floodfill.pyx
... | ... | @@ -123,10 +123,16 @@ def floodfill_threshold(np.ndarray[image_t, ndim=3] data, list seeds, int t0, in |
123 | 123 | c = stack.front() |
124 | 124 | stack.pop_front() |
125 | 125 | |
126 | + x = c.x | |
127 | + y = c.y | |
128 | + z = c.z | |
129 | + | |
130 | + out[z, y, x] = fill | |
131 | + | |
126 | 132 | for i in xrange(neighbor_iter.size()): |
127 | - xo = c.x + neighbor_iter[i][0] | |
128 | - yo = c.y + neighbor_iter[i][1] | |
129 | - zo = c.z + neighbor_iter[i][2] | |
133 | + xo = x + neighbor_iter[i][0] | |
134 | + yo = y + neighbor_iter[i][1] | |
135 | + zo = z + neighbor_iter[i][2] | |
130 | 136 | |
131 | 137 | 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: |
132 | 138 | out[zo, yo, xo] = fill | ... | ... |
invesalius/data/styles.py
... | ... | @@ -1777,8 +1777,6 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): |
1777 | 1777 | dlg_ffill = dialogs.FFillOptionsDialog(self.config) |
1778 | 1778 | dlg_ffill.Show() |
1779 | 1779 | |
1780 | - self.viewer.slice_.do_threshold_to_all_slices() | |
1781 | - | |
1782 | 1780 | self.AddObserver("LeftButtonPressEvent", self.OnFFClick) |
1783 | 1781 | |
1784 | 1782 | def OnFFClick(self, obj, evt): |
... | ... | @@ -1816,6 +1814,7 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): |
1816 | 1814 | (0, 1, 0), |
1817 | 1815 | (0, 0, -1), |
1818 | 1816 | (0, 0, 1)) |
1817 | + self.viewer.slice_.do_threshold_to_all_slices() | |
1819 | 1818 | else: |
1820 | 1819 | neighbor_iter = ((-1, 0, 0), |
1821 | 1820 | (1, 0, 0), | ... | ... |
invesalius/data/viewer_slice.py
... | ... | @@ -1344,7 +1344,7 @@ class Viewer(wx.Panel): |
1344 | 1344 | actor = vtk.vtkImageActor() |
1345 | 1345 | # TODO: Create a option to let the user set if he wants to interpolate |
1346 | 1346 | # the slice images. |
1347 | - #actor.InterpolateOff() | |
1347 | + actor.InterpolateOff() | |
1348 | 1348 | slice_data = sd.SliceData() |
1349 | 1349 | slice_data.SetOrientation(self.orientation) |
1350 | 1350 | slice_data.renderer = renderer | ... | ... |