Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michiel Cottaar
gyral_structure
Commits
3bfdf4f6
Commit
3bfdf4f6
authored
May 04, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gyral_structure/scripts/gs_mask
View file @
3bfdf4f6
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment