MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
channelinfomodel.h
Go to the documentation of this file.
1//=============================================================================================================
36#ifndef CHANNELINFOMODEL_H
37#define CHANNELINFOMODEL_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "../../disp_global.h"
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QAbstractTableModel>
50#include <QSharedPointer>
51#include <QPointF>
52
53//=============================================================================================================
54// EIGEN INCLUDES
55//=============================================================================================================
56
57#include <Eigen/Core>
58
59//=============================================================================================================
60// FORWARD DECLARATIONS
61//=============================================================================================================
62
63namespace FIFFLIB {
64 class FiffInfo;
65}
66
67//=============================================================================================================
68// DEFINE NAMESPACE DISPLIB
69//=============================================================================================================
70
71namespace DISPLIB
72{
73
74//=============================================================================================================
75// DISPLIB FORWARD DECLARATIONS
76//=============================================================================================================
77
78class MNEOperator;
79
80namespace ChannelInfoModelRoles
81{
82 enum ItemRole{GetOrigChName = Qt::UserRole + 1009,
83 GetMappedLayoutChName = Qt::UserRole + 1010,
84 GetChNumber = Qt::UserRole + 1011,
85 GetChKind = Qt::UserRole + 1012,
86 GetMEGType = Qt::UserRole + 1013,
87 GetChUnit = Qt::UserRole + 1014,
88 GetChAlias = Qt::UserRole + 1015,
89 GetChPosition = Qt::UserRole + 1016,
90 GetChDigitizer = Qt::UserRole + 1017,
91 GetChActiveFilter = Qt::UserRole + 1018,
92 GetChCoilType = Qt::UserRole + 1019,
93 GetIsBad = Qt::UserRole + 1020};
94}
95
96//=============================================================================================================
100class DISPSHARED_EXPORT ChannelInfoModel : public QAbstractTableModel
101{
102 Q_OBJECT
103
104public:
105 typedef QSharedPointer<ChannelInfoModel> SPtr;
106 typedef QSharedPointer<const ChannelInfoModel> ConstSPtr;
108 ChannelInfoModel(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo, QObject *parent = 0);
109 ChannelInfoModel(QObject *parent = 0);
110
111 //=========================================================================================================
115 virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
116 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
117 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
118 virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
119 virtual bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
120 virtual Qt::ItemFlags flags(const QModelIndex & index) const;
121 virtual bool insertRows(int position, int span, const QModelIndex & parent = QModelIndex());
122 virtual bool removeRows(int position, int span, const QModelIndex & parent = QModelIndex());
123
124 //=========================================================================================================
130 void setFiffInfo(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo);
131
132 //=========================================================================================================
138 void assignedOperatorsChanged(const QMap<int,QSharedPointer<MNEOperator> > &assignedOperators);
139
140 //=========================================================================================================
146 void layoutChanged(const QMap<QString,QPointF> &layoutMap);
147
148 //=========================================================================================================
154 const QStringList & getMappedChannelsList();
155
156 //=========================================================================================================
163 int getIndexFromOrigChName(QString chName);
164
165 //=========================================================================================================
172 int getIndexFromMappedChName(QString chName);
173
174 //=========================================================================================================
180 QStringList getBadChannelList();
181
182 //=========================================================================================================
186 void clearModel();
187
188protected:
189
190 //=========================================================================================================
194 void mapLayoutToChannels();
195
196 QSharedPointer<FIFFLIB::FiffInfo> m_pFiffInfo;
198 QMap<int,QSharedPointer<MNEOperator> > m_assignedOperators;
199 QMap<QString,QPointF> m_layoutMap;
201 QStringList m_aliasNames;
204signals:
205 //=========================================================================================================
210 void channelsMappedToLayout(const QStringList &mappedLayoutChNames);
211};
212} // NAMESPACE DISPLIB
213
214#endif // CHANNELINFOMODEL_H
#define DISPSHARED_EXPORT
Definition disp_global.h:55
void channelsMappedToLayout(const QStringList &mappedLayoutChNames)
QMap< int, QSharedPointer< MNEOperator > > m_assignedOperators
QSharedPointer< const ChannelInfoModel > ConstSPtr
QSharedPointer< FIFFLIB::FiffInfo > m_pFiffInfo
QSharedPointer< ChannelInfoModel > SPtr
QMap< QString, QPointF > m_layoutMap