subject.surface: Load a surface for a subject.

View source: R/fsdir_abstraction_subject.R

subject.surfaceR Documentation

Load a surface for a subject.

Description

Load a brain surface mesh for a subject.

Usage

subject.surface(
  subjects_dir,
  subject_id,
  surface = "white",
  hemi = "both",
  force_hemilist = FALSE,
  as_tm = FALSE
)

Arguments

subjects_dir

string. The FreeSurfer SUBJECTS_DIR, i.e., a directory containing the data for all your subjects, each in a subdir named after the subject identifier.

subject_id

string. The subject identifier

surface

string. The surface name. E.g., "white", or "pial". Used to construct the name of the surface file to be loaded.

hemi

string, one of 'lh', 'rh', or 'both'. The hemisphere name. Used to construct the names of the surface file to be loaded. For 'both', see the information on the return value.

force_hemilist

logical, whether to return a hemilist even if the 'hemi' parameter is not set to 'both'

as_tm

logical, whether to return an rgl::tmesh3d instead of an fs.surface instance by applying the fs.surface.to.tmesh3d function.

Value

the 'fs.surface' instance, as returned by read.fs.surface. If parameter 'hemi' is set to 'both', a named list with entries 'lh' and 'rh' is returned, and the values of are the respective surfaces. The mesh data structure used in 'fs.surface' is a *face index set*.

See Also

Other surface mesh functions: face.edges(), label.border(), mesh.vertex.included.faces(), mesh.vertex.neighbors(), vis.path.along.verts()

Examples

## Not run: 
   fsbrain::download_optional_data();
   subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
   lh_white = subject.surface(subjects_dir, "subject1", "white", "lh");

## End(Not run)


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