45
45
def test_SurfaceTransformBase (testdata_path ):
46
46
# note these transformations are a bit of a weird use of surface transformation, but I'm
47
47
# 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
+ )
49
52
pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
50
53
51
54
sphere_reg = SurfaceMesh (nb .load (sphere_reg_path ))
@@ -71,7 +74,10 @@ def test_SurfaceTransformBase(testdata_path):
71
74
def test_SurfaceCoordinateTransform (testdata_path ):
72
75
# note these transformations are a bit of a weird use of surface transformation, but I'm
73
76
# 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
+ )
75
81
pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
76
82
fslr_sphere_path = testdata_path / "tpl-fsLR_hemi-R_den-32k_sphere.surf.gii"
77
83
@@ -107,8 +113,12 @@ def test_SurfaceCoordinateTransform(testdata_path):
107
113
assert np .all (scti .reference ._triangles == sct .reference ._triangles )
108
114
assert scti == sct
109
115
116
+
110
117
def 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
+ )
112
122
pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
113
123
114
124
sct = SurfaceCoordinateTransform (pial_path , sphere_reg_path )
@@ -117,12 +127,22 @@ def test_SurfaceCoordinateTransformIO(testdata_path, tmpdir):
117
127
sct2 = SurfaceCoordinateTransform .from_filename (fn )
118
128
assert sct == sct2
119
129
130
+
120
131
def test_ProjectUnproject (testdata_path ):
121
132
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
+ )
123
137
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
+ )
126
146
pial_path = testdata_path / "sub-sid000005_ses-budapest_acq-MPRAGE_hemi-R_pial.surf.gii"
127
147
128
148
# test project-unproject funcitonality
@@ -134,13 +154,28 @@ def test_ProjectUnproject(testdata_path):
134
154
assert (projunproj_ref .agg_data ()[0 ] - transformed ._coords ).max () < 0.0005
135
155
assert np .all (transformed ._triangles == projunproj_ref .agg_data ()[1 ])
136
156
157
+
137
158
def test_SurfaceResampler (testdata_path , tmpdir ):
138
159
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
+ )
144
179
145
180
fslr_sphere = SurfaceMesh (nb .load (fslr_sphere_path ))
146
181
sphere_reg = SurfaceMesh (nb .load (sphere_reg_path ))
@@ -177,7 +212,7 @@ def test_SurfaceResampler(testdata_path, tmpdir):
177
212
resampling .to_filename (fn )
178
213
resampling2 = SurfaceResampler .from_filename (fn )
179
214
180
- #assert resampling2 == resampling
215
+ # assert resampling2 == resampling
181
216
assert np .allclose (resampling2 .reference ._coords , resampling .reference ._coords )
182
217
assert np .all (resampling2 .reference ._triangles == resampling .reference ._triangles )
183
218
assert np .allclose (resampling2 .reference ._coords , resampling .reference ._coords )
0 commit comments