pervertexdata.smoothnn | R Documentation |
Smoothing of surface data by iterative mesh neighborhood averaging. Assigns to each vertex the average of the values in its 1-ring neighborhood (based on the mesh edges).
pervertexdata.smoothnn(surface, data, num_iter, k = 1L)
surface |
an |
data |
numerical vector, the per-vertex data for the surface. Values set to |
num_iter |
positive scalar integer, the number of times to perform the averaging. Depends on the mesh resolution and desired smoothing, higher resolution meshes will need more passes. Typical values are in range 20 to 150, but also depend on the setting of parameter 'k', of course. |
k |
positive scalar integer, the neighborhood size in hops along the mesh edges (the k for the k-ring neighborhood). For higher resolution meshes it makes sense to increase this, typical values are roughly in range 1 to 10. |
The iteration is currently done in R, which means the performance is not great.
This does NOT smooth the mesh, it smoothes per-vertex values assigned to mesh vertices.
To see relevant smoothing for full-resolution FreeSurfer meshes, try setting num_iter=50, k=8
for a start.
## Not run:
sjd = fsaverage.path(T);
sj = "fsaverage3";
surface = subject.surface(sjd, sj, hemi = "lh");
th = subject.morph.native(sjd, sj, "thickness", hemi="lh", cortex_only=T);
th_smooth = pervertexdata.smoothnn(surface, th, num_iter=15L);
vis.data.on.subject(sjd, sj, morph_data_lh = th);
vis.data.on.subject(sjd, sj, morph_data_lh = th_smooth);
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.