ciftiTools (version 0.1.6.0)

make_surf: Convert input to a "surf" object

Description

Coerce a file path to a surface GIFTI, a "gifti" object, a list with entries "pointset" and "triangle", or a "surf" object to a "surf" object.

Usage

make_surf(surf, expected_hemisphere = NULL)

gifti_to_surf(surf, expected_hemisphere = NULL)

Arguments

surf

Either a file path to a surface GIFTI; a "gifti" object read by readgii; a list with entries "pointset" and "triangle"; or, a "surf" object.

expected_hemisphere

The expected hemisphere ("left" or "right") of surf. If the hemisphere indicated in the GIFTI metadata is the opposite, an error is raised. If NULL (default), use the GIFTI hemisphere.

Value

The "surf" object: a list with components "vertices" (3D spatial locations), "faces" (defined by three vertices), and "hemisphere" ("left", "right", or NULL if unknown).