Skip to content

Commit 153fe6f

Browse files
committed
FIX: Check for binary mask
1 parent b8dfeab commit 153fe6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

niworkflows/interfaces/mni.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ def create_cfm(in_file, lesion_mask=None, global_mask=True, out_path=None):
441441
data = np.ones(in_img.shape, dtype=np.uint8)
442442
else:
443443
data = in_img.get_data()
444+
if set(np.unique(data)) - {0, 1}:
445+
raise ValueError("`global_mask` must be true if `in_file` is not a binary mask")
444446

445447
# If a lesion mask was provided, combine it with the secondary mask.
446448
if lesion_mask is not None:

0 commit comments

Comments
 (0)