v2.0.0
Loading...
Searching...
No Matches
rtsensordataworker.h
Go to the documentation of this file.
1//=============================================================================================================
22
23#ifndef BRAINVIEW_RTSENSORDATAWORKER_H
24#define BRAINVIEW_RTSENSORDATAWORKER_H
25
26//=============================================================================================================
27// INCLUDES
28//=============================================================================================================
29
30#include "../disp3D_global.h"
31
32#include <QObject>
33#include <QList>
34#include <QMutex>
35#include <QVector>
36#include <Eigen/Core>
37#include <memory>
38
39//=============================================================================================================
40// DEFINE NAMESPACE
41//=============================================================================================================
42
43namespace DISP3DLIB {
44
45//=============================================================================================================
59{
60 Q_OBJECT
61
62public:
63 //=========================================================================================================
69 explicit RtSensorDataWorker(QObject *parent = nullptr);
70
71 //=========================================================================================================
78 void addData(const Eigen::VectorXf &data);
79
80 //=========================================================================================================
84 void clear();
85
86 //=========================================================================================================
94 void setMappingMatrix(std::shared_ptr<Eigen::MatrixXf> mat);
95
96 //=========================================================================================================
102 void setNumberAverages(int numAvr);
103
104 //=========================================================================================================
110 void setColormapType(const QString &name);
111
112 //=========================================================================================================
123 void setThresholds(double min, double max);
124
125 //=========================================================================================================
131 void setLoopState(bool enabled);
132
133 //=========================================================================================================
139 void setSFreq(double sFreq);
140
141 //=========================================================================================================
153 void setStreamSmoothedData(bool bStreamSmoothedData);
154
155public slots:
156 //=========================================================================================================
162 void streamData();
163
164signals:
165 //=========================================================================================================
172 void newRtSensorColors(const QString &surfaceKey,
173 const QVector<uint32_t> &colors);
174
175 //=========================================================================================================
181 void newRtRawSensorData(const Eigen::VectorXf &data);
182
183private:
184 //=========================================================================================================
192 QVector<uint32_t> computeSurfaceColors(const Eigen::VectorXf &sensorData) const;
193
194 mutable QMutex m_mutex;
195
196 QList<Eigen::VectorXf> m_lDataQ;
197 QList<Eigen::VectorXf> m_lDataLoopQ;
198 Eigen::VectorXf m_vecAverage;
199 int m_iSampleCtr = 0;
200 int m_iCurrentSample = 0;
201
202 std::shared_ptr<Eigen::MatrixXf> m_mappingMat;
203 QString m_sSurfaceKey;
204
205 int m_iNumAverages = 1;
206 bool m_bIsLooping = true;
207 bool m_bStreamSmoothedData = true;
208 double m_dSFreq = 1000.0;
209
210 QString m_sColormapType = QStringLiteral("MNE");
211 double m_dThreshMin = 0.0;
212 double m_dThreshMax = 0.0;
213 bool m_bUseAutoNorm = true;
214};
215
216} // namespace DISP3DLIB
217
218#endif // BRAINVIEW_RTSENSORDATAWORKER_H
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 newRtSensorColors(const QString &surfaceKey, const QVector< uint32_t > &colors)
void setThresholds(double min, double max)
void addData(const Eigen::VectorXf &data)
RtSensorDataWorker(QObject *parent=nullptr)
void setMappingMatrix(std::shared_ptr< Eigen::MatrixXf > mat)
void setColormapType(const QString &name)
void setStreamSmoothedData(bool bStreamSmoothedData)
void newRtRawSensorData(const Eigen::VectorXf &data)