MNE-CPP  beta 1.0
main.cpp
1 //=============================================================================================================
38 //*************************************************************************************************************
39 //=============================================================================================================
40 // INCLUDES
41 //=============================================================================================================
42 
43 #include <iostream>
44 #include <vector>
45 #include <math.h>
46 
47 
48 #include <fiff/fiff.h>
49 #include <mne/mne.h>
50 
51 
52 //*************************************************************************************************************
53 //=============================================================================================================
54 // QT INCLUDES
55 //=============================================================================================================
56 
57 #include <QtCore/QCoreApplication>
58 
59 
60 //*************************************************************************************************************
61 //=============================================================================================================
62 // USED NAMESPACES
63 //=============================================================================================================
64 
65 using namespace FIFFLIB;
66 using namespace MNELIB;
67 
68 
69 //*************************************************************************************************************
70 //=============================================================================================================
71 // MAIN
72 //=============================================================================================================
73 
74 //=============================================================================================================
83 int main(int argc, char *argv[])
84 {
85  QCoreApplication a(argc, argv);
86 
87  //generate FiffEvoked object
88  QFile t_sampleFile("./MNE-sample-data/MEG/sample/sample_audvis-ave.fif");
89  FiffEvoked p_FiffEvoked(t_sampleFile,QVariant("2"));
90 
91  //Select the head coordinate system
92  bool use_ctf_head = 1;
93  FiffCoordTrans meg_trans;
94 
95  if(use_ctf_head) {
96  if(p_FiffEvoked.info.ctf_head_t.isEmpty())
97  std::cout << "\nNo CTF head transformation available" << std::endl;
98  else {
99  meg_trans = p_FiffEvoked.info.dev_ctf_t;
100  FiffCoordTrans eeg_trans(meg_trans);
101  eeg_trans.invert_transform();
102  std::cout << "Employing the CTF/4D head coordinate system\n" << std::endl;
103  }
104  }
105  else {
106  meg_trans = p_FiffEvoked.info.dev_head_t;
107  FiffCoordTrans eeg_trans;
108  std::cout << "Employing the Neuromag head coordinate system\n" << std::endl;
109  }
110 
111  //Transform coil and electrode locations to the desired coordinate frame
112  //ToDo: MATLAB root fct fiff_transform_meg_chs and fiff_transform_eeg_chs needs to be implemented
113 
114  //Create the coil definitions
115  //ToDo: MATLAB root fct mne_add_coil_defs needs to be implemented
116 
117  //N.B. If a nonstandard (in MNE sense) coil def file is used, do
118  //ToDo: MATLAB root fct mne_load_coil_def, mne_add_coil_defs needs to be implemented
119 
120  return a.exec();
121 }
122 
123 //*************************************************************************************************************
124 //=============================================================================================================
125 // STATIC DEFINITIONS
126 //=============================================================================================================
evoked data
Definition: fiff_evoked.h:91
Definition: fiff.h:98
Coordinate transformation description.
FIFF class declaration, which provides static wrapper functions to stay consistent with mne matlab to...