diff --git a/src/nifreeze/model/base.py b/src/nifreeze/model/base.py index 1759164..bcdca3e 100644 --- a/src/nifreeze/model/base.py +++ b/src/nifreeze/model/base.py @@ -22,6 +22,8 @@ # """Base infrastructure for nifreeze's models.""" +from warnings import warn + import numpy as np from nifreeze.exceptions import ModelNotFittedError @@ -93,6 +95,9 @@ def __init__(self, mask=None, **kwargs): self._models = None # For parallel (chunked) execution # Setup brain mask + if mask is None: + warn("No mask provided; consider using a mask to avoid issues in model optimization.") + self._mask = mask self._datashape = None diff --git a/src/nifreeze/registration/ants.py b/src/nifreeze/registration/ants.py index f01978d..5b700da 100644 --- a/src/nifreeze/registration/ants.py +++ b/src/nifreeze/registration/ants.py @@ -382,12 +382,16 @@ def generate_command( settings["fixed_image_masks"] = [ str(p) for p in _massage_mask_path(fixedmask_path, nlevels) ] + else: + warn("No fixed image mask provided; consider using a mask to avoid optimization issues.") # Set moving masks if provided if movingmask_path is not None: settings["moving_image_masks"] = [ str(p) for p in _massage_mask_path(movingmask_path, nlevels) ] + else: + warn("No moving image mask provided; consider using a mask to avoid optimization issues.") # Set initalizing affine if provided if init_affine is not None: