fs.patch: Constructor for fs.patch

Description Usage Arguments Value See Also Examples

View source: R/write_fs_patch.R

Description

Constructor for fs.patch

Usage

1
fs.patch(vertices, faces = NULL)

Arguments

vertices

numerical *n*x5 matrix (or *n*x7 matrix), see read.fs.patch for details. If it has 5 columns, columns 6-7 will be computed automatically from the first 5 columns (from column 1 and 5).

faces

numerical *n*x5 matrix, see read.fs.patch.asc for details. Can be 'NULL'.

Value

instance of class 'fs.patch'

See Also

Other patch functions: read.fs.patch.asc(), read.fs.patch(), write.fs.patch()

Examples

1
2
3
4
5
6
7
8
    num_vertices = 6L;   # a tiny patch
    vertices = matrix(rep(0., num_vertices*5), ncol=5);
    vertices[,1] = seq.int(num_vertices);  # 1-based vertex indices
    vertices[,2:4] = matrix(rnorm(num_vertices*3, 8, 2), ncol=3);  # vertex coords
    vertices[,5] = rep(0L, num_vertices);  # is_border
    vertices[3,5] = 1L;  # set a vertex to be a border vertex
    patch = fs.patch(vertices);
    patch;

freesurferformats documentation built on Feb. 11, 2022, 5:06 p.m.