vis.path.along.verts: Draw a 3D line from vertex to vertex

Description Usage Arguments Value See Also Examples

View source: R/helpers.R

Description

To get a nice path along the surface, pass the vertex indices along a geodesic path. Note: You can first open an interactive brain view (‘views=’si'') with a vis* function like vis.subject.morph.native, then run this function to draw into the active plot.

Usage

1
2
3
4
5
6
7
vis.path.along.verts(
  surface_vertices,
  path_vertex_indices = NULL,
  do_vis = TRUE,
  color = "#FF0000",
  no_material = FALSE
)

Arguments

surface_vertices

float matrix of size (n, 3), the surface vertex coordinates, as returned as part of subject.surface or read.fs.surface, in the member "vertices". Can also be a freesurferformats::fs.surface or rgl::tmesh3d instance, in which case the coordinates are extracted automatically.

path_vertex_indices

vector of vertex indices, the path. You will need to have it computed already. (This function does **not** compute geodesic paths, see geodesic.path for that. You can use it to visualize such a path though.) If omitted, the vertex coordinates will be traversed in their given order to create the path.

do_vis

logical, whether to actually draw the path.

color

a color string, like '#FF0000' to color the path.

no_material

logical, whether to use set the custom rendering material properties for path visualization using rgl::material3d before plotting. If you set this to FALSE, no material will be set and you should set it yourself before calling this function, otherwise the looks of the path are undefined (dependent on the default material on your system, or the last material call). Setting this to TRUE also means that the 'color' argument is ignored of course, as the color is part of the material.

Value

n x 3 matrix, the coordinates of the path, with appropriate ones duplicated for rgl pair-wise segments3d rendering.

See Also

vis.paths if you need to draw many paths, geodesic.path to compute a geodesic path.

Other surface mesh functions: face.edges(), label.border(), mesh.vertex.included.faces(), mesh.vertex.neighbors(), subject.surface()

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
  sjd = fsaverage.path(TRUE);
  surface = subject.surface(sjd, 'fsaverage3',
    surface = "white", hemi = "lh");
  p = geodesic.path(surface, 5, c(10, 20));
  vis.subject.morph.native(sjd, 'fsaverage3', views='si');
  vis.path.along.verts(surface$vertices, p[[1]]);

## End(Not run)

fsbrain documentation built on Sept. 16, 2021, 5:07 p.m.