v2.0.0
Loading...
Searching...
No Matches
rtsourceinterpolationmatworker.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef BRAINVIEW_RTSOURCEINTERPOLATIONMATWORKER_H
36#define BRAINVIEW_RTSOURCEINTERPOLATIONMATWORKER_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
43
44#include <QObject>
45#include <QMutex>
46#include <QSharedPointer>
47#include <QVector>
48#include <QMap>
49#include <QList>
50#include <QString>
51#include <vector>
52#include <Eigen/Core>
53#include <Eigen/SparseCore>
54
55//=============================================================================================================
56// FORWARD DECLARATIONS
57//=============================================================================================================
58
59namespace FSLIB {
60 class Label;
61}
62
63//=============================================================================================================
64// DEFINE NAMESPACE
65//=============================================================================================================
66
67namespace DISP3DRHILIB {
68
69//=============================================================================================================
92{
93 Q_OBJECT
94
95public:
96 //=========================================================================================================
104
105 //=========================================================================================================
111 explicit RtSourceInterpolationMatWorker(QObject *parent = nullptr);
112
113 //=========================================================================================================
121 void setInterpolationFunction(const QString &sInterpolationFunction);
122
123 //=========================================================================================================
130 void setCancelDistance(double dCancelDist);
131
132 //=========================================================================================================
140 void setInterpolationInfoLeft(const Eigen::MatrixX3f &matVertices,
141 const std::vector<Eigen::VectorXi> &vecNeighborVertices,
142 const Eigen::VectorXi &vecSourceVertices);
143 //=========================================================================================================
151 void setInterpolationInfoRight(const Eigen::MatrixX3f &matVertices,
152 const std::vector<Eigen::VectorXi> &vecNeighborVertices,
153 const Eigen::VectorXi &vecSourceVertices);
154 //=========================================================================================================
162 void setVisualizationType(int iVisType);
163
164 //=========================================================================================================
173 void setAnnotationInfoLeft(const Eigen::VectorXi &vecLabelIds,
174 const QList<FSLIB::Label> &lLabels,
175 const Eigen::VectorXi &vecVertNo);
176
177 //=========================================================================================================
185 void setAnnotationInfoRight(const Eigen::VectorXi &vecLabelIds,
186 const QList<FSLIB::Label> &lLabels,
187 const Eigen::VectorXi &vecVertNo);
188
189public slots:
190 //=========================================================================================================
196 void computeInterpolationMatrix();
197
198signals:
199 //=========================================================================================================
205 void newInterpolationMatrixLeftAvailable(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
206
207 //=========================================================================================================
213 void newInterpolationMatrixRightAvailable(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
214
215private:
216 //=========================================================================================================
223 static double (*resolveInterpolationFunction(const QString &name))(double);
224
225 //=========================================================================================================
236 static QSharedPointer<Eigen::SparseMatrix<float>> computeHemi(
237 const Eigen::MatrixX3f &matVertices,
238 const std::vector<Eigen::VectorXi> &vecNeighborVertices,
239 Eigen::VectorXi vecSourceVertices,
240 double dCancelDist,
241 double (*interpFunc)(double));
242
243 //=========================================================================================================
254 static QSharedPointer<Eigen::SparseMatrix<float>> computeAnnotationOperator(
255 const QList<FSLIB::Label> &lLabels,
256 const QMap<qint32, qint32> &mapLabelIdSrc,
257 const QList<int> &vertNos);
258
259 mutable QMutex m_mutex;
260
261 // LH geometry
262 Eigen::MatrixX3f m_matVerticesLh;
263 std::vector<Eigen::VectorXi> m_vecNeighborsLh;
264 Eigen::VectorXi m_vecSourceVerticesLh;
265 bool m_hasLh = false;
266
267 // RH geometry
268 Eigen::MatrixX3f m_matVerticesRh;
269 std::vector<Eigen::VectorXi> m_vecNeighborsRh;
270 Eigen::VectorXi m_vecSourceVerticesRh;
271 bool m_hasRh = false;
272
273 // Interpolation parameters
274 double m_dCancelDist = 0.05;
275 QString m_sInterpolationFunction = QStringLiteral("cubic");
276
277 // Visualization type
278 int m_iVisualizationType = InterpolationBased;
279
280 // LH annotation data
281 QList<FSLIB::Label> m_lLabelsLh;
282 QMap<qint32, qint32> m_mapLabelIdSourcesLh;
283 QList<int> m_vertNosLh;
284 bool m_bAnnotationLhInit = false;
285
286 // RH annotation data
287 QList<FSLIB::Label> m_lLabelsRh;
288 QMap<qint32, qint32> m_mapLabelIdSourcesRh;
289 QList<int> m_vertNosRh;
290 bool m_bAnnotationRhInit = false;
291};
292
293} // namespace DISP3DRHILIB
294
295#endif // BRAINVIEW_RTSOURCEINTERPOLATIONMATWORKER_H
disp3D_rhi library export/import macros.
#define DISP3DRHISHARED_EXPORT
FreeSurfer surface and annotation I/O.
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)
Freesurfer/MNE label.
Definition label.h:81