4545def test_SurfaceTransformBase (testdata_path ):
4646 # note these transformations are a bit of a weird use of surface transformation, but I'm
4747 # just testing the base class and the io
48- sphere_reg_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
48+ sphere_reg_path = (
49+ testdata_path
50+ / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
51+ )
4952 pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
5053
5154 sphere_reg = SurfaceMesh (nb .load (sphere_reg_path ))
@@ -71,7 +74,10 @@ def test_SurfaceTransformBase(testdata_path):
7174def test_SurfaceCoordinateTransform (testdata_path ):
7275 # note these transformations are a bit of a weird use of surface transformation, but I'm
7376 # just testing the class and the io
74- sphere_reg_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
77+ sphere_reg_path = (
78+ testdata_path
79+ / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
80+ )
7581 pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
7682 fslr_sphere_path = testdata_path / "tpl-fsLR_hemi-R_den-32k_sphere.surf.gii"
7783
@@ -107,8 +113,12 @@ def test_SurfaceCoordinateTransform(testdata_path):
107113 assert np .all (scti .reference ._triangles == sct .reference ._triangles )
108114 assert scti == sct
109115
116+
110117def test_SurfaceCoordinateTransformIO (testdata_path , tmpdir ):
111- sphere_reg_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
118+ sphere_reg_path = (
119+ testdata_path
120+ / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
121+ )
112122 pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
113123
114124 sct = SurfaceCoordinateTransform (pial_path , sphere_reg_path )
@@ -117,12 +127,22 @@ def test_SurfaceCoordinateTransformIO(testdata_path, tmpdir):
117127 sct2 = SurfaceCoordinateTransform .from_filename (fn )
118128 assert sct == sct2
119129
130+
120131def test_ProjectUnproject (testdata_path ):
121132
122- sphere_reg_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
133+ sphere_reg_path = (
134+ testdata_path
135+ / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
136+ )
123137 fslr_sphere_path = testdata_path / "tpl-fsLR_hemi-R_den-32k_sphere.surf.gii"
124- subj_fsaverage_sphere_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsaverage_desc-reg_sphere.surf.gii"
125- fslr_fsaverage_sphere_path = testdata_path / "tpl-fsLR_space-fsaverage_hemi-R_den-32k_sphere.surf.gii"
138+ subj_fsaverage_sphere_path = (
139+ testdata_path
140+ / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsaverage_desc-reg_sphere.surf.gii"
141+ )
142+ fslr_fsaverage_sphere_path = (
143+ testdata_path
144+ / "tpl-fsLR_space-fsaverage_hemi-R_den-32k_sphere.surf.gii"
145+ )
126146 pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
127147
128148 # test project-unproject funcitonality
@@ -134,13 +154,28 @@ def test_ProjectUnproject(testdata_path):
134154 assert (projunproj_ref .agg_data ()[0 ] - transformed ._coords ).max () < 0.0005
135155 assert np .all (transformed ._triangles == projunproj_ref .agg_data ()[1 ])
136156
157+
137158def test_SurfaceResampler (testdata_path , tmpdir ):
138159 dif_tol = 0.001
139- fslr_sphere_path = testdata_path / "tpl-fsLR_hemi-R_den-32k_sphere.surf.gii"
140- shape_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_thickness.shape.gii"
141- ref_resampled_thickness_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_thickness.shape.gii"
142- pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
143- sphere_reg_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
160+ fslr_sphere_path = (
161+ testdata_path
162+ / "tpl-fsLR_hemi-R_den-32k_sphere.surf.gii"
163+ )
164+ shape_path = (
165+ testdata_path
166+ / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_thickness.shape.gii"
167+ )
168+ ref_resampled_thickness_path = (
169+ testdata_path
170+ / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_thickness.shape.gii"
171+ )
172+ pial_path = (
173+ testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
174+ )
175+ sphere_reg_path = (
176+ testdata_path
177+ / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_space-fsLR_desc-reg_sphere.surf.gii"
178+ )
144179
145180 fslr_sphere = SurfaceMesh (nb .load (fslr_sphere_path ))
146181 sphere_reg = SurfaceMesh (nb .load (sphere_reg_path ))
@@ -177,7 +212,7 @@ def test_SurfaceResampler(testdata_path, tmpdir):
177212 resampling .to_filename (fn )
178213 resampling2 = SurfaceResampler .from_filename (fn )
179214
180- #assert resampling2 == resampling
215+ # assert resampling2 == resampling
181216 assert np .allclose (resampling2 .reference ._coords , resampling .reference ._coords )
182217 assert np .all (resampling2 .reference ._triangles == resampling .reference ._triangles )
183218 assert np .allclose (resampling2 .reference ._coords , resampling .reference ._coords )
0 commit comments