Skip to content

Commit 68ccc85

Browse files
committed
enh: minor edits to minimize conflicts with #28.
1 parent c656db9 commit 68ccc85

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/nifreeze/data/dmri.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def set_transform(self, index: int, affine: np.ndarray, order: int = 3) -> None:
130130
if not Path(self._filepath).exists():
131131
self.to_filename(self._filepath)
132132

133-
reference = namedtuple("ImageGrid", ("shape", "affine"))(
134-
shape=self.dataobj.shape[:3], affine=self.affine
135-
)
133+
ImageGrid = namedtuple("ImageGrid", ("shape", "affine"))
134+
reference = ImageGrid(shape=self.dataobj.shape[:3], affine=self.affine)
135+
136136
xform = Affine(matrix=affine, reference=reference)
137137
bvec = self.gradients[:3, index]
138138

src/nifreeze/registration/ants.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ def _run_registration(
469469
registration.inputs.fixed_image_masks = ["NULL", bmask_img]
470470

471471
if em_affines is not None and np.any(em_affines[vol_idx, ...]):
472-
reference = namedtuple("ImageGrid", ("shape", "affine"))(shape=shape, affine=affine)
472+
ImageGrid = namedtuple("ImageGrid", ("shape", "affine"))
473+
reference = ImageGrid(shape=shape, affine=affine)
473474
initial_xform = Affine(matrix=em_affines[vol_idx], reference=reference)
474475
mat_file = dirname / f"init_{i_iter}_{vol_idx:05d}.mat"
475476
initial_xform.to_filename(mat_file, fmt="itk")

0 commit comments

Comments
 (0)