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#include <QVector>
52
53//=============================================================================================================
54// DEFINE NAMESPACE FSLIB
55//=============================================================================================================
56
57namespace FSLIB
58{
59
60//=============================================================================================================
72{
73public:
74 //=========================================================================================================
87 static FsLabel growLabel(const FsLabel& label,
88 const FsSurface& surface,
89 int nSteps);
90
106 static FsLabel growCircularLabel(const FsSurface& surface,
107 const QVector<int>& seeds,
108 double extentMm,
109 int hemi,
110 const QString& name);
111
112 //=========================================================================================================
124 static QList<FsLabel> splitLabel(const FsLabel& label,
125 const FsSurface& surface);
126
127 //=========================================================================================================
142 static QList<FsLabel> stcToLabel(const Eigen::MatrixXd& stcData,
143 const Eigen::VectorXi& vertices,
144 const FsSurface& surface,
145 double dThreshold = 0.0,
146 int iHemi = 0);
147
148 //=========================================================================================================
160 static Eigen::MatrixXd labelsToStc(const QList<FsLabel>& labels,
161 const Eigen::VectorXi& stcVertices,
162 int nTimes);
163
164 //=========================================================================================================
173 static QList<QSet<int>> buildAdjacency(const Eigen::MatrixX3i& tris,
174 int nVerts);
175};
176
177} // namespace FSLIB
178
179#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 FsLabel growCircularLabel(const FsSurface &surface, const QVector< int > &seeds, double extentMm, int hemi, const QString &name)
Grow a circular label around seed vertices, as mne.grow_labels does for one seed set.
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