@@ -22,20 +22,20 @@ def __init__(
2222 # probably be implemented as a property of the the specific modality
2323 self .masking_value = masking_value
2424
25- @abstractmethod
26- def deface (
27- self ,
28- input_image_path : Union [str , Path ],
29- mask_image_path : Union [str , Path ],
30- ) -> None :
31- """
32- Generate a defacing mask provided an input image.
25+ @abstractmethod
26+ def deface (
27+ self ,
28+ input_image_path : Union [str , Path ],
29+ mask_image_path : Union [str , Path ],
30+ ) -> None :
31+ """
32+ Generate a defacing mask provided an input image.
3333
34- Args:
35- input_image_path (str or Path): Path to the input image (NIfTI format).
36- mask_image_path (str or Path): Path to the output mask image (NIfTI format).
37- """
38- pass
34+ Args:
35+ input_image_path (str or Path): Path to the input image (NIfTI format).
36+ mask_image_path (str or Path): Path to save the output mask image (NIfTI format).
37+ """
38+ pass
3939
4040 def apply_mask (
4141 self ,
@@ -52,6 +52,9 @@ def apply_mask(
5252 defaced_image_path (str or Path): Path to save the resulting defaced image (NIfTI format).
5353 """
5454
55+ input_image_path = Path (input_image_path )
56+ mask_path = Path (mask_path )
57+
5558 if not input_image_path .is_file ():
5659 raise FileNotFoundError (
5760 f"Input image file does not exist: { input_image_path } "
@@ -72,7 +75,7 @@ def apply_mask(
7275 if input_data .shape != mask_data .shape :
7376 raise ValueError ("Input image and mask must have the same dimensions." )
7477
75- # check whether a global masking value was passed, otherwise choose minimum
78+ # Check whether a global masking value was passed, otherwise choose minimum
7679 if self .masking_value is None :
7780 current_masking_value = np .min (input_data )
7881 else :
0 commit comments