MNE-CPP  beta 1.0
cluststcmodel.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef CLUSTSTCMODEL_H
37 #define CLUSTSTCMODEL_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "../disp3D_global.h"
45 
46 #include "cluststcworker.h"
47 
48 #include <fs/label.h>
49 #include <fs/surfaceset.h>
50 #include <fs/annotationset.h>
51 
52 
53 //*************************************************************************************************************
54 //=============================================================================================================
55 // Qt INCLUDES
56 //=============================================================================================================
57 
58 #include <QAbstractTableModel>
59 #include <QVector3D>
60 #include <QMap>
61 
62 
63 //*************************************************************************************************************
64 //=============================================================================================================
65 // Eigen INCLUDES
66 //=============================================================================================================
67 
68 #include <Eigen/Core>
69 
70 
71 //*************************************************************************************************************
72 //=============================================================================================================
73 // FORWARD DECLARATIONS
74 //=============================================================================================================
75 
76 namespace MNELIB
77 {
78  class MNESourceEstimate;
79 }
80 
81 
82 //*************************************************************************************************************
83 //=============================================================================================================
84 // DEFINE NAMESPACE DISP3DLIB
85 //=============================================================================================================
86 
87 namespace DISP3DLIB
88 {
89 
90 //*************************************************************************************************************
91 //=============================================================================================================
92 // USED NAMESPACES
93 //=============================================================================================================
94 
95 using namespace Eigen;
96 using namespace MNELIB;
97 using namespace FSLIB;
98 
99 //=============================================================================================================
105 class DISP3DSHARED_EXPORT ClustStcModel : public QAbstractTableModel
106 {
107  Q_OBJECT
108 public:
109  typedef QSharedPointer<ClustStcModel> SPtr;
110  typedef QSharedPointer<const ClustStcModel> ConstSPtr;
112  ClustStcModel(QObject *parent = 0);
113 
114  ~ClustStcModel();
115 
116  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const ;
117  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
118 
119  //=========================================================================================================
129  inline QVariant data(int row, int column, int role = Qt::DisplayRole) const;
130 
131  virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
132  virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
133 
134  void addData(const MNESourceEstimate &stc);
135 
136  void init(const AnnotationSet &annotationSet, const SurfaceSet &surfSet);
137 
138  inline QVector3D getMin() const;
139  inline QVector3D getMax() const;
140 
141  //1..10000
142  void setAverage(qint32 samples);
143 
144  void setLoop(bool looping);
145 
146  //1..100
147  void setNormalization(qint32 fraction);
148 
149  void setStcSample(const VectorXd &sample);
150 
151  void setVertLabelIDs(const VectorXi &vertLabelIDs);
152 
153 
154 private:
155  ClustStcWorker::SPtr m_pWorker;
156 
157  bool m_bRTMode;
158  bool m_bModelInit;
159  bool m_bDataInit;
160  bool m_bIntervallSet;
161 
162  VectorXi m_vertLabelIds;
163 
164  QMap<qint32, qint32> m_qMapLabelIdChannelLH;
165  QMap<qint32, qint32> m_qMapLabelIdChannelRH;
166 
167 
168  VectorXd m_vecCurStc;
169  double m_dStcNormMax;
170  double m_dStcNorm;
171  VectorXd m_vecCurRelStc;
172 
173  //ToDo implement this model as a state pattern -> to be used as ROIStc model and full Stc model
174 
175  //ROI Stuff
176 
177 
178  QList<Label> m_qListLabels;
179  qint32 m_iLHSize;
180  QList<RowVector4i> m_qListRGBAs;
181  QList<Matrix3Xf> m_qListTriRRs;
182 
183  AnnotationSet m_annotationSet;
184  SurfaceSet m_surfSet;
185 
186  QVector3D m_vecMinRR;
187  QVector3D m_vecMaxRR;
188 };
189 
190 
191 //*************************************************************************************************************
192 //=============================================================================================================
193 // INLINE DEFINITIONS
194 //=============================================================================================================
195 
196 inline QVariant ClustStcModel::data(int row, int column, int role) const
197 {
198  return data(index(row, column), role);
199 }
200 
201 
202 //*************************************************************************************************************
203 
204 inline QVector3D ClustStcModel::getMin() const
205 {
206  return m_vecMinRR;
207 }
208 
209 
210 //*************************************************************************************************************
211 
212 inline QVector3D ClustStcModel::getMax() const
213 {
214  return m_vecMaxRR;
215 }
216 
217 } // NAMESPACE
218 
219 Q_DECLARE_METATYPE(Eigen::Matrix3Xf);
220 Q_DECLARE_METATYPE(Eigen::VectorXd);
221 Q_DECLARE_METATYPE(FSLIB::Label);
222 
223 #endif // CLUSTSTCMODEL_H
Table model which prepares source estimate information.
QSharedPointer< const ClustStcModel > ConstSPtr
SurfaceSet class declaration.
QVariant data(int row, int column, int role=Qt::DisplayRole) const
QSharedPointer< ClustStcWorker > SPtr
Annotation set.
Definition: annotationset.h:96
ClustStcWorker class declaration.
AnnotationSet class declaration.
Label class declaration.
#define DISP3DSHARED_EXPORT
Definition: disp3D_global.h:57
QSharedPointer< ClustStcModel > SPtr
Freesurfer/MNE label.
Definition: label.h:97
A hemisphere set of surfaces.
Definition: surfaceset.h:83