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 class FsLabel;
51}
52
53namespace DISP3DLIB {
56}
57
58//=============================================================================================================
89{
90 Q_OBJECT
91
92public:
93 //=========================================================================================================
99 explicit RtSourceDataController(QObject *parent = nullptr);
100
101 //=========================================================================================================
105 ~RtSourceDataController() override;
106
107 //=========================================================================================================
114 void addData(const Eigen::VectorXd &data);
115
116 //=========================================================================================================
122 void setInterpolationMatrixLeft(QSharedPointer<Eigen::SparseMatrix<float>> mat);
123
124 //=========================================================================================================
130 void setInterpolationMatrixRight(QSharedPointer<Eigen::SparseMatrix<float>> mat);
131
132 //=========================================================================================================
138 void setStreamingState(bool state);
139
140 //=========================================================================================================
146 bool isStreaming() const;
147
148 //=========================================================================================================
154 void setTimeInterval(int msec);
155
156 //=========================================================================================================
162 void setNumberAverages(int numAvr);
163
164 //=========================================================================================================
170 void setColormapType(const QString &name);
171
172 //=========================================================================================================
180 void setThresholds(double min, double mid, double max);
181
182 //=========================================================================================================
188 void setLoopState(bool enabled);
189
190 //=========================================================================================================
196 void setSFreq(double sFreq);
197
198 //=========================================================================================================
202 void clearData();
203
204 //=========================================================================================================
213 void setSurfaceColor(const QVector<uint32_t> &baseColorsLh,
214 const QVector<uint32_t> &baseColorsRh);
215
216 //=========================================================================================================
223 void setStreamSmoothedData(bool bStreamSmoothedData);
224
225 //=========================================================================================================
226 // ── On-the-fly interpolation matrix computation ─────────────────────
227 //=========================================================================================================
228
235 void setInterpolationFunction(const QString &sInterpolationFunction);
236
237 //=========================================================================================================
244 void setCancelDistance(double dCancelDist);
245
246 //=========================================================================================================
255 void setInterpolationInfoLeft(const Eigen::MatrixX3f &matVertices,
256 const std::vector<Eigen::VectorXi> &vecNeighborVertices,
257 const Eigen::VectorXi &vecSourceVertices);
258
259 //=========================================================================================================
268 void setInterpolationInfoRight(const Eigen::MatrixX3f &matVertices,
269 const std::vector<Eigen::VectorXi> &vecNeighborVertices,
270 const Eigen::VectorXi &vecSourceVertices);
271
272 //=========================================================================================================
278
279 //=========================================================================================================
285 void setVisualizationType(int iVisType);
286
287 //=========================================================================================================
295 void setAnnotationInfoLeft(const Eigen::VectorXi &vecLabelIds,
296 const QList<FSLIB::FsLabel> &lLabels,
297 const Eigen::VectorXi &vecVertNo);
298
299 //=========================================================================================================
307 void setAnnotationInfoRight(const Eigen::VectorXi &vecLabelIds,
308 const QList<FSLIB::FsLabel> &lLabels,
309 const Eigen::VectorXi &vecVertNo);
310
311signals:
312 //=========================================================================================================
319 void newSmoothedDataAvailable(const QVector<uint32_t> &colorsLh,
320 const QVector<uint32_t> &colorsRh);
321
322 //=========================================================================================================
329 void newRawDataAvailable(const Eigen::VectorXd &dataLh,
330 const Eigen::VectorXd &dataRh);
331
332 //=========================================================================================================
338 void newInterpolationMatrixLeftAvailable(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
339
340 //=========================================================================================================
346 void newInterpolationMatrixRightAvailable(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
347
348private slots:
349 void onNewInterpolationMatrixLeft(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
350 void onNewInterpolationMatrixRight(QSharedPointer<Eigen::SparseMatrix<float>> interpMat);
351
352private:
353 QThread *m_pWorkerThread = nullptr;
354 DISP3DLIB::RtSourceDataWorker *m_pWorker = nullptr;
355 QTimer *m_pTimer = nullptr;
356 bool m_bIsStreaming = false;
357 int m_iTimeInterval = 17;
358
359 QThread *m_pInterpThread = nullptr;
360 DISP3DLIB::RtSourceInterpolationMatWorker *m_pInterpWorker = nullptr;
361};
362
363#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 setThresholds(double min, double mid, double max)
void setInterpolationMatrixLeft(QSharedPointer< Eigen::SparseMatrix< float > > mat)
void addData(const Eigen::VectorXd &data)
void setStreamSmoothedData(bool bStreamSmoothedData)
void setAnnotationInfoLeft(const Eigen::VectorXi &vecLabelIds, const QList< FSLIB::FsLabel > &lLabels, const Eigen::VectorXi &vecVertNo)
void newInterpolationMatrixRightAvailable(QSharedPointer< Eigen::SparseMatrix< float > > interpMat)
void setSurfaceColor(const QVector< uint32_t > &baseColorsLh, const QVector< uint32_t > &baseColorsRh)
void setCancelDistance(double dCancelDist)
void setInterpolationInfoRight(const Eigen::MatrixX3f &matVertices, const std::vector< Eigen::VectorXi > &vecNeighborVertices, const Eigen::VectorXi &vecSourceVertices)
void setAnnotationInfoRight(const Eigen::VectorXi &vecLabelIds, const QList< FSLIB::FsLabel > &lLabels, const Eigen::VectorXi &vecVertNo)
void newRawDataAvailable(const Eigen::VectorXd &dataLh, const Eigen::VectorXd &dataRh)
void newSmoothedDataAvailable(const QVector< uint32_t > &colorsLh, const QVector< uint32_t > &colorsRh)
void setVisualizationType(int iVisType)
void setInterpolationFunction(const QString &sInterpolationFunction)
void setColormapType(const QString &name)
void newInterpolationMatrixLeftAvailable(QSharedPointer< Eigen::SparseMatrix< float > > interpMat)
RtSourceDataController(QObject *parent=nullptr)
void setInterpolationMatrixRight(QSharedPointer< Eigen::SparseMatrix< float > > mat)
void setInterpolationInfoLeft(const Eigen::MatrixX3f &matVertices, const std::vector< Eigen::VectorXi > &vecNeighborVertices, const Eigen::VectorXi &vecSourceVertices)
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:79