v2.0.0
Loading...
Searching...
No Matches
channelinfomodel.h
Go to the documentation of this file.
1//=============================================================================================================
22
23#ifndef CHANNELINFOMODEL_H
24#define CHANNELINFOMODEL_H
25
26//=============================================================================================================
27// INCLUDES
28//=============================================================================================================
29
30#include "../../disp_global.h"
31
32//=============================================================================================================
33// QT INCLUDES
34//=============================================================================================================
35
36#include <QAbstractTableModel>
37#include <QSharedPointer>
38#include <QPointF>
39#include <QMultiMap>
40
41//=============================================================================================================
42// EIGEN INCLUDES
43//=============================================================================================================
44
45#include <Eigen/Core>
46
47//=============================================================================================================
48// FORWARD DECLARATIONS
49//=============================================================================================================
50
51namespace FIFFLIB {
52 class FiffInfo;
53}
54
55//=============================================================================================================
56// DEFINE NAMESPACE DISPLIB
57//=============================================================================================================
58
59namespace DISPLIB
60{
61
62//=============================================================================================================
63// DISPLIB FORWARD DECLARATIONS
64//=============================================================================================================
65
66class MNEOperator;
67
69{
70 enum ItemRole{GetOrigChName = Qt::UserRole + 1009,
71 GetMappedLayoutChName = Qt::UserRole + 1010,
72 GetChNumber = Qt::UserRole + 1011,
73 GetChKind = Qt::UserRole + 1012,
74 GetMEGType = Qt::UserRole + 1013,
75 GetChUnit = Qt::UserRole + 1014,
76 GetChAlias = Qt::UserRole + 1015,
77 GetChPosition = Qt::UserRole + 1016,
78 GetChDigitizer = Qt::UserRole + 1017,
79 GetChActiveFilter = Qt::UserRole + 1018,
80 GetChCoilType = Qt::UserRole + 1019,
81 GetIsBad = Qt::UserRole + 1020};
82}
83
84//=============================================================================================================
92class DISPSHARED_EXPORT ChannelInfoModel : public QAbstractTableModel
93{
94 Q_OBJECT
95
96public:
97 typedef QSharedPointer<ChannelInfoModel> SPtr;
98 typedef QSharedPointer<const ChannelInfoModel> ConstSPtr;
99
100 ChannelInfoModel(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo, QObject *parent = 0);
101 ChannelInfoModel(QObject *parent = 0);
102
103 //=========================================================================================================
107 virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
108 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
109 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
110 virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
111 virtual bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
112 virtual Qt::ItemFlags flags(const QModelIndex & index) const;
113 virtual bool insertRows(int position, int span, const QModelIndex & parent = QModelIndex());
114 virtual bool removeRows(int position, int span, const QModelIndex & parent = QModelIndex());
115
116 //=========================================================================================================
122 void setFiffInfo(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo);
123
124 //=========================================================================================================
130 void assignedOperatorsChanged(const QMultiMap<int,QSharedPointer<MNEOperator> > &assignedOperators);
131
132 //=========================================================================================================
138 void layoutChanged(const QMap<QString,QPointF> &layoutMap);
139
140 //=========================================================================================================
146 const QStringList & getMappedChannelsList();
147
148 //=========================================================================================================
155 int getIndexFromOrigChName(QString chName);
156
157 //=========================================================================================================
164 int getIndexFromMappedChName(QString chName);
165
166 //=========================================================================================================
172 QStringList getBadChannelList();
173
174 //=========================================================================================================
178 void clearModel();
179
180protected:
181
182 //=========================================================================================================
186 void mapLayoutToChannels();
187
188 QSharedPointer<FIFFLIB::FiffInfo> m_pFiffInfo;
189
190 QMultiMap<int,QSharedPointer<MNEOperator> > m_assignedOperators;
191 QMap<QString,QPointF> m_layoutMap;
192
193 QStringList m_aliasNames;
195
196signals:
197 //=========================================================================================================
202 void channelsMappedToLayout(const QStringList &mappedLayoutChNames);
203};
204} // NAMESPACE DISPLIB
205
206#endif // CHANNELINFOMODEL_H
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
FIFF file I/O, in-memory data structures and high-level readers/writers.
2-D display widgets and visualisation helpers (charts, topography, colour maps).
void channelsMappedToLayout(const QStringList &mappedLayoutChNames)
ChannelInfoModel(QSharedPointer< FIFFLIB::FiffInfo > &pFiffInfo, QObject *parent=0)
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
void setFiffInfo(QSharedPointer< FIFFLIB::FiffInfo > &pFiffInfo)
void assignedOperatorsChanged(const QMultiMap< int, QSharedPointer< MNEOperator > > &assignedOperators)
QMultiMap< int, QSharedPointer< MNEOperator > > m_assignedOperators
virtual bool insertRows(int position, int span, const QModelIndex &parent=QModelIndex())
QSharedPointer< const ChannelInfoModel > ConstSPtr
QSharedPointer< FIFFLIB::FiffInfo > m_pFiffInfo
QSharedPointer< ChannelInfoModel > SPtr
int getIndexFromMappedChName(QString chName)
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
void layoutChanged(const QMap< QString, QPointF > &layoutMap)
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
int getIndexFromOrigChName(QString chName)
const QStringList & getMappedChannelsList()
QMap< QString, QPointF > m_layoutMap
virtual Qt::ItemFlags flags(const QModelIndex &index) const
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
virtual bool removeRows(int position, int span, const QModelIndex &parent=QModelIndex())
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Light-weight wrapper describing one MNE pre-processing operator (FIR / SSP / compensation).
Definition mneoperator.h:65
Full FIFF measurement info: per-channel descriptors, sampling and filter setup, projectors,...
Definition fiff_info.h:88