brain_deer.surface.meshes¶
Template surface geometry: loading, hemisphere pairing, VTK conversion.
Geometry is represented headlessly as SurfaceGeometry (vertices + faces
as numpy arrays) so parsing and transforms are testable without VTK. Conversion to
vtkPolyData is a separate, lazily-imported helper used only by the renderer.
Supported inputs:
- FreeSurfer binary geometry (lh.pial etc.) via nibabel.freesurfer.
- GIFTI surface (*.surf.gii) via nibabel.gifti.
- FreeSurfer ASCII (*.asc) — small dependency-free parser.
Classes¶
A triangulated surface in RAS+ millimetres. |
Functions¶
|
Load surface geometry from FreeSurfer binary, GIFTI, or ASCII. |
|
Merge two hemisphere geometries into one (faces re-indexed). |
|
Convert a |
Module Contents¶
- class brain_deer.surface.meshes.SurfaceGeometry¶
A triangulated surface in RAS+ millimetres.
- brain_deer.surface.meshes.load_surface_geometry(path: str, *, hemi: str | None = None) SurfaceGeometry¶
Load surface geometry from FreeSurfer binary, GIFTI, or ASCII.
- brain_deer.surface.meshes.combine_hemispheres(lh: SurfaceGeometry, rh: SurfaceGeometry) SurfaceGeometry¶
Merge two hemisphere geometries into one (faces re-indexed).
- brain_deer.surface.meshes.to_vtk_polydata(geom: SurfaceGeometry)¶
Convert a
SurfaceGeometrytovtkPolyDatawith normals (lazy VTK import).