File size: 1,287 Bytes
0d6a80f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | --- estimator.py.orig 2026-10-18 21:11:40.050259152 -0400
+++ estimator.py 2026-10-18 21:13:03.554800501 -0400
@@ -223,7 +223,15 @@
else:
dataset_length = len(dataset) - self._start_index
- with TemporaryDirectory() as tmp_dir:
+ import contextlib
+ import os
+
+ _keep = os.environ.get("NIFREEZE_KEEP_DIR")
+ if _keep:
+ Path(_keep).mkdir(parents=True, exist_ok=True)
+ with (
+ contextlib.nullcontext(_keep) if _keep else TemporaryDirectory()
+ ) as tmp_dir:
print(f"Processing in <{tmp_dir}>")
ptmp_dir = Path(tmp_dir)
@@ -270,6 +278,8 @@
# update
dataset.set_transform(i, xform.matrix)
+ with open(ptmp_dir / "order.txt", "a") as _f:
+ _f.write(f"{i}\n")
pbar.update()
return self
--- registration/ants.py.orig 2026-10-18 21:11:40.047381430 -0400
+++ registration/ants.py 2026-10-18 21:13:03.555341791 -0400
@@ -435,6 +435,11 @@
if num_threads:
reg_iface.inputs.num_threads = num_threads
+ import os
+
+ if os.environ.get("NIFREEZE_ANTS_FLOAT") == "1":
+ reg_iface.inputs.float = True
+
return reg_iface
|