Skip to content

Commit 4f1b738

Browse files
committed
fix: v2v -> r2r xform
1 parent 2680959 commit 4f1b738

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nitransforms/io/lta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def set_type(self, target):
247247

248248
# VOX2VOX -> RAS2RAS
249249
if current == 0 and target == 1:
250-
M = np.linalg.inv(src.as_affine()).dot(xform['m_L']).dot(dst.as_affine())
250+
M = dst.as_affine().dot(xform['m_L'].dot(np.linalg.inv(src.as_affine())))
251251
else:
252252
raise NotImplementedError(
253253
"Converting {0} to {1} is not yet available".format(

nitransforms/tests/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_LT_conversions(data_path):
7272
# convert vox2vox LTA to ras2ras
7373
v2v.set_type('LINEAR_RAS_TO_RAS')
7474
assert v2v['type'] == 1
75-
assert np.all(r2r_m == v2v_m)
75+
assert np.allclose(r2r_m, v2v_m)
7676

7777

7878
def test_ITKLinearTransformArray(tmpdir, data_path):

0 commit comments

Comments
 (0)