MNE-CPP  beta 1.0
minimumnorm.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef MINIMUMNORM_H
37 #define MINIMUMNORM_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "../inverse_global.h"
45 #include "../IInverseAlgorithm.h"
46 
48 #include <fs/label.h>
49 
50 #include <QSharedPointer>
51 
52 
53 //*************************************************************************************************************
54 //=============================================================================================================
55 // DEFINE NAMESPACE INVERSELIB
56 //=============================================================================================================
57 
58 namespace INVERSELIB
59 {
60 
61 //*************************************************************************************************************
62 //=============================================================================================================
63 // FORWARD DECLARATIONS
64 //=============================================================================================================
65 
66 
67 //*************************************************************************************************************
68 //=============================================================================================================
69 // USED NAMESPACES
70 //=============================================================================================================
71 
72 using namespace MNELIB;
73 using namespace FSLIB;
74 
75 
76 //=============================================================================================================
83 {
84 public:
85  typedef QSharedPointer<MinimumNorm> SPtr;
86  typedef QSharedPointer<const MinimumNorm> ConstSPtr;
88  //=========================================================================================================
98  explicit MinimumNorm(const MNEInverseOperator &p_inverseOperator, float lambda, const QString method);
99 
100  //=========================================================================================================
111  explicit MinimumNorm(const MNEInverseOperator &p_inverseOperator, float lambda, bool dSPM, bool sLORETA);
112 
113  virtual ~MinimumNorm(){}
114 
115  //=========================================================================================================
126  virtual MNESourceEstimate calculateInverse(const FiffEvoked &p_fiffEvoked, bool pick_normal = false);
127 
128  virtual MNESourceEstimate calculateInverse(const MatrixXd &data, float tmin, float tstep) const;
129 
130  virtual void doInverseSetup(qint32 nave, bool pick_normal = false);
131 
132 
133  virtual const char* getName() const;
134 
135  virtual const MNESourceSpace& getSourceSpace() const;
136 
137  //=========================================================================================================
143  inline MNEInverseOperator& getPreparedInverseOperator();
144 
145  //=========================================================================================================
151  void setMethod(QString method);
152 
153  //=========================================================================================================
160  void setMethod(bool dSPM, bool sLORETA);
161 
162  //=========================================================================================================
168  void setRegularization(float lambda);
169 
170  inline MatrixXd& getKernel();
171 
172 private:
173  MNEInverseOperator m_inverseOperator;
174  float m_fLambda;
175  QString m_sMethod;
176  bool m_bsLORETA;
177  bool m_bdSPM;
179  bool inverseSetup;
180  MNEInverseOperator inv;
181  SparseMatrix<double> noise_norm;
182  QList<VectorXi> vertno;
183  Label label;
184  MatrixXd K;
186 };
187 
188 //*************************************************************************************************************
189 //=============================================================================================================
190 // INLINE DEFINITIONS
191 //=============================================================================================================
192 
193 inline MatrixXd& MinimumNorm::getKernel()
194 {
195  return K;
196 }
197 
198 
199 //*************************************************************************************************************
200 
202 {
203  return inv;
204 }
205 
206 } //NAMESPACE
207 
208 #endif // MINIMUMNORM_H
Source Space descritpion.
QSharedPointer< MinimumNorm > SPtr
Definition: minimumnorm.h:85
evoked data
Definition: fiff_evoked.h:91
MNEInverseOperator & getPreparedInverseOperator()
Definition: minimumnorm.h:201
#define INVERSESHARED_EXPORT
MNEInverseOperator class declaration.
QSharedPointer< const MinimumNorm > ConstSPtr
Definition: minimumnorm.h:86
Minimum norm estimation.
Definition: minimumnorm.h:82
Label class declaration.
Inverse algorithm interface.
Freesurfer/MNE label.
Definition: label.h:97