Skip to content

Commit 3e89a50

Browse files
committed
DOC: Smoothing example, typo
1 parent 27fd6f4 commit 3e89a50

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

doc/source/devel/biaps/biap_0009.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ The basic API is as follows:
155155
""" Return a SurfaceImage with data corresponding to each face """
156156
157157
158-
class SurfaceHeader(FileBaseeHeader):
158+
class SurfaceHeader(FileBasedHeader):
159159
...
160160
161161
@@ -202,6 +202,21 @@ Data images have their own metadata apart from geometry that needs handling in a
202202
* Data dtype
203203

204204

205+
Smoothing
206+
---------
207+
208+
.. code-block:: python
209+
210+
bold = SurfaceImage.from_filename("/data/func/hemi-L_bold.func.gii")
211+
bold.load_geometry("/data/anat/hemi-L_midthickness.surf.gii")
212+
# Not implementing networkx weighted graph here, so assume we have a method
213+
graph = bold.geometry.get_graph()
214+
distances = distance_matrix(graph) # n_coords x n_coords matrix
215+
weights = normalize(gaussian(distances, sigma))
216+
smoothed = bold.__class__(bold.get_fdata() @ weights, bold.header)
217+
smoothed.to_filename(f"/data/func/hemi-L_smooth-{sigma}_bold.func.gii")
218+
219+
205220
Plotting
206221
--------
207222

0 commit comments

Comments
 (0)