label.border.fast: Compute border vertices of a label using Rvcg.

View source: R/helpers.R

label.border.fastR Documentation

Compute border vertices of a label using Rvcg.

Description

Compute border vertices of a label using Rvcg.

Usage

label.border.fast(surface_mesh, label)

Arguments

surface_mesh

an fs.surface instance, see subject.surface.

label

an fs.label instance (see subject.label) or an integer vector, the vertex indices of the label.

Value

named list with entry 'vertices' containing an integer vector with the indices of the border vertices.

Note

This is faster than using the label.border function, but it does not fully match its functionality (some parameter are not implemented for this function), and it requires the Rvcg package, which is an optional dependency.

See Also

label.border, which is slower but provides more options and does not require Rvcg.

Examples

## Not run: 
sjd = fsaverage.path(T);
sj = "fsaverage";
mesh = subject.surface(sjd, sj, hemi="lh");
lab = subject.label(sjd, sj, "cortex", hemi = "lh");
col = rep("white", nrow(mesh$vertices));
bd = fsbrain:::label.border.fast <- function(surface_mesh, label);
col[bd$vertices] = "red";
vis.fs.surface(mesh, col=col);

## End(Not run)


dfsp-spirit/fsbrain documentation built on Nov. 28, 2024, 10:29 a.m.