v2.0.0
Loading...
Searching...
No Matches
rtsensordataworker.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef BRAINVIEW_RTSENSORDATAWORKER_H
36#define BRAINVIEW_RTSENSORDATAWORKER_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
43
44#include <QObject>
45#include <QList>
46#include <QMutex>
47#include <QVector>
48#include <QSharedPointer>
49#include <Eigen/Core>
50
51//=============================================================================================================
52// DEFINE NAMESPACE
53//=============================================================================================================
54
55namespace DISP3DRHILIB {
56
57//=============================================================================================================
71{
72 Q_OBJECT
73
74public:
75 //=========================================================================================================
81 explicit RtSensorDataWorker(QObject *parent = nullptr);
82
83 //=========================================================================================================
90 void addData(const Eigen::VectorXf &data);
91
92 //=========================================================================================================
96 void clear();
97
98 //=========================================================================================================
106 void setMappingMatrix(QSharedPointer<Eigen::MatrixXf> mat);
107
108 //=========================================================================================================
114 void setNumberAverages(int numAvr);
115
116 //=========================================================================================================
122 void setColormapType(const QString &name);
123
124 //=========================================================================================================
135 void setThresholds(double min, double max);
136
137 //=========================================================================================================
143 void setLoopState(bool enabled);
144
145 //=========================================================================================================
151 void setSFreq(double sFreq);
152
153 //=========================================================================================================
165 void setStreamSmoothedData(bool bStreamSmoothedData);
166
167public slots:
168 //=========================================================================================================
174 void streamData();
175
176signals:
177 //=========================================================================================================
184 void newRtSensorColors(const QString &surfaceKey,
185 const QVector<uint32_t> &colors);
186
187 //=========================================================================================================
193 void newRtRawSensorData(const Eigen::VectorXf &data);
194
195private:
196 //=========================================================================================================
204 QVector<uint32_t> computeSurfaceColors(const Eigen::VectorXf &sensorData) const;
205
206 mutable QMutex m_mutex;
207
208 QList<Eigen::VectorXf> m_lDataQ;
209 QList<Eigen::VectorXf> m_lDataLoopQ;
210 Eigen::VectorXf m_vecAverage;
211 int m_iSampleCtr = 0;
212 int m_iCurrentSample = 0;
213
214 QSharedPointer<Eigen::MatrixXf> m_mappingMat;
215 QString m_sSurfaceKey;
216
217 int m_iNumAverages = 1;
218 bool m_bIsLooping = true;
219 bool m_bStreamSmoothedData = true;
220 double m_dSFreq = 1000.0;
221
222 QString m_sColormapType = QStringLiteral("MNE");
223 double m_dThreshMin = 0.0;
224 double m_dThreshMax = 0.0;
225 bool m_bUseAutoNorm = true;
226};
227
228} // namespace DISP3DRHILIB
229
230#endif // BRAINVIEW_RTSENSORDATAWORKER_H
disp3D_rhi library export/import macros.
#define DISP3DRHISHARED_EXPORT
3-D brain visualisation using the Qt RHI rendering backend.
void setMappingMatrix(QSharedPointer< Eigen::MatrixXf > mat)
void setThresholds(double min, double max)
void addData(const Eigen::VectorXf &data)
RtSensorDataWorker(QObject *parent=nullptr)
void newRtRawSensorData(const Eigen::VectorXf &data)
void newRtSensorColors(const QString &surfaceKey, const QVector< uint32_t > &colors)
void setColormapType(const QString &name)
void setStreamSmoothedData(bool bStreamSmoothedData)