v2.0.0
Loading...
Searching...
No Matches
mne_proj_op.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef MNEPROJOP_H
38#define MNEPROJOP_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "mne_global.h"
45#include "mne_named_matrix.h"
46#include "mne_proj_item.h"
47
48#include <fiff/fiff_types.h>
49#include <fiff/fiff_stream.h>
50#include <fiff/fiff_dir_node.h>
51
52//=============================================================================================================
53// EIGEN INCLUDES
54//=============================================================================================================
55
56#include <Eigen/Core>
57
58//=============================================================================================================
59// QT INCLUDES
60//=============================================================================================================
61
62#include <QSharedPointer>
63#include <QTextStream>
64
65#include <memory>
66
67//=============================================================================================================
68// DEFINE NAMESPACE MNELIB
69//=============================================================================================================
70
71namespace MNELIB
72{
73
74class MNECovMatrix;
75
76//=============================================================================================================
87{
88public:
89 typedef QSharedPointer<MNEProjOp> SPtr;
90 typedef QSharedPointer<const MNEProjOp> ConstSPtr;
91
93 using RowMajorMatrixXf = Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
94
95 //=========================================================================================================
101 MNEProjOp();
102
103 //=========================================================================================================
107 ~MNEProjOp();
108
109 //=========================================================================================================
116 void free_proj();
117
128
139 void add_item_active(const MNENamedMatrix* vecs, int kind, const QString& desc, int is_active);
140
150 void add_item(const MNENamedMatrix* vecs, int kind, const QString& desc);
151
159 MNEProjOp* dup() const;
160
173 static MNEProjOp* create_average_eeg_ref(const QList<FIFFLIB::FiffChInfo>& chs, int nch);
174
185 int affect(const QStringList& list, int nlist);
186
197 int affect_chs(const QList<FIFFLIB::FiffChInfo> &chs, int nch);
198
212 int project_vector(float *vec, int nvec, int do_complement);
213
224 const FIFFLIB::FiffDirNode::SPtr& start);
225
235 static MNEProjOp* read(const QString& name);
236
255 static bool makeProjection(const QList<QString>& projnames,
256 const QList<FIFFLIB::FiffChInfo>& chs,
257 int nch,
258 std::unique_ptr<MNEProjOp>& result);
259
271 void report_data(QTextStream &out,const char *tag, int list_data, char **exclude, int nexclude);
272
280 void report(QTextStream &out,const char *tag);
281
282 //=========================================================================================================
292 int assign_channels(const QStringList& list, int nlist);
293
294 //=========================================================================================================
306 int make_proj_bad(char **bad, int nbad);
307
308 //=========================================================================================================
315 int make_proj();
316
317 //=========================================================================================================
327 int project_dvector(Eigen::Ref<Eigen::VectorXd> vec, int nch, int do_complement);
328
329 //=========================================================================================================
338 int apply_cov(MNECovMatrix* c);
339
340public:
341 QList<MNELIB::MNEProjItem> items;
342 int nitems;
343 QStringList names;
344 int nch;
345 int nvec;
347};
348
349} // NAMESPACE MNELIB
350
351#endif // MNEPROJOP_H
FiffStream class declaration.
FiffDirNode class declaration, which provides fiff dir tree processing methods.
Old fiff_type declarations - replace them.
mne library export/import macros.
#define MNESHARED_EXPORT
Definition mne_global.h:52
MNEProjItem class declaration.
MNENamedMatrix class declaration.
Core MNE data structures (source spaces, source estimates, hemispheres).
QSharedPointer< FiffDirNode > SPtr
QSharedPointer< FiffStream > SPtr
Covariance matrix storage.
A dense matrix with named rows and columns.
QStringList names
void free_proj()
Release the compiled projector data.
static MNEProjOp * read_from_node(FIFFLIB::FiffStream::SPtr &stream, const FIFFLIB::FiffDirNode::SPtr &start)
Read all linear projection items from a FIFF tree node.
RowMajorMatrixXf proj_data
int project_vector(float *vec, int nvec, int do_complement)
static MNEProjOp * read(const QString &name)
static MNEProjOp * create_average_eeg_ref(const QList< FIFFLIB::FiffChInfo > &chs, int nch)
Create an average EEG reference projector.
void report_data(QTextStream &out, const char *tag, int list_data, char **exclude, int nexclude)
int project_dvector(Eigen::Ref< Eigen::VectorXd > vec, int nch, int do_complement)
static bool makeProjection(const QList< QString > &projnames, const QList< FIFFLIB::FiffChInfo > &chs, int nch, std::unique_ptr< MNEProjOp > &result)
Load and combine SSP projection operators from files for the selected channels.
int apply_cov(MNECovMatrix *c)
Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > RowMajorMatrixXf
Definition mne_proj_op.h:93
int affect(const QStringList &list, int nlist)
void report(QTextStream &out, const char *tag)
MNEProjOp()
Default constructor.
QSharedPointer< const MNEProjOp > ConstSPtr
Definition mne_proj_op.h:90
MNEProjOp * combine(MNEProjOp *from)
Append all projection items from another operator.
MNEProjOp * dup() const
Create a deep copy of this projection operator.
int make_proj_bad(char **bad, int nbad)
QSharedPointer< MNEProjOp > SPtr
Definition mne_proj_op.h:89
void add_item(const MNENamedMatrix *vecs, int kind, const QString &desc)
Add a projection item that is active by default.
int affect_chs(const QList< FIFFLIB::FiffChInfo > &chs, int nch)
int assign_channels(const QStringList &list, int nlist)
QList< MNELIB::MNEProjItem > items
void add_item_active(const MNENamedMatrix *vecs, int kind, const QString &desc, int is_active)
Add a projection item with an explicit active/inactive state.