MNE-CPP  beta 1.0
inverseviewproducer.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef INVERSEVIEWPRODUCER_H
37 #define INVERSEVIEWPRODUCER_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include <mne/mne_sourceestimate.h>
45 
46 
47 //*************************************************************************************************************
48 //=============================================================================================================
49 // Eigen INCLUDES
50 //=============================================================================================================
51 
52 #include <Eigen/Core>
53 
54 
55 //*************************************************************************************************************
56 //=============================================================================================================
57 // QT INCLUDES
58 //=============================================================================================================
59 
60 #include <QThread>
61 #include <QMutex>
62 #include <QVector>
63 
64 
65 //*************************************************************************************************************
66 //=============================================================================================================
67 // DEFINE NAMESPACE DISP3DLIB
68 //=============================================================================================================
69 
70 namespace DISP3DLIB
71 {
72 
73 //*************************************************************************************************************
74 //=============================================================================================================
75 // USED NAMESPACES
76 //=============================================================================================================
77 
78 using namespace Eigen;
79 using namespace MNELIB;
80 
81 
82 //*************************************************************************************************************
83 //=============================================================================================================
84 // FORWARD DECLARATIONS
85 //=============================================================================================================
86 
87 class InverseView;
88 
89 //=============================================================================================================
95 class InverseViewProducer : public QThread
96 {
97  Q_OBJECT
98 public:
99  typedef QSharedPointer<InverseViewProducer> SPtr;
100  typedef QSharedPointer<const InverseViewProducer> ConstSPtr;
102  //=========================================================================================================
110  InverseViewProducer(qint32 p_iFps, bool p_bLoop, bool p_bSlowMotion);
111 
112  //=========================================================================================================
117 
118  //=========================================================================================================
124  inline double getGlobalMax() const;
125 
126  //=========================================================================================================
132  inline VectorXd getMaxActivation() const;
133 
134  //=========================================================================================================
140  void pushSourceEstimate(MNESourceEstimate &p_sourceEstimate);
141 
142  //=========================================================================================================
146  void stop();
147 
148 signals:
149  void sourceEstimateSample(QSharedPointer<Eigen::VectorXd>);
150 
151 protected:
152  //=========================================================================================================
158  virtual void run();
159 
160 
161 private:
162  QMutex mutex;
163 
164  bool m_bIsRunning;
166  qint32 m_iFps;
167  bool m_bLoop;
168  bool m_bSlowMotion;
169  qint32 m_iT;
170  qint32 m_iCurSampleStep;
171  double m_dGlobalMaximum;
172  bool m_bBeep;
174  QVector<VectorXd> m_vecStcs;
175  QVector<float> m_vecTime;
177  VectorXd m_vecMaxActivation;
179 // CircularMatrixBuffer<double>::SPtr m_pSourceEstimateBuffer; /**< Holds incoming source estimate sample data.*/
180 };
181 
182 //*************************************************************************************************************
183 //=============================================================================================================
184 // INLINE DEFINITIONS
185 //=============================================================================================================
186 
188 {
189  return m_dGlobalMaximum;
190 }
191 
192 
193 //*************************************************************************************************************
194 
196 {
197  return m_vecMaxActivation;
198 }
199 
200 
201 } // NAMESPACE
202 
203 #endif // INVERSEVIEWPRODUCER_H
204 
QSharedPointer< const InverseViewProducer > ConstSPtr
QSharedPointer< InverseViewProducer > SPtr
MNESourceEstimate class declaration.