v2.0.0
Loading...
Searching...
No Matches
fs_label_utils.h
Go to the documentation of this file.
1//=============================================================================================================
26
27#ifndef FS_LABEL_UTILS_H
28#define FS_LABEL_UTILS_H
29
30//=============================================================================================================
31// INCLUDES
32//=============================================================================================================
33
34#include "fs_global.h"
35#include "fs_label.h"
36#include "fs_surface.h"
37
38//=============================================================================================================
39// EIGEN INCLUDES
40//=============================================================================================================
41
42#include <Eigen/Core>
43#include <Eigen/SparseCore>
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QList>
50#include <QSet>
51
52//=============================================================================================================
53// DEFINE NAMESPACE FSLIB
54//=============================================================================================================
55
56namespace FSLIB
57{
58
59//=============================================================================================================
71{
72public:
73 //=========================================================================================================
86 static FsLabel growLabel(const FsLabel& label,
87 const FsSurface& surface,
88 int nSteps);
89
90 //=========================================================================================================
102 static QList<FsLabel> splitLabel(const FsLabel& label,
103 const FsSurface& surface);
104
105 //=========================================================================================================
120 static QList<FsLabel> stcToLabel(const Eigen::MatrixXd& stcData,
121 const Eigen::VectorXi& vertices,
122 const FsSurface& surface,
123 double dThreshold = 0.0,
124 int iHemi = 0);
125
126 //=========================================================================================================
138 static Eigen::MatrixXd labelsToStc(const QList<FsLabel>& labels,
139 const Eigen::VectorXi& stcVertices,
140 int nTimes);
141
142 //=========================================================================================================
151 static QList<QSet<int>> buildAdjacency(const Eigen::MatrixX3i& tris,
152 int nVerts);
153};
154
155} // namespace FSLIB
156
157#endif // FS_LABEL_UTILS_H
Reader and in-memory representation of a FreeSurfer/MNE surface label (.label).
Reader and in-memory representation of a single FreeSurfer triangular surface (e.g....
Export/import macros and build-info accessors for the FSLIB FreeSurfer I/O library.
#define FSSHARED_EXPORT
Definition fs_global.h:38
FreeSurfer surface, annotation and parcellation I/O for mne-cpp.
A FreeSurfer/MNE surface label: per-vertex indices, Tk-RAS positions and scalar values for one hemisp...
Definition fs_label.h:81
Stateless utilities that grow, split and convert FsLabel objects on a FreeSurfer triangular surface.
static QList< QSet< int > > buildAdjacency(const Eigen::MatrixX3i &tris, int nVerts)
Build adjacency list from surface triangle mesh.
static QList< FsLabel > splitLabel(const FsLabel &label, const FsSurface &surface)
Split a label into connected components.
static FsLabel growLabel(const FsLabel &label, const FsSurface &surface, int nSteps)
Grow a label by expanding along the surface mesh.
static Eigen::MatrixXd labelsToStc(const QList< FsLabel > &labels, const Eigen::VectorXi &stcVertices, int nTimes)
Convert labels to a binary source estimate mask.
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.
In-memory FreeSurfer triangular cortical surface for one hemisphere.
Definition fs_surface.h:94