v2.0.0
Loading...
Searching...
No Matches
rtsourcedatacontroller.h
Go to the documentation of this file.
1//=============================================================================================================
23
24#ifndef BRAINVIEW_RTSOURCEDATACONTROLLER_H
25#define BRAINVIEW_RTSOURCEDATACONTROLLER_H
26
27//=============================================================================================================
28// INCLUDES
29//=============================================================================================================
30
31#include "../disp3D_global.h"
32
33#include <QObject>
34#include <QSharedPointer>
35#include <QVector>
36#include <QList>
37#include <QString>
38#include <vector>
39#include <Eigen/Core>
40#include <Eigen/SparseCore>
41
42//=============================================================================================================
43// FORWARD DECLARATIONS
44//=============================================================================================================
45
46class QThread;
47class QTimer;
48
49namespace FSLIB
50{
51class FsLabel;
52}
53
54namespace DISP3DLIB
55{
56
59
60//=============================================================================================================
91{
92 Q_OBJECT
93
94public:
95 //=========================================================================================================
101 explicit RtSourceDataController(QObject* parent = nullptr);
102
103 //=========================================================================================================
107 ~RtSourceDataController() override;
108
109 //=========================================================================================================
116 void addData(const Eigen::VectorXd& data);
117
118 //=========================================================================================================
124 void setInterpolationMatrixLeft(QSharedPointer<Eigen::SparseMatrix<float>> mat);
125
126 //=========================================================================================================
132 void setInterpolationMatrixRight(QSharedPointer<Eigen::SparseMatrix<float>> mat);
133
134 //=========================================================================================================
140 void setStreamingState(bool state);
141
142 //=========================================================================================================
148 bool isStreaming() const;
149
150 //=========================================================================================================
156 void setTimeInterval(int msec);
157
158 //=========================================================================================================
164 void setNumberAverages(int numAvr);
165
166 //=========================================================================================================
172 void setColormapType(const QString& name);
173
174 //=========================================================================================================
182 void setThresholds(double min, double mid, double max);
183
184 //=========================================================================================================
190 void setLoopState(bool enabled);
191
192 //=========================================================================================================
198 void setSFreq(double sFreq);
199
200 //=========================================================================================================
204 void clearData();
205
206 //=========================================================================================================
215 void setSurfaceColor(const QVector<uint32_t>& baseColorsLh,
216 const QVector<uint32_t>& baseColorsRh);
217
218 //=========================================================================================================
225 void setStreamSmoothedData(bool bStreamSmoothedData);
226
227 //=========================================================================================================
228 // ── On-the-fly interpolation matrix computation ─────────────────────
229 //=========================================================================================================
230
237 void setInterpolationFunction(const QString& sInterpolationFunction);
238
239 //=========================================================================================================
246 void setCancelDistance(double dCancelDist);
247
248 //=========================================================================================================
257 void setInterpolationInfoLeft(const Eigen::MatrixX3f& matVertices,
258 const std::vector<Eigen::VectorXi>& vecNeighborVertices,
259 const Eigen::VectorXi& vecSourceVertices);
260
261 //=========================================================================================================
270 void setInterpolationInfoRight(const Eigen::MatrixX3f& matVertices,
271 const std::vector<Eigen::VectorXi>& vecNeighborVertices,
272 const Eigen::VectorXi& vecSourceVertices);
273
274 //=========================================================================================================
280
281 //=========================================================================================================
287 void setVisualizationType(int iVisType);
288
289 //=========================================================================================================
297 void setAnnotationInfoLeft(const Eigen::VectorXi& vecLabelIds,
298 const QList<FSLIB::FsLabel>& lLabels,
299 const Eigen::VectorXi& vecVertNo);
300
301 //=========================================================================================================
309 void setAnnotationInfoRight(const Eigen::VectorXi& vecLabelIds,
310 const QList<FSLIB::FsLabel>& lLabels,
311 const Eigen::VectorXi& vecVertNo);
312
313signals:
314 //=========================================================================================================
321 void newSmoothedDataAvailable(const QVector<uint32_t>& colorsLh,
322 const QVector<uint32_t>& colorsRh);
323
324 //=========================================================================================================
331 void newRawDataAvailable(const Eigen::VectorXd& dataLh,
332 const Eigen::VectorXd& dataRh);
333
334 //=========================================================================================================
340 void newInterpolationMatrixLeftAvailable(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
341
342 //=========================================================================================================
348 void newInterpolationMatrixRightAvailable(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
349
350private slots:
351 void onNewInterpolationMatrixLeft(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
352 void onNewInterpolationMatrixRight(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
353
354private:
355 QThread* m_pWorkerThread = nullptr;
356 DISP3DLIB::RtSourceDataWorker* m_pWorker = nullptr;
357 QTimer* m_pTimer = nullptr;
358 bool m_bIsStreaming = false;
359 int m_iTimeInterval = 17;
360
361 QThread* m_pInterpThread = nullptr;
362 DISP3DLIB::RtSourceInterpolationMatWorker* m_pInterpWorker = nullptr;
363};
364
365} // namespace DISP3DLIB
366
367#endif // BRAINVIEW_RTSOURCEDATACONTROLLER_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.
void setAnnotationInfoLeft(const Eigen::VectorXi &vecLabelIds, const QList< FSLIB::FsLabel > &lLabels, const Eigen::VectorXi &vecVertNo)
void setInterpolationMatrixRight(QSharedPointer< Eigen::SparseMatrix< float > > mat)
void addData(const Eigen::VectorXd &data)
void setInterpolationMatrixLeft(QSharedPointer< Eigen::SparseMatrix< float > > mat)
void newRawDataAvailable(const Eigen::VectorXd &dataLh, const Eigen::VectorXd &dataRh)
RtSourceDataController(QObject *parent=nullptr)
void newInterpolationMatrixLeftAvailable(QSharedPointer< Eigen::SparseMatrix< float > > interpMat)
void setSurfaceColor(const QVector< uint32_t > &baseColorsLh, const QVector< uint32_t > &baseColorsRh)
void setStreamSmoothedData(bool bStreamSmoothedData)
void setThresholds(double min, double mid, double max)
void setInterpolationInfoRight(const Eigen::MatrixX3f &matVertices, const std::vector< Eigen::VectorXi > &vecNeighborVertices, const Eigen::VectorXi &vecSourceVertices)
void setInterpolationInfoLeft(const Eigen::MatrixX3f &matVertices, const std::vector< Eigen::VectorXi > &vecNeighborVertices, const Eigen::VectorXi &vecSourceVertices)
void newInterpolationMatrixRightAvailable(QSharedPointer< Eigen::SparseMatrix< float > > interpMat)
void setInterpolationFunction(const QString &sInterpolationFunction)
void newSmoothedDataAvailable(const QVector< uint32_t > &colorsLh, const QVector< uint32_t > &colorsRh)
void setAnnotationInfoRight(const Eigen::VectorXi &vecLabelIds, const QList< FSLIB::FsLabel > &lLabels, const Eigen::VectorXi &vecVertNo)
Background worker for real-time source estimate streaming.
Background worker for computing source interpolation matrices.
A FreeSurfer/MNE surface label: per-vertex indices, Tk-RAS positions and scalar values for one hemisp...
Definition fs_label.h:81