Skip to content

Commit

Permalink
Merge pull request #66 from BrainLesion/65-bug-the-center-modality-is…
Browse files Browse the repository at this point in the history
…-not-skullstripped

65-bug-the-center-modality-is-not-skullstripped
  • Loading branch information
neuronflow authored Feb 15, 2024
2 parents e168a7a + 9f3e97a commit 334da3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion brainles_preprocessing/modality.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,15 @@ def __init__(
else:
self.normalized_skull_output_path = normalized_skull_output_path

# print("self.raw_bet_output_path", self.raw_bet_output_path)
# print("self.normalized_skull_output_path", self.normalized_skull_output_path)
# print("self.bet:", self.bet)

@property
def bet(self) -> bool:
return any(
path is not None
for path in [self.raw_bet_output_path, self.normalized_skull_output_path]
for path in [self.raw_bet_output_path, self.normalized_bet_output_path]
)

def normalize(
Expand Down Expand Up @@ -290,6 +294,7 @@ def save_current_image(
)
elif normalization is True:
image = read_nifti(self.current)
print("current image", self.current)
normalized_image = self.normalizer.normalize(image=image)
write_nifti(
input_array=normalized_image,
Expand Down
1 change: 1 addition & 0 deletions brainles_preprocessing/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def run(

# Optional: Brain extraction
brain_extraction = any(modality.bet for modality in self.all_modalities)
# print("brain extraction: ", brain_extraction)

if brain_extraction:
bet_dir = os.path.join(self.temp_folder, "brain-extraction")
Expand Down

0 comments on commit 334da3b

Please sign in to comment.