v2.0.0
Loading...
Searching...
No Matches
inv_minimum_norm.h
Go to the documentation of this file.
1//=============================================================================================================
28
29#ifndef INV_MINIMUM_NORM_H
30#define INV_MINIMUM_NORM_H
31
32//=============================================================================================================
33// INCLUDES
34//=============================================================================================================
35
36#include "../inv_global.h"
37
40#include <fs/fs_label.h>
41
42#include <QSharedPointer>
43
44//=============================================================================================================
45// DEFINE NAMESPACE INVLIB
46//=============================================================================================================
47
48namespace INVLIB
49{
50
51//=============================================================================================================
52// FORWARD DECLARATIONS
53//=============================================================================================================
54
55//=============================================================================================================
70{
71public:
72 typedef QSharedPointer<InvMinimumNorm> SPtr;
73 typedef QSharedPointer<const InvMinimumNorm> ConstSPtr;
74
75 //=========================================================================================================
85 explicit InvMinimumNorm(const MNELIB::MNEInverseOperator &p_inverseOperator, float lambda, const QString method);
86
87 //=========================================================================================================
98 explicit InvMinimumNorm(const MNELIB::MNEInverseOperator &p_inverseOperator, float lambda, bool dSPM, bool sLORETA);
99
100 virtual ~InvMinimumNorm(){}
101
102 //=========================================================================================================
113 virtual InvSourceEstimate calculateInverse(const FIFFLIB::FiffEvoked &p_fiffEvoked, bool pick_normal = false);
114
115 virtual InvSourceEstimate calculateInverse(const Eigen::MatrixXd &data, float tmin, float tstep, bool pick_normal = false) const;
116
117 //=========================================================================================================
125 virtual void doInverseSetup(qint32 nave, bool pick_normal = false);
126
127 //=========================================================================================================
133 virtual const char* getName() const;
134
135 //=========================================================================================================
141 virtual const MNELIB::MNESourceSpaces& getSourceSpace() const;
142
143 //=========================================================================================================
150
151 //=========================================================================================================
157 void setMethod(QString method);
158
159 //=========================================================================================================
167 void setMethod(bool dSPM, bool sLORETA, bool eLoreta = false);
168
169 //=========================================================================================================
175 void setRegularization(float lambda);
176
177 //=========================================================================================================
185 void setELoretaOptions(int maxIter = 20, double eps = 1e-6, bool forceEqual = false);
186
187 //=========================================================================================================
193 inline Eigen::MatrixXd& getKernel();
194
195private:
196 //=========================================================================================================
206 void computeELoreta();
207
208 MNELIB::MNEInverseOperator m_inverseOperator;
209 float m_fLambda;
210 QString m_sMethod;
211 bool m_bsLORETA;
212 bool m_bdSPM;
213 bool m_beLoreta;
214
215 // eLORETA parameters
216 int m_iELoretaMaxIter;
217 double m_dELoretaEps;
218 bool m_bELoretaForceEqual;
219
220 bool inverseSetup;
222 Eigen::SparseMatrix<double> noise_norm;
223 QList<Eigen::VectorXi> vertno;
224 FSLIB::FsLabel label;
225 Eigen::MatrixXd K;
226};
227
228//=============================================================================================================
229// INLINE DEFINITIONS
230//=============================================================================================================
231
232inline Eigen::MatrixXd& InvMinimumNorm::getKernel()
233{
234 return K;
235}
236
237//=============================================================================================================
238
243} //NAMESPACE
244
245#endif // INV_MINIMUM_NORM_H
Reader and in-memory representation of a FreeSurfer/MNE surface label (.label).
Pre-computed inverse operator (whitened SVD of the forward model) for MNE/dSPM/sLORETA.
InvSourceEstimate value type — central source-space data container produced by every INVLIB inverse s...
INVLIB library export/import macros, build-info accessors, and namespace docstring for the inverse-so...
#define INVSHARED_EXPORT
Definition inv_global.h:38
Inverse source estimation (MNE, dSPM, sLORETA, dipole fitting).
Single averaged evoked response: time axis, data, baseline, channel info and averaging metadata.
Definition fiff_evoked.h:75
A FreeSurfer/MNE surface label: per-vertex indices, Tk-RAS positions and scalar values for one hemisp...
Definition fs_label.h:79
Source-space inverse-solution container with dense grid plus optional focal-dipole,...
virtual const MNELIB::MNESourceSpaces & getSourceSpace() const
Eigen::MatrixXd & getKernel()
void setELoretaOptions(int maxIter=20, double eps=1e-6, bool forceEqual=false)
virtual InvSourceEstimate calculateInverse(const Eigen::MatrixXd &data, float tmin, float tstep, bool pick_normal=false) const
QSharedPointer< const InvMinimumNorm > ConstSPtr
virtual void doInverseSetup(qint32 nave, bool pick_normal=false)
void setMethod(QString method)
MNELIB::MNEInverseOperator & getPreparedInverseOperator()
void setRegularization(float lambda)
virtual const char * getName() const
InvMinimumNorm(const MNELIB::MNEInverseOperator &p_inverseOperator, float lambda, const QString method)
QSharedPointer< InvMinimumNorm > SPtr
MNE-style inverse operator.
List of MNESourceSpace objects forming a subject source space.