8000 DOC: Separate Geometry and Header objects · nipy/nibabel@27fd6f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 27fd6f4

Browse files
committed
DOC: Separate Geometry and Header objects
1 parent 9ddbcc7 commit 27fd6f4

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

doc/source/devel/biaps/biap_0009.rst

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The basic API is as follows:
120120

121121
.. code-block:: python
122122
123-
class SurfaceHeader:
123+
class SurfaceGeometry:
124124
@property
125125
def n_coords(self):
126126
""" Number of coordinates """
@@ -155,10 +155,18 @@ The basic API is as follows:
155155
""" Return a SurfaceImage with data corresponding to each face """
156156
157157
158-
class SurfaceImage:
158+
class SurfaceHeader(FileBaseeHeader):
159+
...
160+
161+
162+
class SurfaceImage(FileBasedImage):
159163
@property
160164
def header(self):
161-
""" A SurfaceHeader or None """
165+
""" A SurfaceHeader """
166+
167+
@property
168+
def geometry(self):
169+
""" A SurfaceGeometry or None """
162170
163171
@property
164172
def dataobj(self):
@@ -168,8 +176,8 @@ The basic API is as follows:
168176
2) self.dataobj.shape[0] == self.header.nfaces
169177
"""
170178
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 """
173181
174182
175183
Here we present common use cases:
@@ -205,22 +213,22 @@ With the proposed API, we could interface as follows:
205213
206214
def plot_surf_img(img, surface="inflated"):
207215
from nilearn.plotting import plot_surf
208-
coords, triangles = img.header.get_mesh(name=surface)
216+
coords, triangles = img.geometry.get_mesh(name=surface)
209217
210218
data = tstats.get_data()
211219
212220
return plot_surf((triangles, coords), data)
213221
214222
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")
216224
plot_surf_img(tstats)
217225
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.
219227

220228
******************
221229
* Open questions *
222230
******************
223231

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
226234
should there be a bit more ecosystem-local logic?

0 commit comments

Comments
 (0)
0