MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
mne.h
Go to the documentation of this file.
1//=============================================================================================================
39#ifndef MNE_H
40#define MNE_H
41
42//=============================================================================================================
43// INCLUDES
44//=============================================================================================================
45
46#include "mne_global.h"
47
49#include "mne_forwardsolution.h"
50#include "mne_hemisphere.h"
51#include "mne_sourcespace.h"
52#include "mne_surface.h"
53#include "mne_bem.h"
54#include "mne_bem_surface.h"
55#include "mne_epoch_data_list.h"
56
57#include <fiff/fiff_constants.h>
58#include <fiff/fiff_cov.h>
59
60#include <utils/mnemath.h>
61
62//=============================================================================================================
63// QT INCLUDES
64//=============================================================================================================
65
66#include <QMap>
67
68//=============================================================================================================
69// DEFINE NAMESPACE MNELIB
70//=============================================================================================================
71
72namespace MNELIB
73{
74
75//=============================================================================================================
76// FORWARD DECLARATIONS
77//=============================================================================================================
78
79//=============================================================================================================
86{
87
88public:
89
90 //=========================================================================================================
94 virtual ~MNE()
95 { }
96
97 //=========================================================================================================
111 inline static Eigen::VectorXd* combine_xyz(const Eigen::VectorXd& vec)
112 {
114 }
115
116 //=========================================================================================================
124 // static inline Eigen::MatrixXd extract_block_diag(MatrixXd& A, qint32 n);
125
126 //=========================================================================================================
140 inline static qint32 find_source_space_hemi(MNEHemisphere& p_Hemisphere)
141 {
142 return MNESourceSpace::find_source_space_hemi(p_Hemisphere);
143 }
144
145 //=========================================================================================================
159 static inline qint32 get_current_comp(FIFFLIB::FiffInfo* info)
160 {
161 return info->get_current_comp();
162 }
163
164 //ToDo Why is make_block_diag part of MNEForwardSolution - restructure this
165 //=========================================================================================================
184 static inline Eigen::SparseMatrix<double>* make_block_diag(const Eigen::MatrixXd &A, qint32 n)
185 {
187 }
188
189 //=========================================================================================================
207 inline static bool make_compensator(const FIFFLIB::FiffInfo& info,
208 FIFFLIB::fiff_int_t from,
209 FIFFLIB::fiff_int_t to,
210 FIFFLIB::FiffCtfComp& ctf_comp,
211 bool exclude_comp_chs = false)
212 {
213 return info.make_compensator(from, to, ctf_comp, exclude_comp_chs);
214 }
215
216 //=========================================================================================================
236 inline static FIFFLIB::fiff_int_t make_projector(const QList<FIFFLIB::FiffProj>& projs,
237 const QStringList& ch_names,
238 Eigen::MatrixXd& proj,
239 const QStringList& bads = FIFFLIB::defaultQStringList,
240 Eigen::MatrixXd& U = FIFFLIB::defaultMatrixXd)
241 {
243 ch_names,
244 proj,
245 bads,
246 U);
247 }
248
249 //=========================================================================================================
264 static inline qint32 make_projector(FIFFLIB::FiffInfo& info,
265 Eigen::MatrixXd& proj)
266 {
267 return info.make_projector(proj);
268 }
269
270 //=========================================================================================================
282 static bool patch_info(MNEHemisphere &p_Hemisphere)
283 {
284 return MNESourceSpace::patch_info(p_Hemisphere);
285 }
286
287 //=========================================================================================================
306 qint32 nave,
307 float lambda2,
308 bool dSPM,
309 bool sLORETA = false)
310 {
311 return orig.prepare_inverse_operator(nave, lambda2, dSPM, sLORETA);
312 }
313
314 static bool read_events(QString t_sEventName,
315 QString t_fileRawName,
316 Eigen::MatrixXi& events);
317
318// ToDo Eventlist Class??
319 //=========================================================================================================
332 static bool read_events_from_fif(QIODevice &p_IODevice,
333 Eigen::MatrixXi& eventlist);
334
335 //=========================================================================================================
346 static bool read_events_from_ascii(QIODevice &p_IODevice,
347 Eigen::MatrixXi& eventlist);
348
349 static void setup_compensators(FIFFLIB::FiffRawData& raw,
350 FIFFLIB::fiff_int_t dest_comp,
351 bool keep_comp);
352
353 //=========================================================================================================
370 inline static bool read_cov(FIFFLIB::FiffStream::SPtr& p_pStream,
371 const FIFFLIB::FiffDirNode::SPtr& p_Node,
372 FIFFLIB::fiff_int_t cov_kind,
373 FIFFLIB::FiffCov& p_covData)
374 {
375 return p_pStream->read_cov(p_Node,
376 cov_kind,
377 p_covData);
378 }
379
380 //=========================================================================================================
395 static bool read_inverse_operator(QIODevice& p_pIODevice,
397 {
398 return MNEInverseOperator::read_inverse_operator(p_pIODevice,
399 inv);
400 }
401
402 //=========================================================================================================
421 static inline bool read_forward_solution(QIODevice& p_IODevice,
423 bool force_fixed = false,
424 bool surf_ori = false,
425 const QStringList& include = FIFFLIB::defaultQStringList,
426 const QStringList& exclude = FIFFLIB::defaultQStringList)
427 {
428 return MNEForwardSolution::read(p_IODevice,
429 fwd,
430 force_fixed,
431 surf_ori,
432 include,
433 exclude);
434 }
435
436 //=========================================================================================================
454 bool add_geom,
455 MNESourceSpace& p_SourceSpace)
456 {
457 return MNESourceSpace::readFromStream(p_pStream,
458 add_geom,
459 p_SourceSpace);
460 }
461
462 //=========================================================================================================
481 bool add_geom,
483 QList<MNESurface::SPtr>& p_Surfaces)
484 {
485 return MNESurface::read(p_pStream,
486 add_geom,
487 p_Tree,
488 p_Surfaces);
489 }
490
491 //ToDo FiffChInfoList Class
492 //=========================================================================================================
509 static QList<FIFFLIB::FiffChInfo> set_current_comp(QList<FIFFLIB::FiffChInfo>& chs,
510 FIFFLIB::fiff_int_t value)
511 {
513 value);
514 }
515
516 //=========================================================================================================
532 static inline bool transform_source_space_to(MNESourceSpace& p_pMNESourceSpace,
533 FIFFLIB::fiff_int_t dest,
535 {
536 return p_pMNESourceSpace.transform_source_space_to(dest,
537 trans);
538 }
539
540 //=========================================================================================================
554 {
556 }
557};
558} // NAMESPACE
559
560#endif // MNE_H
Fiff constants.
FiffCov class declaration.
MNEMath class declaration.
mne library export/import macros.
#define MNESHARED_EXPORT
Definition mne_global.h:56
MNEHemisphere class declaration.
MNEForwardSolution class declaration, which provides the forward solution including the source space ...
Contains the declaration of the MNESurface class.
MNEEpochDataList class declaration.
MNEBem class declaration.
MNESourceSpace class declaration.
MNEBemSurface class declaration.
Coordinate transformation description.
covariance data
Definition fiff_cov.h:78
CTF software compensation data.
QSharedPointer< FiffDirNode > SPtr
FIFF measurement file information.
Definition fiff_info.h:85
void set_current_comp(fiff_int_t value)
Definition fiff_info.h:292
qint32 make_projector(Eigen::MatrixXd &proj) const
Definition fiff_info.h:278
qint32 get_current_comp()
bool make_compensator(fiff_int_t from, fiff_int_t to, FiffCtfComp &ctf_comp, bool exclude_comp_chs=false) const
static fiff_int_t make_projector(const QList< FiffProj > &projs, const QStringList &ch_names, Eigen::MatrixXd &proj, const QStringList &bads=defaultQStringList, Eigen::MatrixXd &U=defaultMatrixXd)
FIFF raw measurement data.
QSharedPointer< FiffStream > SPtr
The MNE class provides wrapper functions to stay consistent with mne matlab toolbox.
Definition mne.h:86
static qint32 make_projector(FIFFLIB::FiffInfo &info, Eigen::MatrixXd &proj)
Definition mne.h:264
static qint32 get_current_comp(FIFFLIB::FiffInfo *info)
Definition mne.h:159
static bool read_inverse_operator(QIODevice &p_pIODevice, MNEInverseOperator &inv)
Definition mne.h:395
static bool read_bem_surface(FIFFLIB::FiffStream::SPtr &p_pStream, bool add_geom, FIFFLIB::FiffDirNode::SPtr &p_Tree, QList< MNESurface::SPtr > &p_Surfaces)
Definition mne.h:480
static bool make_compensator(const FIFFLIB::FiffInfo &info, FIFFLIB::fiff_int_t from, FIFFLIB::fiff_int_t to, FIFFLIB::FiffCtfComp &ctf_comp, bool exclude_comp_chs=false)
Definition mne.h:207
static FIFFLIB::fiff_int_t make_projector(const QList< FIFFLIB::FiffProj > &projs, const QStringList &ch_names, Eigen::MatrixXd &proj, const QStringList &bads=FIFFLIB::defaultQStringList, Eigen::MatrixXd &U=FIFFLIB::defaultMatrixXd)
Definition mne.h:236
static QList< FIFFLIB::FiffChInfo > set_current_comp(QList< FIFFLIB::FiffChInfo > &chs, FIFFLIB::fiff_int_t value)
Definition mne.h:509
virtual ~MNE()
Definition mne.h:94
static MNEInverseOperator prepare_inverse_operator(MNEInverseOperator &orig, qint32 nave, float lambda2, bool dSPM, bool sLORETA=false)
Definition mne.h:305
static void transpose_named_matrix(FIFFLIB::FiffNamedMatrix &mat)
Definition mne.h:553
static bool patch_info(MNEHemisphere &p_Hemisphere)
Definition mne.h:282
static bool transform_source_space_to(MNESourceSpace &p_pMNESourceSpace, FIFFLIB::fiff_int_t dest, FIFFLIB::FiffCoordTrans &trans)
Definition mne.h:532
static bool read_cov(FIFFLIB::FiffStream::SPtr &p_pStream, const FIFFLIB::FiffDirNode::SPtr &p_Node, FIFFLIB::fiff_int_t cov_kind, FIFFLIB::FiffCov &p_covData)
Definition mne.h:370
static qint32 find_source_space_hemi(MNEHemisphere &p_Hemisphere)
Definition mne.h:140
static Eigen::SparseMatrix< double > * make_block_diag(const Eigen::MatrixXd &A, qint32 n)
Definition mne.h:184
static bool read_source_spaces(FIFFLIB::FiffStream::SPtr &p_pStream, bool add_geom, MNESourceSpace &p_SourceSpace)
Definition mne.h:453
static Eigen::VectorXd * combine_xyz(const Eigen::VectorXd &vec)
Definition mne.h:111
static bool read_forward_solution(QIODevice &p_IODevice, MNEForwardSolution &fwd, bool force_fixed=false, bool surf_ori=false, const QStringList &include=FIFFLIB::defaultQStringList, const QStringList &exclude=FIFFLIB::defaultQStringList)
Definition mne.h:421
Hemisphere provides geometry information.
MNEInverseOperator prepare_inverse_operator(qint32 nave, float lambda2, bool dSPM, bool sLORETA=false) const
Source Space descritpion.
bool transform_source_space_to(FIFFLIB::fiff_int_t dest, FIFFLIB::FiffCoordTrans &trans)
static Eigen::SparseMatrix< double > * make_block_diag(const Eigen::MatrixXd &A, qint32 n)
Definition mnemath.cpp:347
static Eigen::VectorXd * combine_xyz(const Eigen::VectorXd &vec)
Definition mnemath.cpp:81
MNEInverseOperator class declaration.