Skip to content

Commit 54916e5

Browse files
authored
Merge pull request #173 from BrainLesion/172-bug-defacer-base-class-not-properly-indented
fixing indents in defacer base class
2 parents 22661a6 + 07e982b commit 54916e5

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

brainles_preprocessing/defacing/defacer.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

brainles_preprocessing/registration/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import warnings
22

3-
43
try:
54
from .ANTs.ANTs import ANTsRegistrator
65
except ImportError:
@@ -11,7 +10,6 @@
1110

1211
from .niftyreg.niftyreg import NiftyRegRegistrator
1312

14-
1513
try:
1614
from .elastix.elastix import ElastixRegistrator
1715
except ImportError:

0 commit comments

Comments
 (0)