coord_closest_vertex: Find closest surface vertex to a point, using Euclidean...

Description Usage Arguments Value Examples

View source: R/closest_atlas_regions.R

Description

Find closest surface vertex to a point, using Euclidean distance.

Usage

1
coord_closest_vertex(coordinate, surfaces)

Arguments

coordinate

nx3 numerical matrix or vector of length 3, the query point coordinates.

surfaces

hemilist of fs.surface instances

Value

a data.frame with columns named 'query_x', 'query_y', 'query_z', 'lh_closest_vertex', 'lh_distance', 'rh_closest_vertex', 'rh_distance', 'both_closest_vertex', 'both_distance', 'both_hemi'.

Examples

1
2
3
4
5
6
## Not run: 
bp = brainparc_fs(fsbrain::fsaverage.path(), "fsaverage", atlas="aparc");
query_coords = matrix(seq.int(9), ncol = 3, byrow = TRUE);
coord_closest_vertex(query_coords, bp$surfaces$white);

## End(Not run)

dfsp-spirit/brainloc documentation built on Jan. 28, 2022, 12:25 p.m.