@@ -246,9 +246,11 @@ def test_linear_save(tmpdir, data_path, get_testdata, image_orientation, sw_tool
246246
247247
248248@pytest .mark .parametrize ("store_inverse" , [True , False ])
249- def test_Affine_to_x5 (tmpdir , store_inverse ):
249+ def test_linear_to_x5 (tmpdir , store_inverse ):
250250 """Test affine's operations."""
251251 tmpdir .chdir ()
252+
253+ # Test base operations
252254 aff = nitl .Affine ()
253255 node = aff .to_x5 (
254256 metadata = {"GeneratedBy" : "FreeSurfer 8" }, store_inverse = store_inverse
@@ -261,14 +263,21 @@ def test_Affine_to_x5(tmpdir, store_inverse):
261263 assert node .array_length == 1
262264 assert (node .metadata or {}).get ("GeneratedBy" ) == "FreeSurfer 8"
263265
266+ io .x5 .to_filename ("export1.x5" , [node ])
267+
268+ # Test with Domain
264269 img = nb .Nifti1Image (np .zeros ((2 , 2 , 2 ), dtype = "float32" ), np .eye (4 ))
265270 img_path = Path (tmpdir ) / "ref.nii.gz"
266271 img .to_filename (str (img_path ))
267-
268272 aff .reference = img_path
269273 node = aff .to_x5 ()
270274 assert node .domain .grid
271275 assert node .domain .size == aff .reference .shape
276+ io .x5 .to_filename ("export2.x5" , [node ])
277+
278+ # Test with Jacobian
279+ node .jacobian = np .zeros ((2 , 2 , 2 ), dtype = "float32" )
280+ io .x5 .to_filename ("export3.x5" , [node ])
272281
273282
274283def test_mapping_to_x5 ():
0 commit comments