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{
53class FiffInfo;
54}
55
56//=============================================================================================================
57// DEFINE NAMESPACE DISPLIB
58//=============================================================================================================
59
60namespace DISPLIB
61{
62
63//=============================================================================================================
64// DISPLIB FORWARD DECLARATIONS
65//=============================================================================================================
66
67class MNEOperator;
68
70{
72{
73 GetOrigChName = Qt::UserRole + 1009,
74 GetMappedLayoutChName = Qt::UserRole + 1010,
75 GetChNumber = Qt::UserRole + 1011,
76 GetChKind = Qt::UserRole + 1012,
77 GetMEGType = Qt::UserRole + 1013,
78 GetChUnit = Qt::UserRole + 1014,
79 GetChAlias = Qt::UserRole + 1015,
80 GetChPosition = Qt::UserRole + 1016,
81 GetChDigitizer = Qt::UserRole + 1017,
82 GetChActiveFilter = Qt::UserRole + 1018,
83 GetChCoilType = Qt::UserRole + 1019,
84 GetIsBad = Qt::UserRole + 1020
85};
86}
87
88//=============================================================================================================
96class DISPSHARED_EXPORT ChannelInfoModel : public QAbstractTableModel
97{
98 Q_OBJECT
99
100public:
101 typedef QSharedPointer<ChannelInfoModel> SPtr;
102 typedef QSharedPointer<const ChannelInfoModel> ConstSPtr;
103
104 ChannelInfoModel(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo, QObject* parent = 0);
105 ChannelInfoModel(QObject* parent = 0);
106
107 //=========================================================================================================
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 QMultiMap<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 //=========================================================================================================
193 void mapLayoutToChannels();
194
195 QSharedPointer<FIFFLIB::FiffInfo> m_pFiffInfo;
196
197 QMultiMap<int, QSharedPointer<MNEOperator>> m_assignedOperators;
198 QMap<QString, QPointF> m_layoutMap;
199
200 QStringList m_aliasNames;
202
203signals:
204 //=========================================================================================================
209 void channelsMappedToLayout(const QStringList& mappedLayoutChNames);
210};
211} // NAMESPACE DISPLIB
212
213#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)
QMultiMap< int, QSharedPointer< MNEOperator > > m_assignedOperators
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)
QMap< QString, QPointF > m_layoutMap
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()
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:90