File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase:
49
49
# * Always return a nitransforms TransformBase
50
50
# * Construct warp affine from fixed parameters
51
51
#
52
- # This should be upstreamed into nitransforms
52
+ # This has been upstreamed into nitransforms.
53
+ # Future versions should switch to using nitransforms directly.
53
54
h = h5py .File (filename )
54
55
xform = ITKCompositeH5 .from_h5obj (h )
55
56
@@ -78,14 +79,6 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase:
78
79
spacing = transform2 ['TransformFixedParameters' ][6 :9 ]
79
80
direction = transform2 ['TransformFixedParameters' ][9 :].reshape ((3 , 3 ))
80
81
81
- # We are not yet confident that we handle anisotropic spacing
82
- # or direction cosine ordering correctly.
83
- # If we confirm or fix, we can remove these checks.
84
- if not np .allclose (spacing , spacing [0 ]):
85
- raise ValueError (f'Anisotropic spacing: { spacing } ' )
86
- if not np .allclose (direction , direction .T ):
87
- raise ValueError (f'Asymmetric direction matrix: { direction } ' )
88
-
89
82
# ITK uses LPS affines
90
83
lps_affine = compose_affine (T = origin , R = direction , Z = spacing )
91
84
ras_affine = np .diag ([- 1 , - 1 , 1 , 1 ]) @ lps_affine
You can’t perform that action at this time.
0 commit comments