v2.0.0
Loading...
Searching...
No Matches
rtsensordatacontroller.h
Go to the documentation of this file.
1//=============================================================================================================
23
24#ifndef BRAINVIEW_RTSENSORDATACONTROLLER_H
25#define BRAINVIEW_RTSENSORDATACONTROLLER_H
26
27//=============================================================================================================
28// INCLUDES
29//=============================================================================================================
30
31#include "../disp3D_global.h"
32
33#include <fiff/fiff_evoked.h>
35
36#include <QObject>
37#include <QVector>
38#include <QString>
39#include <Eigen/Core>
40#include <memory>
41
42//=============================================================================================================
43// FORWARD DECLARATIONS
44//=============================================================================================================
45
46class QThread;
47class QTimer;
48
49namespace DISP3DLIB {
52}
53
54//=============================================================================================================
83{
84 Q_OBJECT
85
86public:
87 //=========================================================================================================
93 explicit RtSensorDataController(QObject *parent = nullptr);
94
95 //=========================================================================================================
99 ~RtSensorDataController() override;
100
101 //=========================================================================================================
109 void addData(const Eigen::VectorXf &data);
110
111 //=========================================================================================================
118 void setMappingMatrix(std::shared_ptr<Eigen::MatrixXf> mat);
119
120 //=========================================================================================================
126 void setStreamingState(bool state);
127
128 //=========================================================================================================
134 bool isStreaming() const;
135
136 //=========================================================================================================
142 void setTimeInterval(int msec);
143
144 //=========================================================================================================
150 void setNumberAverages(int numAvr);
151
152 //=========================================================================================================
158 void setColormapType(const QString &name);
159
160 //=========================================================================================================
168 void setThresholds(double min, double max);
169
170 //=========================================================================================================
176 void setLoopState(bool enabled);
177
178 //=========================================================================================================
184 void setSFreq(double sFreq);
185
186 //=========================================================================================================
190 void clearData();
191
192 //=========================================================================================================
199 void setStreamSmoothedData(bool bStreamSmoothedData);
200
201 //=========================================================================================================
202 // ── On-the-fly interpolation matrix computation ─────────────────────
203 //=========================================================================================================
204
211 void setEvoked(const FIFFLIB::FiffEvoked &evoked);
212
213 //=========================================================================================================
220 void setTransform(const FIFFLIB::FiffCoordTrans &trans, bool applySensorTrans);
221
222 //=========================================================================================================
229 void setMegFieldMapOnHead(bool onHead);
230
231 //=========================================================================================================
240 void setMegSurface(const QString &surfaceKey,
241 const Eigen::MatrixX3f &vertices,
242 const Eigen::MatrixX3f &normals,
243 const Eigen::MatrixX3i &triangles);
244
245 //=========================================================================================================
252 void setEegSurface(const QString &surfaceKey,
253 const Eigen::MatrixX3f &vertices);
254
255 //=========================================================================================================
261 void setBadChannels(const QStringList &bads);
262
263 //=========================================================================================================
269 void recomputeMapping();
270
271signals:
272 //=========================================================================================================
279 void newSensorColorsAvailable(const QString &surfaceKey,
280 const QVector<uint32_t> &colors);
281
282 //=========================================================================================================
288 void newRawSensorDataAvailable(const Eigen::VectorXf &data);
289
290 //=========================================================================================================
298 void newMegMappingAvailable(const QString &surfaceKey,
299 std::shared_ptr<Eigen::MatrixXf> mappingMat,
300 const QVector<int> &pick);
301
302 //=========================================================================================================
310 void newEegMappingAvailable(const QString &surfaceKey,
311 std::shared_ptr<Eigen::MatrixXf> mappingMat,
312 const QVector<int> &pick);
313
314private slots:
315 void onNewMegMapping(const QString &surfaceKey,
316 std::shared_ptr<Eigen::MatrixXf> mappingMat,
317 const QVector<int> &pick);
318 void onNewEegMapping(const QString &surfaceKey,
319 std::shared_ptr<Eigen::MatrixXf> mappingMat,
320 const QVector<int> &pick);
321
322private:
323 QThread *m_pWorkerThread = nullptr;
324 DISP3DLIB::RtSensorDataWorker *m_pWorker = nullptr;
325 QTimer *m_pTimer = nullptr;
326 bool m_bIsStreaming = false;
327 int m_iTimeInterval = 17;
328
329 QThread *m_pInterpThread = nullptr;
330 DISP3DLIB::RtSensorInterpolationMatWorker *m_pInterpWorker = nullptr;
331};
332
333#endif // BRAINVIEW_RTSENSORDATACONTROLLER_H
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
Single averaged evoked response: time axis, samples, baseline, channel info and processing history.
4x4 affine FIFF coordinate transform (FIFF_COORD_TRANS) annotated with source/destination coordinate-...
3-D brain visualisation using the Qt RHI rendering backend.
void newSensorColorsAvailable(const QString &surfaceKey, const QVector< uint32_t > &colors)
void setColormapType(const QString &name)
void setMegSurface(const QString &surfaceKey, const Eigen::MatrixX3f &vertices, const Eigen::MatrixX3f &normals, const Eigen::MatrixX3i &triangles)
void setBadChannels(const QStringList &bads)
void setTransform(const FIFFLIB::FiffCoordTrans &trans, bool applySensorTrans)
void setEegSurface(const QString &surfaceKey, const Eigen::MatrixX3f &vertices)
void newMegMappingAvailable(const QString &surfaceKey, std::shared_ptr< Eigen::MatrixXf > mappingMat, const QVector< int > &pick)
void setMappingMatrix(std::shared_ptr< Eigen::MatrixXf > mat)
void newRawSensorDataAvailable(const Eigen::VectorXf &data)
void addData(const Eigen::VectorXf &data)
void setEvoked(const FIFFLIB::FiffEvoked &evoked)
void setStreamSmoothedData(bool bStreamSmoothedData)
void newEegMappingAvailable(const QString &surfaceKey, std::shared_ptr< Eigen::MatrixXf > mappingMat, const QVector< int > &pick)
RtSensorDataController(QObject *parent=nullptr)
void setThresholds(double min, double max)
Background worker for real-time sensor data streaming.
Background worker for computing sensor field mapping matrices.
Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse.
Single averaged evoked response: time axis, data, baseline, channel info and averaging metadata.
Definition fiff_evoked.h:75