Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

65-bug-the-center-modality-is-not-skullstripped #66

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading