58 using namespace Eigen;
59 using namespace MNELIB;
60 using namespace INVERSELIB;
61 using namespace UTILSLIB;
62 using namespace FIFFLIB;
68 MinimumNorm::MinimumNorm(
const MNEInverseOperator &p_inverseOperator,
float lambda,
const QString method)
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)
205 VectorXd* tmp = MNEMath::combine_xyz(sol.col(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");