diff --git a/brainles_preprocessing/defacing/defacer.py b/brainles_preprocessing/defacing/defacer.py index 0e0e876..ecc2de7 100644 --- a/brainles_preprocessing/defacing/defacer.py +++ b/brainles_preprocessing/defacing/defacer.py @@ -22,20 +22,20 @@ def __init__( # probably be implemented as a property of the the specific modality self.masking_value = masking_value - @abstractmethod - def deface( - self, - input_image_path: Union[str, Path], - mask_image_path: Union[str, Path], - ) -> None: - """ - Generate a defacing mask provided an input image. + @abstractmethod + def deface( + self, + input_image_path: Union[str, Path], + mask_image_path: Union[str, Path], + ) -> None: + """ + Generate a defacing mask provided an input image. - Args: - input_image_path (str or Path): Path to the input image (NIfTI format). - mask_image_path (str or Path): Path to the output mask image (NIfTI format). - """ - pass + Args: + input_image_path (str or Path): Path to the input image (NIfTI format). + mask_image_path (str or Path): Path to save the output mask image (NIfTI format). + """ + pass def apply_mask( self, @@ -52,6 +52,9 @@ def apply_mask( defaced_image_path (str or Path): Path to save the resulting defaced image (NIfTI format). """ + input_image_path = Path(input_image_path) + mask_path = Path(mask_path) + if not input_image_path.is_file(): raise FileNotFoundError( f"Input image file does not exist: {input_image_path}" @@ -72,7 +75,7 @@ def apply_mask( if input_data.shape != mask_data.shape: raise ValueError("Input image and mask must have the same dimensions.") - # check whether a global masking value was passed, otherwise choose minimum + # Check whether a global masking value was passed, otherwise choose minimum if self.masking_value is None: current_masking_value = np.min(input_data) else: diff --git a/brainles_preprocessing/registration/__init__.py b/brainles_preprocessing/registration/__init__.py index e38d97d..9eea05d 100644 --- a/brainles_preprocessing/registration/__init__.py +++ b/brainles_preprocessing/registration/__init__.py @@ -1,6 +1,5 @@ import warnings - try: from .ANTs.ANTs import ANTsRegistrator except ImportError: @@ -11,7 +10,6 @@ from .niftyreg.niftyreg import NiftyRegRegistrator - try: from .elastix.elastix import ElastixRegistrator except ImportError: