vertex_closest_regions: Find closest regions to vertex using Euclidean or geodesic...

Description Usage Arguments Value See Also Examples

View source: R/closest_atlas_regions.R

Description

Finds the closest atlas regions according to the brain surface parcellation 'brainparc' for the given query vertices.

Usage

1
2
3
4
5
6
7
8
9
vertex_closest_regions(
  brainparc,
  vertices,
  hemis,
  linkage = "single",
  distance = "euclidean",
  silent = getOption("brainloc.silent", default = FALSE),
  num_regions_to_report = 5L
)

Arguments

brainparc

a brain parcellation, see functions like brainparc_fs to get one.

vertices

integer vector, the query vertex indices (from the surface in the brainparc).

hemis

character string vector, the hemispheres for each of the vertices. Allowed entries are "lh" and "rh", for the left and right brain hemisphere, respectively. Must have same length as the 'vertices' vector (or exactly length 1, in which case we assume that this is the hemi for ALL query vertices).

linkage

character string, one of "single" or "centroid". Defines how the distance from a vertex to a region of vertices is computed. "single": Euclidean distance from query vertex to the closest vertex of the atlas region. "centroid": Euclidean distance from query vertex to the mean of the vertex coordinates of the atlas region.

distance

character string, one of "euclidean" or "geodesic". The latter is only supported with linkage = 'single'.

silent

logical, whether to suppress console messages.

num_regions_to_report

scalar integer, the number of closest regions to report (will be reported in increasing order, by distance). Pass NULL to get all regions.

Value

a data.frame, the column names should be obvious.

See Also

coord_closest_regions if you have a coordinate (on or near the surface) instead of a vertex.

Examples

1
2
3
4
5
## Not run: 
bp = brainparc_fs(get_subjects_dir(), "fsaverage", atlas="aparc");
vertex_closest_regions(bp, vertices=c(10, 20), hemis=c("lh", "rh"));

## End(Not run)

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