MNE-CPP  beta 1.0
chinfomodel.h
1 //=============================================================================================================
38 #ifndef CHINFOCLASS_H
39 #define CHINFOCLASS_H
40 
41 //*************************************************************************************************************
42 //=============================================================================================================
43 // INCLUDES
44 //=============================================================================================================
45 
46 
47 //*************************************************************************************************************
48 //=============================================================================================================
49 // Qt INCLUDES
50 //=============================================================================================================
51 
52 #include <QAbstractTableModel>
53 #include <QVector3D>
54 
55 
56 //*************************************************************************************************************
57 //=============================================================================================================
58 // Eigen INCLUDES
59 //=============================================================================================================
60 
61 #include <Eigen/Core>
62 
63 
64 //*************************************************************************************************************
65 //=============================================================================================================
66 // MNE INCLUDES
67 //=============================================================================================================
68 
69 #include <fiff/fiff.h>
70 
71 
72 //*************************************************************************************************************
73 //=============================================================================================================
74 // USED NAMESPACES
75 //=============================================================================================================
76 
77 using namespace Eigen;
78 using namespace FIFFLIB;
79 
80 
81 //*************************************************************************************************************
82 //=============================================================================================================
83 // DEFINE NAMESPACE XDISPLIB
84 //=============================================================================================================
85 
86 namespace XDISPLIB
87 {
88 
89 //Declare type roles
90 namespace ChInfoModelRoles
91 {
92  enum ItemRole{GetOrigChName = Qt::UserRole + 1009,
93  GetMappedLayoutChName = Qt::UserRole + 1010,
94  GetChNumber = Qt::UserRole + 1011,
95  GetChKind = Qt::UserRole + 1012,
96  GetMEGType = Qt::UserRole + 1013,
97  GetChUnit = Qt::UserRole + 1014,
98  GetChAlias = Qt::UserRole + 1015,
99  GetChPosition = Qt::UserRole + 1016,
100  GetChDigitizer = Qt::UserRole + 1017,
101  GetChActiveFilter = Qt::UserRole + 1018,
102  GetChCoilType = Qt::UserRole + 1019};
103 }
104 
105 //=============================================================================================================
109 class ChInfoModel : public QAbstractTableModel
110 {
111  Q_OBJECT
112 public:
113  ChInfoModel(QObject *parent = 0);
114 
115  //=========================================================================================================
120  virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
121  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
122  virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
123  virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
124  virtual bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
125  virtual Qt::ItemFlags flags(const QModelIndex & index) const;
126  virtual bool insertRows(int position, int span, const QModelIndex & parent = QModelIndex());
127  virtual bool removeRows(int position, int span, const QModelIndex & parent = QModelIndex());
128 
129  //=========================================================================================================
135  void fiffInfoChanged(const FiffInfo &fiffInfo);
136 
137 // //=========================================================================================================
138 // /**
139 // * Updates the fiff info
140 // *
141 // * @param assignedOperators the filter operators which are currently active.
142 // */
143 // void assignedOperatorsChanged(const QMap<int,QSharedPointer<MNEOperator> > &assignedOperators);
144 
145  //=========================================================================================================
151  void layoutChanged(const QMap<QString,QPointF> &layoutMap);
152 
153  //=========================================================================================================
159  const QStringList & getMappedChannelsList();
160 
161  //=========================================================================================================
168  int getIndexFromOrigChName(QString chName);
169 
170  //=========================================================================================================
177  int getIndexFromMappedChName(QString chName);
178 
179 signals:
180  //=========================================================================================================
185  void channelsMappedToLayout(const QStringList &mappedLayoutChNames);
186 
187 protected:
188  //=========================================================================================================
193  void clearModel();
194 
195  //=========================================================================================================
200  void mapLayoutToChannels();
201 
203  QMap<QString,QPointF> m_layoutMap;
204  QStringList m_aliasNames;
205  QStringList m_mappedLayoutChNames;
206 // QMap<int,QSharedPointer<MNEOperator> > m_assignedOperators; /**< Map of MNEOperator types to channels.*/
207 
208 };
209 
210 } // NAMESPACE
211 
212 #endif // CHINFOCLASS_H
FIFF measurement file information.
Definition: fiff_info.h:96
QStringList m_aliasNames
Definition: chinfomodel.h:204
QMap< QString, QPointF > m_layoutMap
Definition: chinfomodel.h:203
Definition: fiff.h:98
QStringList m_mappedLayoutChNames
Definition: chinfomodel.h:205
FIFF class declaration, which provides static wrapper functions to stay consistent with mne matlab to...