@@ -120,7 +120,7 @@ The basic API is as follows:
120
120
121
121
.. code-block :: python
122
122
123
- class SurfaceHeader :
123
+ class SurfaceGeometry :
124
124
@ property
125
125
def n_coords (self ):
126
126
""" Number of coordinates """
@@ -155,10 +155,18 @@ The basic API is as follows:
155
155
""" Return a SurfaceImage with data corresponding to each face """
156
156
157
157
158
- class SurfaceImage :
158
+ class SurfaceHeader (FileBaseeHeader ):
159
+ ...
160
+
161
+
162
+ class SurfaceImage (FileBasedImage ):
159
163
@ property
160
164
def header (self ):
161
- """ A SurfaceHeader or None """
165
+ """ A SurfaceHeader """
166
+
167
+ @ property
168
+ def geometry (self ):
169
+ """ A SurfaceGeometry or None """
162
170
163
171
@ property
164
172
def dataobj (self ):
@@ -168,8 +176,8 @@ The basic API is as follows:
168
176
2) self.dataobj.shape[0] == self.header.nfaces
169
177
"""
170
178
171
- def load_header (self , pathlike ):
172
- """ Specify a header to a data-only image """
179
+ def load_geometry (self , pathlike ):
180
+ """ Specify a geometry for a data-only image """
173
181
174
182
175
183
Here we present common use cases:
@@ -205,22 +213,22 @@ With the proposed API, we could interface as follows:
205
213
206
214
def plot_surf_img (img , surface = " inflated" ):
207
215
from nilearn.plotting import plot_surf
208
- coords, triangles = img.header .get_mesh(name = surface)
216
+ coords, triangles = img.geometry .get_mesh(name = surface)
209
217
210
218
data = tstats.get_data()
211
219
212
220
return plot_surf((triangles, coords), data)
213
221
214
222
tstats = SurfaceImage.from_filename(" /data/stats/hemi-L_contrast-taskVsBase_tstat.mgz" )
215
- tstats.load_header (" /data/subjects/fsaverage5" )
223
+ tstats.load_geometry (" /data/subjects/fsaverage5" )
216
224
plot_surf_img(tstats)
217
225
218
- This assumes that ``load_header () `` will be able to identify a FreeSurfer subject directory.
226
+ This assumes that ``load_geometry () `` will be able to identify a FreeSurfer subject directory.
219
227
220
228
******************
221
229
* Open questions *
222
230
******************
223
231
224
- 1) Can/should image and header objects be promiscuous? If I load a GIFTI header ,
225
- should ``header .load_vertex_data() `` accept a FreeSurfer curvature file, or
232
+ 1) Can/should image and geometry objects be promiscuous? If I load a GIFTI geometry ,
233
+ should ``geometry .load_vertex_data() `` accept a FreeSurfer curvature file, or
226
234
should there be a bit more ecosystem-local logic?
0 commit comments