neuromodes.io.read_surf

neuromodes.io.read_surf(surf: str | Path | Trimesh | TriaMesh | dict) Trimesh

Load and validate a surface mesh.

Parameters

surfstr, Path, trimesh.Trimesh, lapy.TriaMesh, or dict

Surface mesh specified as a file path (string or Path) to a VTK (.vtk), GIFTI (.gii), or FreeSurfer file (.white, .pial, .inflated, .orig, .sphere, .smoothwm, .qsphere, .fsaverage), an instance of trimesh.Trimesh or lapy.TriaMesh, or a dictionary with vertices and faces keys.

Returns

trimesh.Trimesh

Validated surface mesh with vertices and faces.

Raises

ValueError

If surf is a path-like string to an unsupported format.

ValueError

If surf is a path-like string to a file that does not exist.