From 0a8a2b480a57ed235eae1a030fba52ecb2c309bf Mon Sep 17 00:00:00 2001 From: Muhammad Nabi Yasinzai Date: Thu, 31 Oct 2024 23:05:51 +1300 Subject: [PATCH] Corrected QuickshearDefacer argument name mismatch --- brainles_preprocessing/modality.py | 2 +- .../example_modality_centric_preprocessor.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/brainles_preprocessing/modality.py b/brainles_preprocessing/modality.py index 4e311bd..1fb1859 100644 --- a/brainles_preprocessing/modality.py +++ b/brainles_preprocessing/modality.py @@ -401,7 +401,7 @@ def deface( defacer.deface( mask_image_path=atlas_mask_path, - bet_img_path=self.steps[PreprocessorSteps.BET], + input_image_path=self.steps[PreprocessorSteps.BET], ) return atlas_mask_path else: diff --git a/example/example_modality_centric_preprocessor.py b/example/example_modality_centric_preprocessor.py index 4982210..01f12db 100644 --- a/example/example_modality_centric_preprocessor.py +++ b/example/example_modality_centric_preprocessor.py @@ -26,6 +26,8 @@ def preprocess(inputDir): norm_bet_dir = brainles_dir / "normalized_bet" raw_skull_dir = brainles_dir / "raw_skull" norm_skull_dir = brainles_dir / "normalized_skull" + raw_deface_dir = brainles_dir / "raw_defaced" + norm_deface_dir = brainles_dir / "normalized_defaced" t1_file = inputDir.files("*t1.nii.gz") t1c_file = inputDir.files("*t1c.nii.gz") @@ -58,6 +60,10 @@ def preprocess(inputDir): + "_t1c_bet_normalized.nii.gz", normalized_skull_output_path=norm_skull_dir / inputDir.name + "_t1c_skull_normalized.nii.gz", + raw_defaced_output_path=raw_deface_dir / inputDir.name + + "_t1c_defaced_raw.nii.gz", + normalized_defaced_output_path=norm_deface_dir + / "_t1c_defaced_normalized.nii.gz", atlas_correction=True, normalizer=percentile_normalizer, ) @@ -72,6 +78,10 @@ def preprocess(inputDir): + "_t1_bet_normalized.nii.gz", normalized_skull_output_path=norm_skull_dir / inputDir.name + "_t1_skull_normalized.nii.gz", + raw_defaced_output_path=raw_deface_dir / inputDir.name + + "_t1_defaced_raw.nii.gz", + normalized_defaced_output_path=norm_deface_dir / inputDir.name + + "_t1_defaced_normalized.nii.gz", atlas_correction=True, normalizer=percentile_normalizer, ), @@ -85,6 +95,10 @@ def preprocess(inputDir): + "_t2_bet_normalized.nii.gz", normalized_skull_output_path=norm_skull_dir / inputDir.name + "_t2_skull_normalized.nii.gz", + raw_defaced_output_path=raw_deface_dir / inputDir.name + + "_t2_defaced_raw.nii.gz", + normalized_defaced_output_path=norm_deface_dir / inputDir.name + + "_t2_defaced_normalized.nii.gz", atlas_correction=True, normalizer=percentile_normalizer, ), @@ -98,6 +112,10 @@ def preprocess(inputDir): + "_fla_bet_normalized.nii.gz", normalized_skull_output_path=norm_skull_dir / inputDir.name + "_fla_skull_normalized.nii.gz", + raw_defaced_output_path=raw_deface_dir / inputDir.name + + "_flair_defaced_raw.nii.gz", + normalized_defaced_output_path=norm_deface_dir / inputDir.name + + "_flair_defaced_normalized.nii.gz", atlas_correction=True, normalizer=percentile_normalizer, ), @@ -120,6 +138,7 @@ def preprocess(inputDir): save_dir_atlas_registration=brainles_dir + "/atlas-registration", save_dir_atlas_correction=brainles_dir + "/atlas-correction", save_dir_brain_extraction=brainles_dir + "/brain-extraction", + save_dir_defacing=brainles_dir + "/defacing", )