Interpolate per-vertex data at the query points. Or map per-vertex data between subjects.
Source:R/kdtree.R
linear_interpolate_kdtree.RdThis method uses inverse distance weight interpolation within a triangle. First, the face of the mesh that the query_coordinate falls into is determined. Then results in 3 vertices with respective per-vertex data, and a query coordinate. We then compute the distance to all 3 vertices, and perform inverse distance weight interpolation with a beta setting defined by parameter iwd_beta.
Arguments
- query_coordinates
nx3 numerical matrix of x,y,z coordinates. These are typically the vertex positions of a second (spherical!) mesh for that you need per-vertex data (e.g., the
fsaverage6mesh).- mesh
fs.surface instance, see
read.fs.surfaceorsubject.surfaceto get one, or turn anrgltmeshinto one withtmesh3d.to.fs.surface.- pervertex_data
numerical vector, the continuous per-vertex data for the vertices of the mesh.
- iwd_beta
scalar double, the
betaparameter for the inverse distance weight interpolation with the triangle. See details.- ...
ignore, passed on to internal function
interp_tris.
Value
named list with entries: 'interp_values', the numerical vector of interpolated data at the query_coordinates. 'nearest_vertex_in_face' the nearest vertex in the face that the respective query coordinate falls into, 'nearest_face' the index of the nearest face that the respective query coordinate falls into.