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
92 //=========================================================================================================
98 MNEProjOp();
99
100 //=========================================================================================================
104 ~MNEProjOp();
105
106 //=========================================================================================================
113 void free_proj();
114
125
136 void add_item_active(const MNENamedMatrix* vecs, int kind, const QString& desc, bool is_active);
137
147 void add_item(const MNENamedMatrix* vecs, int kind, const QString& desc);
148
156 std::unique_ptr<MNEProjOp> dup() const;
157
170 static std::unique_ptr<MNEProjOp> create_average_eeg_ref(const QList<FIFFLIB::FiffChInfo>& chs, int nch);
171
182 int affect(const QStringList& list, int nlist);
183
194 int affect_chs(const QList<FIFFLIB::FiffChInfo> &chs, int nch);
195
208 int project_vector(Eigen::Ref<Eigen::VectorXf> vec, bool do_complement);
209
219 static std::unique_ptr<MNEProjOp> read_from_node(FIFFLIB::FiffStream::SPtr& stream,
220 const FIFFLIB::FiffDirNode::SPtr& start);
221
231 static std::unique_ptr<MNEProjOp> read(const QString& name);
232
251 static bool makeProjection(const QList<QString>& projnames,
252 const QList<FIFFLIB::FiffChInfo>& chs,
253 int nch,
254 std::unique_ptr<MNEProjOp>& result);
255
266 void report_data(QTextStream &out, const QString &tag, bool list_data, const QStringList &exclude);
267
275 void report(QTextStream &out, const QString &tag);
276
277 //=========================================================================================================
287 int assign_channels(const QStringList& list, int nlist);
288
289 //=========================================================================================================
300 int make_proj_bad(const QStringList& bad);
301
302 //=========================================================================================================
309 int make_proj();
310
311 //=========================================================================================================
320 int project_dvector(Eigen::Ref<Eigen::VectorXd> vec, bool do_complement);
321
322 //=========================================================================================================
331 int apply_cov(MNECovMatrix* c);
332
333public:
334 QList<MNELIB::MNEProjItem> items;
335 int nitems;
336 QStringList names;
337 int nch;
338 int nvec;
339 Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> proj_data;
340};
341
342} // NAMESPACE MNELIB
343
344#endif // MNEPROJOP_H
Old fiff_type declarations - replace them.
FiffDirNode class declaration, which provides fiff dir tree processing methods.
FiffStream class declaration.
MNENamedMatrix class declaration.
mne library export/import macros.
#define MNESHARED_EXPORT
Definition mne_global.h:52
MNEProjItem 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.
Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > proj_data
QStringList names
void report_data(QTextStream &out, const QString &tag, bool list_data, const QStringList &exclude)
void free_proj()
Release the compiled projector data.
static std::unique_ptr< MNEProjOp > read(const QString &name)
void add_item_active(const MNENamedMatrix *vecs, int kind, const QString &desc, bool is_active)
Add a projection item with an explicit active/inactive state.
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)
int affect(const QStringList &list, int nlist)
MNEProjOp()
Default constructor.
int make_proj_bad(const QStringList &bad)
QSharedPointer< const MNEProjOp > ConstSPtr
Definition mne_proj_op.h:90
MNEProjOp * combine(MNEProjOp *from)
Append all projection items from another operator.
int project_vector(Eigen::Ref< Eigen::VectorXf > vec, bool do_complement)
int project_dvector(Eigen::Ref< Eigen::VectorXd > vec, bool do_complement)
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)
std::unique_ptr< MNEProjOp > dup() const
Create a deep copy of this projection operator.
int assign_channels(const QStringList &list, int nlist)
static std::unique_ptr< MNEProjOp > create_average_eeg_ref(const QList< FIFFLIB::FiffChInfo > &chs, int nch)
Create an average EEG reference projector.
static std::unique_ptr< MNEProjOp > read_from_node(FIFFLIB::FiffStream::SPtr &stream, const FIFFLIB::FiffDirNode::SPtr &start)
Read all linear projection items from a FIFF tree node.
QList< MNELIB::MNEProjItem > items
void report(QTextStream &out, const QString &tag)