Commit 1cc92f9650546e53b6cc8f8f32a84c1bee2bfad9

Authored by Thiago Franco de Moraes
1 parent 21f2f380
Exists in ff_mask

Copying mask after applying threshold to all slices

invesalius/data/floodfill.pyx
@@ -120,8 +120,8 @@ def floodfill_threshold(np.ndarray[image_t, ndim=3] data, list seeds, int t0, in @@ -120,8 +120,8 @@ def floodfill_threshold(np.ndarray[image_t, ndim=3] data, list seeds, int t0, in
120 120
121 with nogil: 121 with nogil:
122 while stack.size(): 122 while stack.size():
123 - c = stack.front()  
124 - stack.pop_front() 123 + c = stack.back()
  124 + stack.pop_back()
125 125
126 x = c.x 126 x = c.x
127 y = c.y 127 y = c.y
invesalius/data/styles.py
@@ -1802,12 +1802,10 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): @@ -1802,12 +1802,10 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle):
1802 position = viewer.calculate_matrix_position(coord) 1802 position = viewer.calculate_matrix_position(coord)
1803 1803
1804 x, y, z = self.calcultate_scroll_position(position) 1804 x, y, z = self.calcultate_scroll_position(position)
1805 - mask = self.viewer.slice_.current_mask.matrix[1:, 1:, 1:]  
1806 -  
1807 - cp_mask = mask.copy()  
1808 1805
1809 from_3d = True 1806 from_3d = True
1810 if self.config.target == "3D": 1807 if self.config.target == "3D":
  1808 + print "DOING 3D, manolo!"
1811 neighbor_iter = ((-1, 0, 0), 1809 neighbor_iter = ((-1, 0, 0),
1812 (1, 0, 0), 1810 (1, 0, 0),
1813 (0, -1, 0), 1811 (0, -1, 0),
@@ -1821,6 +1819,9 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): @@ -1821,6 +1819,9 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle):
1821 (0, -1, 0), 1819 (0, -1, 0),
1822 (0, 1, 0)) 1820 (0, 1, 0))
1823 1821
  1822 + mask = self.viewer.slice_.current_mask.matrix[1:, 1:, 1:]
  1823 + cp_mask = mask.copy()
  1824 +
1824 # neighbor_iter = [] 1825 # neighbor_iter = []
1825 # for i in xrange(-1, 2): 1826 # for i in xrange(-1, 2):
1826 # for j in xrange(-1, 2): 1827 # for j in xrange(-1, 2):