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
46//=============================================================================================================
60{
61 Q_OBJECT
62
63public:
64 //=========================================================================================================
70 explicit RtSensorDataWorker(QObject* parent = nullptr);
71
72 //=========================================================================================================
79 void addData(const Eigen::VectorXf& data);
80
81 //=========================================================================================================
85 void clear();
86
87 //=========================================================================================================
96 void setMappingMatrix(const QString& surfaceKey, std::shared_ptr<Eigen::MatrixXf> mat);
97
98 //=========================================================================================================
104 void setNumberAverages(int numAvr);
105
106 //=========================================================================================================
112 void setColormapType(const QString& name);
113
114 //=========================================================================================================
125 void setThresholds(double min, double max);
126
127 //=========================================================================================================
133 void setLoopState(bool enabled);
134
135 //=========================================================================================================
141 void setSFreq(double sFreq);
142
143 //=========================================================================================================
155 void setStreamSmoothedData(bool bStreamSmoothedData);
156
157public slots:
158 //=========================================================================================================
164 void streamData();
165
166signals:
167 //=========================================================================================================
174 void newRtSensorColors(const QString& surfaceKey,
175 const QVector<uint32_t>& colors);
176
177 //=========================================================================================================
183 void newRtRawSensorData(const Eigen::VectorXf& data);
184
185private:
186 //=========================================================================================================
194 QVector<uint32_t> computeSurfaceColors(const Eigen::VectorXf& sensorData) const;
195
196 mutable QMutex m_mutex;
197
198 QList<Eigen::VectorXf> m_lDataQ;
199 QList<Eigen::VectorXf> m_lDataLoopQ;
200 Eigen::VectorXf m_vecAverage;
201 int m_iSampleCtr = 0;
202 int m_iCurrentSample = 0;
203
204 std::shared_ptr<Eigen::MatrixXf> m_mappingMat;
205 QString m_sSurfaceKey;
206
207 int m_iNumAverages = 1;
208 bool m_bIsLooping = true;
209 bool m_bStreamSmoothedData = true;
210 double m_dSFreq = 1000.0;
211
212 QString m_sColormapType = QStringLiteral("MNE");
213 double m_dThreshMin = 0.0;
214 double m_dThreshMax = 0.0;
215 bool m_bUseAutoNorm = true;
216};
217
218} // namespace DISP3DLIB
219
220#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 setMappingMatrix(const QString &surfaceKey, std::shared_ptr< Eigen::MatrixXf > mat)
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 setColormapType(const QString &name)
void setStreamSmoothedData(bool bStreamSmoothedData)
void newRtRawSensorData(const Eigen::VectorXf &data)