v2.0.0
Loading...
Searching...
No Matches
frequencyspectrummodel.h
Go to the documentation of this file.
1//=============================================================================================================
21
22#ifndef FREQUENCYSPECTRUMMODEL_H
23#define FREQUENCYSPECTRUMMODEL_H
24
25//=============================================================================================================
26// INCLUDES
27//=============================================================================================================
28
29#include "../../disp_global.h"
30
31#include <fiff/fiff_types.h>
32
33//=============================================================================================================
34// QT INCLUDES
35//=============================================================================================================
36
37#include <QAbstractTableModel>
38#include <QSharedPointer>
39
40//=============================================================================================================
41// EIGEN INCLUDES
42//=============================================================================================================
43
44#include <Eigen/Core>
45
46//=============================================================================================================
47// FORWARD DECLARATIONS
48//=============================================================================================================
49
50namespace FIFFLIB {
51 class FiffInfo;
52}
53
54//=============================================================================================================
55// DEFINE NAMESPACE DISPLIB
56//=============================================================================================================
57
58namespace DISPLIB
59{
60
61//=============================================================================================================
62// DISPLIB FORWARD DECLARATIONS
63//=============================================================================================================
64
65//=============================================================================================================
73class DISPSHARED_EXPORT FrequencySpectrumModel : public QAbstractTableModel
74{
75 Q_OBJECT
76
77public:
78 typedef QSharedPointer<FrequencySpectrumModel> SPtr;
79 typedef QSharedPointer<const FrequencySpectrumModel> ConstSPtr;
80
81 //=========================================================================================================
87 FrequencySpectrumModel(QObject *parent = 0);
88
89 //=========================================================================================================
97 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const ;
98
99 //=========================================================================================================
107 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
108
109 //=========================================================================================================
118 virtual QVariant data(const QModelIndex &index,
119 int role = Qt::DisplayRole) const;
120
121 //=========================================================================================================
131 virtual QVariant headerData(int section, Qt::Orientation orientation,
132 int role = Qt::DisplayRole) const;
133
134 //=========================================================================================================
140 void setInfo(QSharedPointer<FIFFLIB::FiffInfo> &info);
141
142 //=========================================================================================================
148 void setScaleType(qint8 ScaleType);
149
150 //=========================================================================================================
156 void addData(const Eigen::MatrixXd &data);
157
158 //=========================================================================================================
164 inline QSharedPointer<FIFFLIB::FiffInfo> getInfo() const;
165
166 //=========================================================================================================
172 inline Eigen::RowVectorXd getFreqScale() const;
173
174 //=========================================================================================================
180 inline Eigen::RowVectorXd getFreqScaleBound() const;
181
182 //=========================================================================================================
188 inline qint32 getNumStems() const;
189
190 //=========================================================================================================
196 inline const QMap<qint32,qint32>& getIdxSelMap() const;
197
198 //=========================================================================================================
204 void selectRows(const QList<qint32> &selection);
205
206 //=========================================================================================================
210 void resetSelection();
211
212 //=========================================================================================================
218 void toggleFreeze(const QModelIndex &index);
219
220 //=========================================================================================================
226 inline bool isFreezed() const;
227
228 //=========================================================================================================
235 void setBoundaries(float fLowerFrqBound, float fUpperFrqBound);
236
237 //=========================================================================================================
243 inline qint32 getLowerFrqBound() const;
244
245 //=========================================================================================================
251 inline qint32 getUpperFrqBound() const;
252
253signals:
254 //=========================================================================================================
260 void newSelection(QList<qint32> selection);
261
262private:
263 QSharedPointer<FIFFLIB::FiffInfo> m_pFiffInfo;
264
265 QMap<qint32,qint32> m_qMapIdxRowSelection;
266
267 Eigen::RowVectorXd m_vecFreqScale;
268 Eigen::RowVectorXd m_vecFreqScaleBound;
269 Eigen::MatrixXd m_dataCurrent;
270 Eigen::MatrixXd m_dataCurrentFreeze;
271
272 float m_fSps;
273 qint32 m_iT;
274 qint32 m_iLowerFrqIdx;
275 qint32 m_iUpperFrqIdx;
276 qint8 m_iScaleType;
277 bool m_bIsFreezed;
278 bool m_bInitialized;
279};
280
281//=============================================================================================================
282// INLINE DEFINITIONS
283//=============================================================================================================
284
285QSharedPointer<FIFFLIB::FiffInfo> FrequencySpectrumModel::getInfo() const
286{
287 return m_pFiffInfo;
288}
289
290//=============================================================================================================
291
292Eigen::RowVectorXd FrequencySpectrumModel::getFreqScale() const
293{
294 return m_vecFreqScale;
295}
296
297//=============================================================================================================
298
300{
301 return m_vecFreqScaleBound;
302}
303
304//=============================================================================================================
305
307{
308 return m_dataCurrent.cols();
309}
310
311//=============================================================================================================
312
313inline const QMap<qint32,qint32>& FrequencySpectrumModel::getIdxSelMap() const
314{
315 return m_qMapIdxRowSelection;
316}
317
318//=============================================================================================================
319
321{
322 return m_bIsFreezed;
323}
324
325//=============================================================================================================
326
328{
329 return m_iLowerFrqIdx;
330}
331
332//=============================================================================================================
333
335{
336 return m_iUpperFrqIdx;
337}
338} // NAMESPACE
339
340#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
341#ifndef metatype_rowvectorxd
342#define metatype_rowvectorxd
343Q_DECLARE_METATYPE(Eigen::RowVectorXd);
344#endif
345#endif
346
347#endif // FREQUENCYSPECTRUMMODEL_H
Q_DECLARE_METATYPE(Eigen::MatrixXf)
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
FIFF file I/O, in-memory data structures and high-level readers/writers.
2-D display widgets and visualisation helpers (charts, topography, colour maps).
QSharedPointer< FrequencySpectrumModel > SPtr
void newSelection(QList< qint32 > selection)
void setBoundaries(float fLowerFrqBound, float fUpperFrqBound)
void selectRows(const QList< qint32 > &selection)
QSharedPointer< const FrequencySpectrumModel > ConstSPtr
QSharedPointer< FIFFLIB::FiffInfo > getInfo() const
const QMap< qint32, qint32 > & getIdxSelMap() const
void addData(const Eigen::MatrixXd &data)
void toggleFreeze(const QModelIndex &index)
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
void setInfo(QSharedPointer< FIFFLIB::FiffInfo > &info)
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Eigen::RowVectorXd getFreqScaleBound() const
Eigen::RowVectorXd getFreqScale() const
Full FIFF measurement info: per-channel descriptors, sampling and filter setup, projectors,...
Definition fiff_info.h:88