Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0f32b1d

Browse files
committedJan 23, 2025··
fix: pacify mypy
1 parent 254a27e commit 0f32b1d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
 

‎src/nifreeze/cli/run.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@ def main(argv=None) -> None:
4242
# Open the data with the given file path
4343
dataset: BaseDataset = BaseDataset.from_filename(args.input_file)
4444

45-
estimator: Estimator = Estimator()
45+
prev_model: Estimator | None = None
46+
for model in args.models:
47+
estimator: Estimator = Estimator(
48+
args.model,
49+
prev=prev_model,
50+
)
51+
prev_model = estimator
4652

4753
_ = estimator.run(
4854
dataset,
4955
align_kwargs=args.align_config,
50-
models=args.models,
5156
omp_nthreads=args.nthreads,
5257
njobs=args.njobs,
5358
seed=args.seed,

‎src/nifreeze/registration/ants.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def _prepare_registration_data(
130130
131131
"""
132132
clip = clip or "none"
133-
134133
predicted_path = Path(dirname) / f"predicted_{vol_idx:05d}.nii.gz"
135134
sample_path = Path(dirname) / f"sample_{vol_idx:05d}.nii.gz"
136135
_to_nifti(
@@ -151,7 +150,7 @@ def _prepare_registration_data(
151150
ImageGrid = namedtuple("ImageGrid", ("shape", "affine"))
152151
reference = ImageGrid(shape=sample.shape[:3], affine=affine)
153152
initial_xform = Affine(matrix=init_affine, reference=reference)
154-
init_path = dirname / f"init_{vol_idx:05d}.mat"
153+
init_path = Path(dirname) / f"init_{vol_idx:05d}.mat"
155154
initial_xform.to_filename(init_path, fmt="itk")
156155

157156
return predicted_path, sample_path, init_path

0 commit comments

Comments
 (0)
Please sign in to comment.