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
50{
51
54
55//=============================================================================================================
84{
85 Q_OBJECT
86
87public:
88 //=========================================================================================================
94 explicit RtSensorDataController(QObject* parent = nullptr);
95
96 //=========================================================================================================
100 ~RtSensorDataController() override;
101
102 //=========================================================================================================
110 void addData(const Eigen::VectorXf& data);
111
112 //=========================================================================================================
120 void setMappingMatrix(const QString& surfaceKey, std::shared_ptr<Eigen::MatrixXf> mat);
121
122 //=========================================================================================================
128 void setStreamingState(bool state);
129
130 //=========================================================================================================
136 bool isStreaming() const;
137
138 //=========================================================================================================
144 void setTimeInterval(int msec);
145
146 //=========================================================================================================
152 void setNumberAverages(int numAvr);
153
154 //=========================================================================================================
160 void setColormapType(const QString& name);
161
162 //=========================================================================================================
170 void setThresholds(double min, double max);
171
172 //=========================================================================================================
178 void setLoopState(bool enabled);
179
180 //=========================================================================================================
186 void setSFreq(double sFreq);
187
188 //=========================================================================================================
192 void clearData();
193
194 //=========================================================================================================
201 void setStreamSmoothedData(bool bStreamSmoothedData);
202
203 //=========================================================================================================
204 // ── On-the-fly interpolation matrix computation ─────────────────────
205 //=========================================================================================================
206
213 void setEvoked(const FIFFLIB::FiffEvoked& evoked);
214
215 //=========================================================================================================
222 void setTransform(const FIFFLIB::FiffCoordTrans& trans, bool applySensorTrans);
223
224 //=========================================================================================================
231 void setMegFieldMapOnHead(bool onHead);
232
233 //=========================================================================================================
242 void setMegSurface(const QString& surfaceKey,
243 const Eigen::MatrixX3f& vertices,
244 const Eigen::MatrixX3f& normals,
245 const Eigen::MatrixX3i& triangles);
246
247 //=========================================================================================================
254 void setEegSurface(const QString& surfaceKey,
255 const Eigen::MatrixX3f& vertices);
256
257 //=========================================================================================================
263 void setBadChannels(const QStringList& bads);
264
265 //=========================================================================================================
271 void recomputeMapping();
272
273signals:
274 //=========================================================================================================
281 void newSensorColorsAvailable(const QString& surfaceKey,
282 const QVector<uint32_t>& colors);
283
284 //=========================================================================================================
290 void newRawSensorDataAvailable(const Eigen::VectorXf& data);
291
292 //=========================================================================================================
300 void newMegMappingAvailable(const QString& surfaceKey,
301 std::shared_ptr<Eigen::MatrixXf> mappingMat,
302 const QVector<int>& pick);
303
304 //=========================================================================================================
312 void newEegMappingAvailable(const QString& surfaceKey,
313 std::shared_ptr<Eigen::MatrixXf> mappingMat,
314 const QVector<int>& pick);
315
316private slots:
317 void onNewMegMapping(const QString& surfaceKey,
318 std::shared_ptr<Eigen::MatrixXf> mappingMat,
319 const QVector<int>& pick);
320 void onNewEegMapping(const QString& surfaceKey,
321 std::shared_ptr<Eigen::MatrixXf> mappingMat,
322 const QVector<int>& pick);
323
324private:
325 QThread* m_pWorkerThread = nullptr;
326 DISP3DLIB::RtSensorDataWorker* m_pWorker = nullptr;
327 QTimer* m_pTimer = nullptr;
328 bool m_bIsStreaming = false;
329 int m_iTimeInterval = 17;
330
331 QThread* m_pInterpThread = nullptr;
332 DISP3DLIB::RtSensorInterpolationMatWorker* m_pInterpWorker = nullptr;
333};
334
335} // namespace DISP3DLIB
336
337#endif // BRAINVIEW_RTSENSORDATACONTROLLER_H
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-...
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
3-D brain visualisation using the Qt RHI rendering backend.
void newSensorColorsAvailable(const QString &surfaceKey, const QVector< uint32_t > &colors)
void setTransform(const FIFFLIB::FiffCoordTrans &trans, bool applySensorTrans)
void setEegSurface(const QString &surfaceKey, const Eigen::MatrixX3f &vertices)
void setEvoked(const FIFFLIB::FiffEvoked &evoked)
void newEegMappingAvailable(const QString &surfaceKey, std::shared_ptr< Eigen::MatrixXf > mappingMat, const QVector< int > &pick)
void newRawSensorDataAvailable(const Eigen::VectorXf &data)
void setMappingMatrix(const QString &surfaceKey, std::shared_ptr< Eigen::MatrixXf > mat)
void setStreamSmoothedData(bool bStreamSmoothedData)
RtSensorDataController(QObject *parent=nullptr)
void newMegMappingAvailable(const QString &surfaceKey, std::shared_ptr< Eigen::MatrixXf > mappingMat, const QVector< int > &pick)
void addData(const Eigen::VectorXf &data)
void setMegSurface(const QString &surfaceKey, const Eigen::MatrixX3f &vertices, const Eigen::MatrixX3f &normals, const Eigen::MatrixX3i &triangles)
void setBadChannels(const QStringList &bads)
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:77