Stateless utilities that grow, split and convert FsLabel objects on a FreeSurfer triangular surface. More...
#include <fs_label_utils.h>
Static Public Member Functions | |
| static FsLabel | growLabel (const FsLabel &label, const FsSurface &surface, int nSteps) |
| Grow a label by expanding along the surface mesh. | |
| static QList< FsLabel > | splitLabel (const FsLabel &label, const FsSurface &surface) |
| Split a label into connected components. | |
| static QList< FsLabel > | stcToLabel (const Eigen::MatrixXd &stcData, const Eigen::VectorXi &vertices, const FsSurface &surface, double dThreshold=0.0, int iHemi=0) |
| Convert a source estimate to labels by thresholding. | |
| static Eigen::MatrixXd | labelsToStc (const QList< FsLabel > &labels, const Eigen::VectorXi &stcVertices, int nTimes) |
| Convert labels to a binary source estimate mask. | |
| static QList< QSet< int > > | buildAdjacency (const Eigen::MatrixX3i &tris, int nVerts) |
| Build adjacency list from surface triangle mesh. | |
Stateless utilities that grow, split and convert FsLabel objects on a FreeSurfer triangular surface.
All operations take an FsSurface as the topology source and treat its triangle faces as the vertex adjacency graph. The helpers are static because labels carry their own state and the surface is supplied per call, mirroring the function-based API used by MNE-Python.
Definition at line 68 of file fs_label_utils.h.
|
static |
Build adjacency list from surface triangle mesh.
| [in] | tris | Triangle matrix (n_tris × 3). |
| [in] | nVerts | Total number of vertices. |
Definition at line 43 of file fs_label_utils.cpp.
|
static |
Grow a label by expanding along the surface mesh.
Starting from the seed vertices in the label, expands outward by nSteps along surface edges (breadth-first).
| [in] | label | The seed label to grow from. |
| [in] | surface | The surface providing vertex adjacency. |
| [in] | nSteps | Number of expansion steps. |
Definition at line 67 of file fs_label_utils.cpp.
|
static |
Convert labels to a binary source estimate mask.
Creates a matrix of ones for vertices inside the labels, zeros otherwise.
| [in] | labels | Labels to convert. |
| [in] | stcVertices | Vertex indices of the target STC space. |
| [in] | nTimes | Number of time points. |
Definition at line 266 of file fs_label_utils.cpp.
|
static |
Split a label into connected components.
Uses the surface mesh to identify connected sub-labels.
| [in] | label | The label to split. |
| [in] | surface | The surface providing vertex adjacency. |
Definition at line 124 of file fs_label_utils.cpp.
|
static |
Convert a source estimate to labels by thresholding.
Vertices whose absolute value exceeds the threshold at any time point are grouped into connected labels on the surface.
| [in] | stcData | Source estimate data (n_vertices × n_times). |
| [in] | vertices | Vertex indices in the source estimate. |
| [in] | surface | The surface providing positions and adjacency. |
| [in] | dThreshold | Absolute threshold for inclusion (default 0.0 = include all). |
| [in] | iHemi | Hemisphere id (0=lh, 1=rh). |
Definition at line 208 of file fs_label_utils.cpp.