Skip to content

Commit 604b168

Browse files
committed
RF: Simplify trivial branch
1 parent b90cd79 commit 604b168

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

niworkflows/interfaces/mni.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -487,13 +487,9 @@ def create_cfm(in_file, lesion_mask=None, global_mask=True, out_path=None):
487487
in_img = nb.load(in_file)
488488

489489
# If we want a global mask, create one based on the input image.
490-
if global_mask:
491-
# Create a mask of ones with the shape of the input image.
492-
data = np.ones(in_img.shape, dtype=np.uint8)
493-
else:
494-
data = in_img.get_data()
495-
if set(np.unique(data)) - {0, 1}:
496-
raise ValueError("`global_mask` must be true if `in_file` is not a binary mask")
490+
data = np.ones(in_img.shape, dtype=np.uint8) if global_mask else in_img.get_data()
491+
if set(np.unique(data)) - {0, 1}:
492+
raise ValueError("`global_mask` must be true if `in_file` is not a binary mask")
497493

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

0 commit comments

Comments
 (0)