diff --git a/dosma/scan_sequences/mri/mapss.py b/dosma/scan_sequences/mri/mapss.py index df2c02b..d50f32f 100644 --- a/dosma/scan_sequences/mri/mapss.py +++ b/dosma/scan_sequences/mri/mapss.py @@ -223,13 +223,20 @@ def __fitting_helper( ys = [vol for _, vol in echo_info] # only calculate for focused region if a mask is available, this speeds up computation - mask = tissue.get_mask() - if mask_path is not None: + if tissue is not None: + mask = tissue.get_mask() + elif mask_path is not None: mask = ( fio_utils.generic_load(mask_path, expected_num_volumes=1) if isinstance(mask_path, (str, os.PathLike)) else mask_path ) + else: + mask = MedicalVolume( + volume=np.zeros_like(self.volumes[0].volume), + affine=volumes[0].affine, + headers=deepcopy(volumes[0].headers()) + ) mef = MonoExponentialFit( bounds=bounds,