FIX: Check for binary mask
@@ -441,6 +441,8 @@ def create_cfm(in_file, lesion_mask=None, global_mask=True, out_path=None):
data = np.ones(in_img.shape, dtype=np.uint8)
else:
data = in_img.get_data()
+ if set(np.unique(data)) - {0, 1}:
+ raise ValueError("`global_mask` must be true if `in_file` is not a binary mask")
# If a lesion mask was provided, combine it with the secondary mask.
if lesion_mask is not None:
