Commit eb05cef78a7693f13b48f64bd00aa8e9710bb801
1 parent
db65e153
Exists in
cython_threshold
fixed a problem in the threshold filter
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
invesalius/data/threshold.pyx
@@ -24,8 +24,8 @@ def threshold(DTYPE16_t[:, :] image, DTYPE8_t[:, :] mask, DTYPE16_t low, DTYPE16 | @@ -24,8 +24,8 @@ def threshold(DTYPE16_t[:, :] image, DTYPE8_t[:, :] mask, DTYPE16_t low, DTYPE16 | ||
24 | cdef DTYPE16_t v | 24 | cdef DTYPE16_t v |
25 | for y in prange(sy, nogil=True): | 25 | for y in prange(sy, nogil=True): |
26 | for x in xrange(sx): | 26 | for x in xrange(sx): |
27 | - v = mask[y, x] | ||
28 | - if not v: | 27 | + v = image[y, x] |
28 | + if not mask[y, x]: | ||
29 | if v >= low and v <= high: | 29 | if v >= low and v <= high: |
30 | mask[y, x] = 255 | 30 | mask[y, x] = 255 |
31 | else: | 31 | else: |