59using namespace MNELIB;
60using namespace INVERSELIB;
61using namespace UTILSLIB;
62using namespace FIFFLIB;
69: m_inverseOperator(p_inverseOperator)
79: m_inverseOperator(p_inverseOperator)
93 qint32 nave = p_fiffEvoked.
nave;
96 qWarning(
"Channel name check failed.");
107 printf(
"Picked %d channels from the data\n",t_fiffEvoked.
info.
nchan);
110 float tmin = p_fiffEvoked.
times[0];
187 qWarning(
"MinimumNorm::calculateInverse - Inverse not setup -> call doInverseSetup first!");
191 if(K.cols() != data.rows()) {
192 qWarning() <<
"MinimumNorm::calculateInverse - Dimension mismatch between K.cols() and data.rows() -" << K.cols() <<
"and" << data.rows();
196 MatrixXd sol = K * data;
198 if (inv.
source_ori == FIFFV_MNE_FREE_ORI && pick_normal ==
false)
200 printf(
"combining the current components...\n");
202 MatrixXd sol1(sol.rows()/3,sol.cols());
203 for(qint32 i = 0; i < sol.cols(); ++i)
206 sol1.block(0,i,sol.rows()/3,1) = tmp->cwiseSqrt();
209 sol.resize(sol1.rows(),sol1.cols());
220 printf(
"(sLORETA)...");
226 VectorXi p_vecVertices(inv.
src[0].vertno.
size() + inv.
src[1].vertno.
size());
227 p_vecVertices << inv.
src[0].vertno, inv.
src[1].vertno;
245 printf(
"Computing inverse...\n");
246 inv.
assemble_kernel(label, m_sMethod, pick_normal, K, noise_norm, vertno);
248 std::cout <<
"K " << K.rows() <<
" x " << K.cols() << std::endl;
257 return "Minimum Norm Estimate";
264 return m_inverseOperator.
src;
271 if(method.compare(
"MNE") == 0)
273 else if(method.compare(
"dSPM") == 0)
275 else if(method.compare(
"sLORETA") == 0)
279 qWarning(
"Method not recognized!");
284 printf(
"\tSet minimum norm method to %s.\n", method.toUtf8().constData());
293 qWarning(
"Cant activate dSPM and sLORETA at the same time! - Activating dSPM");
300 m_bsLORETA = sLORETA;
302 m_sMethod = QString(
"dSPM");
304 m_sMethod = QString(
"sLORETA");
306 m_sMethod = QString(
"MNE");
FiffEvoked class declaration.
MNESourceEstimate class declaration.
Minimum norm class declaration.
FiffEvoked pick_channels(const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList) const
virtual void doInverseSetup(qint32 nave, bool pick_normal=false)
MinimumNorm(const MNELIB::MNEInverseOperator &p_inverseOperator, float lambda, const QString method)
virtual const char * getName() const
virtual const MNELIB::MNESourceSpace & getSourceSpace() const
void setMethod(QString method)
void setRegularization(float lambda)
virtual MNELIB::MNESourceEstimate calculateInverse(const FIFFLIB::FiffEvoked &p_fiffEvoked, bool pick_normal=false)
Eigen::SparseMatrix< double > noisenorm
bool assemble_kernel(const FSLIB::Label &label, QString method, bool pick_normal, Eigen::MatrixXd &K, Eigen::SparseMatrix< double > &noise_norm, QList< Eigen::VectorXi > &vertno)
bool check_ch_names(const FIFFLIB::FiffInfo &info) const
MNEInverseOperator prepare_inverse_operator(qint32 nave, float lambda2, bool dSPM, bool sLORETA=false) const
FIFFLIB::fiff_int_t source_ori
FIFFLIB::FiffCov::SDPtr noise_cov
Source Space descritpion.
static Eigen::VectorXd * combine_xyz(const Eigen::VectorXd &vec)