MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
frequencyspectrummodel.h
Go to the documentation of this file.
1//=============================================================================================================
36#ifndef FREQUENCYSPECTRUMMODEL_H
37#define FREQUENCYSPECTRUMMODEL_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "../../disp_global.h"
44
45#include <fiff/fiff_types.h>
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51#include <QAbstractTableModel>
52#include <QSharedPointer>
53
54//=============================================================================================================
55// EIGEN INCLUDES
56//=============================================================================================================
57
58#include <Eigen/Core>
59
60//=============================================================================================================
61// FORWARD DECLARATIONS
62//=============================================================================================================
63
64namespace FIFFLIB {
65 class FiffInfo;
66}
67
68//=============================================================================================================
69// DEFINE NAMESPACE DISPLIB
70//=============================================================================================================
71
72namespace DISPLIB
73{
74
75//=============================================================================================================
76// DISPLIB FORWARD DECLARATIONS
77//=============================================================================================================
78
79//=============================================================================================================
85class DISPSHARED_EXPORT FrequencySpectrumModel : public QAbstractTableModel
86{
87 Q_OBJECT
88
89public:
90 typedef QSharedPointer<FrequencySpectrumModel> SPtr;
91 typedef QSharedPointer<const FrequencySpectrumModel> ConstSPtr;
93 //=========================================================================================================
99 FrequencySpectrumModel(QObject *parent = 0);
100
101 //=========================================================================================================
109 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const ;
110
111 //=========================================================================================================
119 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
120
121 //=========================================================================================================
130 virtual QVariant data(const QModelIndex &index,
131 int role = Qt::DisplayRole) const;
132
133 //=========================================================================================================
143 virtual QVariant headerData(int section, Qt::Orientation orientation,
144 int role = Qt::DisplayRole) const;
145
146 //=========================================================================================================
152 void setInfo(QSharedPointer<FIFFLIB::FiffInfo> &info);
153
154 //=========================================================================================================
160 void setScaleType(qint8 ScaleType);
161
162 //=========================================================================================================
168 void addData(const Eigen::MatrixXd &data);
169
170 //=========================================================================================================
176 inline QSharedPointer<FIFFLIB::FiffInfo> getInfo() const;
177
178 //=========================================================================================================
184 inline Eigen::RowVectorXd getFreqScale() const;
185
186 //=========================================================================================================
192 inline Eigen::RowVectorXd getFreqScaleBound() const;
193
194 //=========================================================================================================
200 inline qint32 getNumStems() const;
201
202 //=========================================================================================================
208 inline const QMap<qint32,qint32>& getIdxSelMap() const;
209
210 //=========================================================================================================
216 void selectRows(const QList<qint32> &selection);
217
218 //=========================================================================================================
222 void resetSelection();
223
224 //=========================================================================================================
230 void toggleFreeze(const QModelIndex &index);
231
232 //=========================================================================================================
238 inline bool isFreezed() const;
239
240 //=========================================================================================================
247 void setBoundaries(float fLowerFrqBound, float fUpperFrqBound);
248
249 //=========================================================================================================
255 inline qint32 getLowerFrqBound() const;
256
257 //=========================================================================================================
263 inline qint32 getUpperFrqBound() const;
264
265signals:
266 //=========================================================================================================
272 void newSelection(QList<qint32> selection);
273
274private:
275 QSharedPointer<FIFFLIB::FiffInfo> m_pFiffInfo;
277 QMap<qint32,qint32> m_qMapIdxRowSelection;
279 Eigen::RowVectorXd m_vecFreqScale;
280 Eigen::RowVectorXd m_vecFreqScaleBound;
281 Eigen::MatrixXd m_dataCurrent;
282 Eigen::MatrixXd m_dataCurrentFreeze;
284 float m_fSps;
285 qint32 m_iT;
286 qint32 m_iLowerFrqIdx;
287 qint32 m_iUpperFrqIdx;
288 qint8 m_iScaleType;
289 bool m_bIsFreezed;
290 bool m_bInitialized;
291};
292
293//=============================================================================================================
294// INLINE DEFINITIONS
295//=============================================================================================================
296
297QSharedPointer<FIFFLIB::FiffInfo> FrequencySpectrumModel::getInfo() const
298{
299 return m_pFiffInfo;
300}
301
302//=============================================================================================================
303
304Eigen::RowVectorXd FrequencySpectrumModel::getFreqScale() const
305{
306 return m_vecFreqScale;
307}
308
309//=============================================================================================================
310
312{
313 return m_vecFreqScaleBound;
314}
315
316//=============================================================================================================
317
319{
320 return m_dataCurrent.cols();
321}
322
323//=============================================================================================================
324
325inline const QMap<qint32,qint32>& FrequencySpectrumModel::getIdxSelMap() const
326{
327 return m_qMapIdxRowSelection;
328}
329
330//=============================================================================================================
331
333{
334 return m_bIsFreezed;
335}
336
337//=============================================================================================================
338
340{
341 return m_iLowerFrqIdx;
342}
343
344//=============================================================================================================
345
347{
348 return m_iUpperFrqIdx;
349}
350} // NAMESPACE
351
352#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
353#ifndef metatype_rowvectorxd
354#define metatype_rowvectorxd
355Q_DECLARE_METATYPE(Eigen::RowVectorXd);
356#endif
357#endif
358
359#endif // FREQUENCYSPECTRUMMODEL_H
#define DISPSHARED_EXPORT
Definition disp_global.h:55
Definitions for describing the objects in a FIFF file.
Q_DECLARE_METATYPE(Eigen::MatrixXf)
The FrequencySpectrumModel class implements the data access model for a real-time multi sample array ...
QSharedPointer< FrequencySpectrumModel > SPtr
void newSelection(QList< qint32 > selection)
QSharedPointer< const FrequencySpectrumModel > ConstSPtr
QSharedPointer< FIFFLIB::FiffInfo > getInfo() const
const QMap< qint32, qint32 > & getIdxSelMap() const
Eigen::RowVectorXd getFreqScaleBound() const
Eigen::RowVectorXd getFreqScale() const