@@ -97,7 +97,7 @@ def _prepare_registration_data(
97
97
affine : np .ndarray ,
98
98
vol_idx : int ,
99
99
dirname : Path | str ,
100
- clip : str | None = None ,
100
+ clip : str | bool | None = None ,
101
101
init_affine : np .ndarray | None = None ,
102
102
) -> tuple [Path , Path , Path | None ]:
103
103
"""
@@ -129,20 +129,20 @@ def _prepare_registration_data(
129
129
An initialization affine (for second and further estimators).
130
130
131
131
"""
132
- clip = clip or "none"
132
+
133
133
predicted_path = Path (dirname ) / f"predicted_{ vol_idx :05d} .nii.gz"
134
134
sample_path = Path (dirname ) / f"sample_{ vol_idx :05d} .nii.gz"
135
135
_to_nifti (
136
136
sample ,
137
137
affine ,
138
138
sample_path ,
139
- clip = clip .lower () in ("sample" , "both" ),
139
+ clip = str ( clip ) .lower () in ("sample" , "both" , "true " ),
140
140
)
141
141
_to_nifti (
142
142
predicted ,
143
143
affine ,
144
144
predicted_path ,
145
- clip = clip .lower () in ("predicted" , "both" ),
145
+ clip = str ( clip ) .lower () in ("predicted" , "both" , "true " ),
146
146
)
147
147
148
148
init_path = None
@@ -463,10 +463,11 @@ def _run_registration(
463
463
registration = generate_command (
464
464
fixed_path ,
465
465
moving_path ,
466
- terminal_output = "file" ,
467
466
environ = environ ,
468
467
** align_kwargs ,
469
468
)
469
+ registration .terminal_output = "file"
470
+
470
471
if num_threads :
471
472
registration .inputs .num_threads = num_threads
472
473
0 commit comments