fixed namedtuple error
@@ -78,8 +78,6 @@ class RandomWalk:
z_free, y_free, x_free = z, y, x
coords = np.ones((max_steps+1, 3), dtype=int) * (-1)
free_coords = np.ones((max_steps+1, 3), dtype=int) * (-1)
- bounds = np.zeros((max_steps+1, 3), dtype=int)
- free_bounds = np.zeros((max_steps+1, 3), dtype=int)
coords[0, :] = [z, y, x]
free_coords[0, :] = [z_free, y_free, x_free]
steps = 0
@@ -101,21 +99,17 @@ class RandomWalk:
z_step -= 1
# checks to make sure image does not go out of bounds
if x_free+x_step < 0 or y_free+y_step < 0 or z_free+z_step < 0:
- free_bounds[step] = [x_step, y_step, z_step]
break
elif (x_free+x_step >= x_max or y_free+y_step >= y_max or
z_free+z_step >= z_max):
- free_bounds[step] = [x_step, y_step, z_step]
break
else:
x_free += x_step
y_free += y_step
z_free += z_step
if x+x_step < 0 or y+y_step < 0 or z+z_step < 0:
- bounds[step] = [x_step, y_step, z_step]
break
elif x+x_step >= x_max or y+y_step >= y_max or z+z_step >= z_max:
- bounds[step] = [x_step, y_step, z_step]
break
# checks if the step leads to a pore in image
elif im[z+z_step, y+y_step, x+x_step]:
@@ -125,8 +119,7 @@ class RandomWalk:
steps += 1
coords[step] = [z, y, x]
free_coords[step] = [z_free, y_free, x_free]
- path = namedtuple('path', ('pore_space', 'open_space', 'pore_bounds,',
- 'open_bounds'))
+ path = namedtuple('path', ('pore_space', 'free_space'))
paths = path(coords[::stride, :], free_coords[::stride, :])
return paths
