45 #include <fiff/fiff_evoked.h>
64 #include <QGuiApplication>
73 using namespace FSLIB;
94 int main(
int argc,
char *argv[])
96 QGuiApplication a(argc, argv);
101 QFile t_fileFwd(
"./MNE-sample-data/MEG/sample/sample_audvis-meg-eeg-oct-6-fwd.fif");
102 QFile t_fileEvoked(
"./MNE-sample-data/MEG/sample/sample_audvis-ave.fif");
103 AnnotationSet t_annotationSet(
"sample", 2,
"aparc.a2009s",
"./MNE-sample-data/subjects");
104 SurfaceSet t_surfSet(
"sample", 2,
"white",
"./MNE-sample-data/subjects");
106 QString t_sFileNameStc(
"");
108 qint32 numDipolePairs = 7;
113 for(qint32 i = 0; i < argc; ++i)
115 if(strcmp(argv[i],
"-stc") == 0 || strcmp(argv[i],
"--stc") == 0)
118 t_sFileNameStc = QString::fromUtf8(argv[i+1]);
119 }
else if(strcmp(argv[i],
"-num") == 0 || strcmp(argv[i],
"--num") == 0)
122 numDipolePairs = atof(argv[i+1]);
126 qDebug() <<
"Start calculation with stc:" << t_sFileNameStc;
129 fiff_int_t setno = 0;
130 QPair<QVariant, QVariant> baseline(QVariant(), 0);
131 FiffEvoked evoked(t_fileEvoked, setno, baseline);
135 std::cout <<
"evoked first " << evoked.first <<
"; last " << evoked.last << std::endl;
141 QStringList ch_sel_names = t_Fwd.info.ch_names;
153 PwlRapMusic t_pwlRapMusic(t_clusteredFwd,
false, numDipolePairs);
156 t_pwlRapMusic.setStcAttr(200,0.5);
161 std::cout <<
"source estimated" << std::endl;
166 QList<Label> t_qListLabels;
167 QList<RowVector4i> t_qListRGBAs;
170 t_annotationSet.toLabels(t_surfSet, t_qListLabels, t_qListRGBAs);
172 InverseView view(t_pwlRapMusic.getSourceSpace(), t_qListLabels, t_qListRGBAs, 24,
true,
false,
false);
175 if (view.stereoType() != QGLView::RedCyanAnaglyph)
176 view.camera()->setEyeSeparation(0.3f);
177 QStringList args = QCoreApplication::arguments();
178 int w_pos = args.indexOf(
"-width");
179 int h_pos = args.indexOf(
"-height");
180 if (w_pos >= 0 && h_pos >= 0)
183 int w = args.at(w_pos + 1).toInt(&ok);
186 qWarning() <<
"Could not parse width argument:" << args;
189 int h = args.at(h_pos + 1).toInt(&ok);
192 qWarning() <<
"Could not parse height argument:" << args;
199 view.resize(800, 600);
204 view.pushSourceEstimate(sourceEstimate);
206 if(!t_sFileNameStc.isEmpty())
208 QFile t_fileClusteredStc(t_sFileNameStc);
209 sourceEstimate.
write(t_fileClusteredStc);
MNEForwardSolution cluster_forward_solution(const AnnotationSet &p_AnnotationSet, qint32 p_iClusterSize, MatrixXd &p_D=defaultD, const FiffCov &p_pNoise_cov=defaultCov, const FiffInfo &p_pInfo=defaultInfo, QString p_sMethod="cityblock") const
PwlRapMusic algorithm class declaration.
bool write(QIODevice &p_IODevice)
FiffEvoked pick_channels(const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList) const
Surface class declaration.
MNESourceEstimate class declaration.
AnnotationSet class declaration.
InverseView class declaration.
The PwlRapMusic class provides the POWELL RAP MUSIC Algorithm CPU implementation. ToDo: Paper referen...
MNEMath class declaration.
FIFF class declaration, which provides static wrapper functions to stay consistent with mne matlab to...
A hemisphere set of surfaces.