Skip to content

Commit e7e3024

Browse files
committed
RF: Move assert to warning... should not display in normal usage
1 parent 9d3c25c commit e7e3024

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

niworkflows/interfaces/mni.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ def create_cfm(in_file, lesion_mask=None, global_mask=True, out_path=None):
427427
else:
428428
out_path = os.path.abspath(out_path)
429429

430+
if not global_mask and not lesion_mask:
431+
NIWORKFLOWS_LOG.warning(
432+
'No lesion mask was provided and global_mask not requested, '
433+
'therefore the original mask will not be modified.')
434+
430435
# Load the input image
431436
in_img = nb.load(in_file)
432437
in_data = in_img.get_data()
@@ -449,9 +454,6 @@ def create_cfm(in_file, lesion_mask=None, global_mask=True, out_path=None):
449454
# Create the cost function mask image from the subtraction.
450455
cfm_img = nb.Nifti1Image(cfm_data, in_img.affine, in_img.header)
451456
else:
452-
# Confirm that global masking is enabled.
453-
assert (global_mask is True), "If no lesion mask is provided, global_mask must be True"
454-
455457
# Create the cost function mask from the global mask.
456458
cfm_img = nb.Nifti1Image(in_data, in_img.affine, in_img.header)
457459

0 commit comments

Comments
 (0)