MNE-CPP  0.1.9
A Framework for Electrophysiology
compute_fwd.h
Go to the documentation of this file.
1 //=============================================================================================================
38 #ifndef COMPUTEFWD_H
39 #define COMPUTEFWD_H
40 
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "../fwd_global.h"
46 #include "compute_fwd_settings.h"
47 
49 #include "../fwd_coil_set.h"
51 #include "../fwd_eeg_sphere_model_set.h"
52 #include "../fwd_bem_model.h"
53 
54 #include <mne/c/mne_named_matrix.h>
55 #include <mne/c/mne_nearest.h>
58 
60 
61 #include <fiff/fiff_types.h>
62 
63 //=============================================================================================================
64 // EIGEN INCLUDES
65 //=============================================================================================================
66 
67 #include <Eigen/Core>
68 
69 //=============================================================================================================
70 // QT INCLUDES
71 //=============================================================================================================
72 
73 #include <QSharedPointer>
74 #include <QString>
75 
76 #include <QCoreApplication>
77 #include <QFile>
78 #include <QDir>
79 
80 //=============================================================================================================
81 // FORWARD DECLARATIONS
82 //=============================================================================================================
83 namespace MNELIB {
84  class MNEForwardSolution;
85 }
86 
87 //=============================================================================================================
88 // DEFINE NAMESPACE FWDLIB
89 //=============================================================================================================
90 
91 namespace FWDLIB
92 {
93 
94 //=============================================================================================================
101 {
102 public:
103  typedef QSharedPointer<ComputeFwd> SPtr;
104  typedef QSharedPointer<const ComputeFwd> ConstSPtr;
106  //=========================================================================================================
111  explicit ComputeFwd(ComputeFwdSettings::SPtr pSettings);
112 
113  //=========================================================================================================
117  virtual ~ComputeFwd();
118 
119  //=========================================================================================================
123  void calculateFwd();
124 
125  //=========================================================================================================
130  void updateHeadPos(FIFFLIB::FiffCoordTransOld* transDevHeadOld);
131 
132  //=========================================================================================================
139  void storeFwd(const QString& sSolName = "default");
140 
141  // ToDo: make MNEForwardSolution the main output for the solution
142  // QSharedPointer<MNELIB::MNEForwardSolution> fwdSolution; /**< MNE Forward solution that contains all results. */
143 
144  QSharedDataPointer<FIFFLIB::FiffNamedMatrix> sol;
145  QSharedDataPointer<FIFFLIB::FiffNamedMatrix> sol_grad;
147  QSharedDataPointer<FIFFLIB::FiffNamedMatrix> m_meg_forward;
148  QSharedDataPointer<FIFFLIB::FiffNamedMatrix> m_meg_forward_grad;
149  QSharedDataPointer<FIFFLIB::FiffNamedMatrix> m_eeg_forward;
150  QSharedDataPointer<FIFFLIB::FiffNamedMatrix> m_eeg_forward_grad;
152  QString qPath;
153  QFile file;
154 
155 private:
156  //=========================================================================================================
160  void initFwd();
161 
162  MNELIB::MneSourceSpaceOld **m_spaces;
163  int m_iNSpace;
164  int m_iNSource;
165  FwdCoilSet* m_templates;
166  FwdCoilSet* m_megcoils;
167  FwdCoilSet* m_compcoils;
168  FwdCoilSet* m_eegels;
169  MNELIB::MneCTFCompDataSet *m_compData;
170  FwdEegSphereModelSet* m_eegModels;
171  FwdEegSphereModel* m_eegModel;
172  FwdBemModel *m_bemModel;
173  Eigen::Vector3f *m_r0;
175  QList<FIFFLIB::FiffChInfo> m_listMegChs;
176  QList<FIFFLIB::FiffChInfo> m_listEegChs;
177  QList<FIFFLIB::FiffChInfo> m_listCompChs;
178  int m_iNChan;
180  FIFFLIB::fiffId m_mri_id;
181  FIFFLIB::FiffId m_meas_id;
182  FIFFLIB::FiffCoordTransOld* m_mri_head_t;
183  FIFFLIB::FiffCoordTransOld* m_meg_head_t;
185  QSharedPointer<FIFFLIB::FiffInfoBase> m_pInfoBase;
186 
187  ComputeFwdSettings::SPtr m_pSettings;
189  //=========================================================================================================
203  int mne_read_meg_comp_eeg_ch_info_41(FIFFLIB::FiffInfoBase::SPtr pFiffInfoBase,
204  QList<FIFFLIB::FiffChInfo>& listMegCh,
205  int& iNMeg,
206  QList<FIFFLIB::FiffChInfo>& listMegComp,
207  int& iNMegCmp,
208  QList<FIFFLIB::FiffChInfo>& listEegCh,
209  int& iNEeg,
210  FIFFLIB::FiffCoordTransOld** transDevHeadOld,
211  FIFFLIB::FiffId& id);
212 
213 };
214 
215 //=============================================================================================================
216 // INLINE DEFINITIONS
217 //=============================================================================================================
218 } //NAMESPACE
219 
220 #endif // COMPUTEFWDSETTINGS_H
FIFFLIB::FiffInfoBase::SPtr
QSharedPointer< FiffInfoBase > SPtr
Definition: fiff_info_base.h:78
FWDLIB::ComputeFwd::m_meg_forward_grad
QSharedDataPointer< FIFFLIB::FiffNamedMatrix > m_meg_forward_grad
Definition: compute_fwd.h:148
mne_source_space_old.h
MneSourceSpaceOld class declaration.
FWDLIB::FwdEegSphereModelSet
Holds a set of Electric Current Dipoles.
Definition: fwd_eeg_sphere_model_set.h:80
FIFFLIB::_fiffIdRec
ToDo Old implementation use new fiff_id.h instead.
Definition: fiff_types_mne-c.h:214
fiff_sparse_matrix.h
FiffSparseMatrix class declaration.
FWDLIB::ComputeFwd
Compute Forward implementation.
Definition: compute_fwd.h:100
FWDLIB::FwdEegSphereModel
Electric Current Dipole description.
Definition: fwd_eeg_sphere_model.h:91
FWDLIB::ComputeFwd::m_eeg_forward_grad
QSharedDataPointer< FIFFLIB::FiffNamedMatrix > m_eeg_forward_grad
Definition: compute_fwd.h:150
compute_fwd_settings.h
Compute Forward Setting class declaration.
FWDLIB::FwdCoilSet
FwdCoilSet description.
Definition: fwd_coil_set.h:75
FIFFLIB::FiffId
Universially unique identifier.
Definition: fiff_id.h:68
FWDLIB::ComputeFwd::m_meg_forward
QSharedDataPointer< FIFFLIB::FiffNamedMatrix > m_meg_forward
Definition: compute_fwd.h:147
FIFFLIB::FiffCoordTransOld
Coordinate transformation descriptor.
Definition: fiff_coord_trans_old.h:80
FWDSHARED_EXPORT
#define FWDSHARED_EXPORT
Definition: fwd_global.h:57
FWDLIB::ComputeFwdSettings::SPtr
QSharedPointer< ComputeFwdSettings > SPtr
Definition: compute_fwd_settings.h:82
FWDLIB::ComputeFwd::sol
QSharedDataPointer< FIFFLIB::FiffNamedMatrix > sol
Definition: compute_fwd.h:144
FWDLIB::ComputeFwd::m_eeg_forward
QSharedDataPointer< FIFFLIB::FiffNamedMatrix > m_eeg_forward
Definition: compute_fwd.h:149
mne_nearest.h
MneNearest class declaration.
FWDLIB::ComputeFwd::sol_grad
QSharedDataPointer< FIFFLIB::FiffNamedMatrix > sol_grad
Definition: compute_fwd.h:145
MNELIB::MneSourceSpaceOld
This defines a source space.
Definition: mne_source_space_old.h:76
MNELIB::MneCTFCompDataSet
One MNE CTF Compensation Data Set description.
Definition: mne_ctf_comp_data_set.h:81
mne_forwardsolution.h
MNEForwardSolution class declaration, which provides the forward solution including the source space ...
mne_named_matrix.h
MNE Named Matrix (MneNamedMatrix) class declaration.
FWDLIB::FwdBemModel
Holds the BEM model definition.
Definition: fwd_bem_model.h:110
fiff_types.h
Definitions for describing the objects in a FIFF file.
FWDLIB::ComputeFwd::SPtr
QSharedPointer< ComputeFwd > SPtr
Definition: compute_fwd.h:103
FWDLIB::ComputeFwd::ConstSPtr
QSharedPointer< const ComputeFwd > ConstSPtr
Definition: compute_fwd.h:104
fiff_coord_trans_old.h
FiffCoordTransOld class declaration.
mne_ctf_comp_data_set.h
MneCTFCompDataSet class declaration.