Skip to content

Commit 9ecd820

Browse files
committed
MNT: Remove assert that was a sanity check. More confident now
1 parent 3ed88fc commit 9ecd820

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

fmriprep/utils/transforms.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase:
8484
msg += f'Found: {fixed_params}'
8585
if not np.array_equal(fixed_params[6:], FIXED_PARAMS[6:]):
8686
raise ValueError(msg)
87-
warnings.warn(msg)
87+
warnings.warn(msg, stacklevel=1)
8888

8989
shape = tuple(fixed_params[:3].astype(int))
9090
warp = h['TransformGroup']['2']['TransformParameters'][:]
@@ -96,18 +96,5 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase:
9696
warp_affine[:3, 3] = fixed_params[3:6]
9797
lps_to_ras = np.eye(4) * np.array([-1, -1, 1, 1])
9898
warp_affine = lps_to_ras @ warp_affine
99-
if np.array_equal(fixed_params, FIXED_PARAMS):
100-
# Confirm that we construct the right affine when fixed parameters are known
101-
assert np.array_equal(
102-
warp_affine,
103-
np.array(
104-
[
105-
[1.0, 0.0, 0.0, -96.0],
106-
[0.0, 1.0, 0.0, -132.0],
107-
[0.0, 0.0, 1.0, -78.0],
108-
[0.0, 0.0, 0.0, 1.0],
109-
]
110-
),
111-
)
11299
transforms.insert(0, nt.DenseFieldTransform(nb.Nifti1Image(warp, warp_affine)))
113100
return nt.TransformChain(transforms)

0 commit comments

Comments
 (0)