From f8d5a86ffb544589504f50a314fe98266bb36b12 Mon Sep 17 00:00:00 2001 From: neuronflow Date: Wed, 28 Jan 2026 17:51:39 +0100 Subject: [PATCH 1/3] fix all Signed-off-by: neuronflow --- brainles_preprocessing/defacing/defacer.py | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/brainles_preprocessing/defacing/defacer.py b/brainles_preprocessing/defacing/defacer.py index 0e0e876..f36458b 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}" From f2956f6a7f494e7669dacf7b14e1cf6c8d159e06 Mon Sep 17 00:00:00 2001 From: neuronflow Date: Wed, 28 Jan 2026 17:54:15 +0100 Subject: [PATCH 2/3] mewp Signed-off-by: neuronflow --- brainles_preprocessing/defacing/defacer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brainles_preprocessing/defacing/defacer.py b/brainles_preprocessing/defacing/defacer.py index f36458b..ecc2de7 100644 --- a/brainles_preprocessing/defacing/defacer.py +++ b/brainles_preprocessing/defacing/defacer.py @@ -75,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: From 07e982bbb50727f1a0271c1ca1f1c319aa68225c Mon Sep 17 00:00:00 2001 From: "brainless-bot[bot]" <153751247+brainless-bot[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:55:39 +0000 Subject: [PATCH 3/3] Autoformat with black --- brainles_preprocessing/registration/__init__.py | 2 -- 1 file changed, 2 deletions(-) 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: