@@ -171,9 +171,6 @@ def test_apply_linear_transform(tmpdir, get_testdata, get_testmask, image_orient
171
171
"""Check implementation of exporting affines to formats."""
172
172
tmpdir .chdir ()
173
173
174
- if (sw_tool , image_orientation ) == ("afni" , "oblique" ):
175
- pytest .skip ("AFNI oblique transformations not supported yet." )
176
-
177
174
img = get_testdata [image_orientation ]
178
175
msk = get_testmask [image_orientation ]
179
176
@@ -211,10 +208,18 @@ def test_apply_linear_transform(tmpdir, get_testdata, get_testmask, image_orient
211
208
exit_code = check_call ([cmd ], shell = True )
212
209
assert exit_code == 0
213
210
sw_moved_mask = nb .load ("resampled_brainmask.nii.gz" )
211
+
212
+ # Change reference dataset for AFNI & oblique
213
+ if (sw_tool , image_orientation ) == ("afni" , "oblique" ):
214
+ xfm .reference = "resampled_brainmask.nii.gz"
215
+
214
216
nt_moved_mask = xfm .apply (msk , order = 0 )
215
217
nt_moved_mask .set_data_dtype (msk .get_data_dtype ())
218
+ nt_moved_mask .to_filename ("nt_resampled_brainmask.nii.gz" )
216
219
diff = np .asanyarray (sw_moved_mask .dataobj ) - np .asanyarray (nt_moved_mask .dataobj )
217
220
221
+ nt_moved_mask .__class__ (diff , sw_moved_mask .affine , sw_moved_mask .header ).to_filename ("diff.nii.gz" )
222
+
218
223
assert np .sqrt ((diff ** 2 ).mean ()) < RMSE_TOL
219
224
brainmask = np .asanyarray (nt_moved_mask .dataobj , dtype = bool )
220
225
0 commit comments