v2.0.0
Loading...
Searching...
No Matches
rtsourceinterpolationmatworker.h
Go to the documentation of this file.
1//=============================================================================================================
24
25#ifndef BRAINVIEW_RTSOURCEINTERPOLATIONMATWORKER_H
26#define BRAINVIEW_RTSOURCEINTERPOLATIONMATWORKER_H
27
28//=============================================================================================================
29// INCLUDES
30//=============================================================================================================
31
32#include "../disp3D_global.h"
33
34#include <QObject>
35#include <QMutex>
36#include <QSharedPointer>
37#include <QVector>
38#include <QMap>
39#include <QList>
40#include <QString>
41#include <vector>
42#include <Eigen/Core>
43#include <Eigen/SparseCore>
44
45//=============================================================================================================
46// FORWARD DECLARATIONS
47//=============================================================================================================
48
49namespace FSLIB {
50 class FsLabel;
51}
52
53//=============================================================================================================
54// DEFINE NAMESPACE
55//=============================================================================================================
56
57namespace DISP3DLIB {
58
59//=============================================================================================================
82{
83 Q_OBJECT
84
85public:
86 //=========================================================================================================
94
95 //=========================================================================================================
101 explicit RtSourceInterpolationMatWorker(QObject *parent = nullptr);
102
103 //=========================================================================================================
111 void setInterpolationFunction(const QString &sInterpolationFunction);
112
113 //=========================================================================================================
120 void setCancelDistance(double dCancelDist);
121
122 //=========================================================================================================
130 void setInterpolationInfoLeft(const Eigen::MatrixX3f &matVertices,
131 const std::vector<Eigen::VectorXi> &vecNeighborVertices,
132 const Eigen::VectorXi &vecSourceVertices);
133 //=========================================================================================================
141 void setInterpolationInfoRight(const Eigen::MatrixX3f &matVertices,
142 const std::vector<Eigen::VectorXi> &vecNeighborVertices,
143 const Eigen::VectorXi &vecSourceVertices);
144 //=========================================================================================================
152 void setVisualizationType(int iVisType);
153
154 //=========================================================================================================
163 void setAnnotationInfoLeft(const Eigen::VectorXi &vecLabelIds,
164 const QList<FSLIB::FsLabel> &lLabels,
165 const Eigen::VectorXi &vecVertNo);
166
167 //=========================================================================================================
175 void setAnnotationInfoRight(const Eigen::VectorXi &vecLabelIds,
176 const QList<FSLIB::FsLabel> &lLabels,
177 const Eigen::VectorXi &vecVertNo);
178
179public slots:
180 //=========================================================================================================
186 void computeInterpolationMatrix();
187
188signals:
189 //=========================================================================================================
195 void newInterpolationMatrixLeftAvailable(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
196
197 //=========================================================================================================
203 void newInterpolationMatrixRightAvailable(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
204
205private:
206 //=========================================================================================================
213 static double (*resolveInterpolationFunction(const QString &name))(double);
214
215 //=========================================================================================================
226 static QSharedPointer<Eigen::SparseMatrix<float>> computeHemi(
227 const Eigen::MatrixX3f &matVertices,
228 const std::vector<Eigen::VectorXi> &vecNeighborVertices,
229 Eigen::VectorXi vecSourceVertices,
230 double dCancelDist,
231 double (*interpFunc)(double));
232
233 //=========================================================================================================
244 static QSharedPointer<Eigen::SparseMatrix<float>> computeAnnotationOperator(
245 const QList<FSLIB::FsLabel> &lLabels,
246 const QMap<qint32, qint32> &mapLabelIdSrc,
247 const QList<int> &vertNos);
248
249 mutable QMutex m_mutex;
250
251 // LH geometry
252 Eigen::MatrixX3f m_matVerticesLh;
253 std::vector<Eigen::VectorXi> m_vecNeighborsLh;
254 Eigen::VectorXi m_vecSourceVerticesLh;
255 bool m_hasLh = false;
256
257 // RH geometry
258 Eigen::MatrixX3f m_matVerticesRh;
259 std::vector<Eigen::VectorXi> m_vecNeighborsRh;
260 Eigen::VectorXi m_vecSourceVerticesRh;
261 bool m_hasRh = false;
262
263 // Interpolation parameters
264 double m_dCancelDist = 0.05;
265 QString m_sInterpolationFunction = QStringLiteral("cubic");
266
267 // Visualization type
268 int m_iVisualizationType = InterpolationBased;
269
270 // LH annotation data
271 QList<FSLIB::FsLabel> m_lLabelsLh;
272 QMap<qint32, qint32> m_mapLabelIdSourcesLh;
273 QList<int> m_vertNosLh;
274 bool m_bAnnotationLhInit = false;
275
276 // RH annotation data
277 QList<FSLIB::FsLabel> m_lLabelsRh;
278 QMap<qint32, qint32> m_mapLabelIdSourcesRh;
279 QList<int> m_vertNosRh;
280 bool m_bAnnotationRhInit = false;
281};
282
283} // namespace DISP3DLIB
284
285#endif // BRAINVIEW_RTSOURCEINTERPOLATIONMATWORKER_H
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
FreeSurfer surface, annotation and parcellation I/O for mne-cpp.
3-D brain visualisation using the Qt RHI rendering backend.
Background worker for computing source interpolation matrices.
void newInterpolationMatrixRightAvailable(QSharedPointer< Eigen::SparseMatrix< float > > interpMat)
void newInterpolationMatrixLeftAvailable(QSharedPointer< Eigen::SparseMatrix< float > > interpMat)
A FreeSurfer/MNE surface label: per-vertex indices, Tk-RAS positions and scalar values for one hemisp...
Definition fs_label.h:79