Skip to content

Commit

Permalink
clean coreg
Browse files Browse the repository at this point in the history
Signed-off-by: neuronflow <[email protected]>
  • Loading branch information
neuronflow committed Dec 22, 2023
1 parent 2eba656 commit 358891a
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions brainles_preprocessing/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,17 @@ def run(
registration_dir=coregistration_dir,
moving_image_name=file_name,
)
self._save_coregistration(
coregistration_dir=coregistration_dir,
save_dir_coregistration=save_dir_coregistration,

shutil.copyfile(
src=self.center_modality.input_path,
dst=os.path.join(
coregistration_dir,
f"native__{self.center_modality.modality_name}.nii.gz",
)

self._save_output(
src=coregistration_dir,
save_dir=save_dir_coregistration,
)

# Register center modality to atlas
Expand Down Expand Up @@ -195,27 +203,7 @@ def _save_output(
dirs_exist_ok=True,
)

def _save_coregistration(
self,
coregistration_dir: str,
save_dir_coregistration: Optional[str],
):
if save_dir_coregistration:
save_dir_coregistration = turbopath(save_dir_coregistration)
native_cm = os.path.join(
coregistration_dir,
f"native__{self.center_modality.modality_name}.nii.gz",
)

shutil.copyfile(
src=self.center_modality.input_path,
dst=native_cm,
)
shutil.copytree(
src=coregistration_dir,
dst=save_dir_coregistration,
dirs_exist_ok=True,
)


class PreprocessorGPU(Preprocessor):
Expand Down

0 comments on commit 358891a

Please sign in to comment.