Commit 3bfdf4f6 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

BUG: don't compute minimum of binarised mask

parent 2dd5d785
Pipeline #5311 passed with stage
in 2 minutes and 39 seconds
......@@ -59,7 +59,7 @@ gyral_wm_mask = (dist_mask | thickness_mask) & (white_dist < 0)
final_mask = (gyral_wm_mask | intersect_mask) & close_to_white_mask
idx_deepest = np.unravel_index(dist_mask.argmin(), shape=dist_mask.shape)
idx_deepest = np.unravel_index(white_dist.argmin(), shape=white_dist.shape)
if final_mask[idx_deepest]:
raise ValueError("Even the deepest white matter point was included in the gyral mask.")
......@@ -69,7 +69,7 @@ filled = ndimage.binary_fill_holes(final_mask)
if filled[idx_deepest]:
# Filling holes in the gyral white matter also filled the deep white matter
# Let's fix that
new_filled = filled - final_mask
new_filled = filled ^ final_mask
labels, _ = ndimage.label(new_filled)
filled[labels[idx_deepest] == labels] = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment