dist_from_mask_surf: Distance from mask on surface

View source: R/utils_surf.R

dist_from_mask_surfR Documentation

Distance from mask on surface

Description

Identify the vertices within boundary_width edges of a vertex in the input mask on a triangular mesh. Returns the number of edges a vertex is away from the closest mask vertex.

Usage

dist_from_mask_surf(faces, mask, boundary_width = 10)

Arguments

faces

An F \times 3 matrix, where each row contains the vertex indices for a given triangular face in the mesh. F is the number of faces in the mesh.

mask

A length V logical vector indicating if each vertex is within the input mask.

boundary_width

A positive integer representing the width of the boundary to compute. The furthest vertices from the input mask will be this number of edges away from the closest vertex in the input mask. Default: 10.

Value

A length-V numeric vector. Each entry corresponds to the vertex with the same index. For vertices within the boundary, the value will be the number of vertices away from the closest vertex in the input mask. Vertices inside the input mask but at the edge of it (i.e. the vertices that define the boundary) will have value 0. Then, all other vertices will have value -1.


ciftiTools documentation built on Oct. 4, 2024, 1:12 a.m.