neuromodes.io.mask_surf

neuromodes.io.mask_surf(surf: Trimesh, mask: ArrayLike) Trimesh

Remove specified vertices and corresponding faces from the surface mesh. Returns a validated trimesh.Trimesh object.

Parameters

surftrimesh.Trimesh

The input surface mesh.

maskarray-like

A boolean array indicating which vertices to keep (True) or remove (False).

Returns

trimesh.Trimesh

The masked surface mesh.

Raises

ValueError

If mask does not have a length matching the number of vertices in surf.

Notes

In Trimesh.submesh, repair=False is used to avoid an unnecessary dependency on networkx. Mesh validation is handled separately in check_surf in EigenSolver.