From 5ec49391017fbade9f34ccbdd2d1338618f7751d Mon Sep 17 00:00:00 2001 From: Martin Craig Date: Tue, 2 Jan 2024 16:58:59 +0000 Subject: [PATCH] Check user-supplied mask really is in ASL space --- oxasl/mask.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oxasl/mask.py b/oxasl/mask.py index 71022f2..d8e14f9 100755 --- a/oxasl/mask.py +++ b/oxasl/mask.py @@ -57,8 +57,10 @@ def run(wsp): page.heading("Mask generation", level=0) if wsp.mask is not None: + if reg.get_img_space(wsp, wsp.mask) != "asl": + raise ValueError("Mask supplied is not in ASL space: %s" % wsp.mask.name) wsp.rois.mask_src = "user" - mask_source = "provided by user (assumed to be ASL space): %s" % wsp.mask.name + mask_source = "ASL space mask provided by user: %s" % wsp.mask.name wsp.rois.mask = wsp.mask elif wsp.structural is not None and wsp.structural.struc is not None: # Preferred option is to use brain extracted structural