v2.0.0
Loading...
Searching...
No Matches
mne_proj_op.h
Go to the documentation of this file.
1//=============================================================================================================
18
19#ifndef MNEPROJOP_H
20#define MNEPROJOP_H
21
22//=============================================================================================================
23// INCLUDES
24//=============================================================================================================
25
26#include "mne_global.h"
27#include "mne_named_matrix.h"
28#include "mne_proj_item.h"
29
30#include <fiff/fiff_types.h>
31#include <fiff/fiff_stream.h>
32#include <fiff/fiff_dir_node.h>
33
34//=============================================================================================================
35// EIGEN INCLUDES
36//=============================================================================================================
37
38#include <Eigen/Core>
39
40//=============================================================================================================
41// QT INCLUDES
42//=============================================================================================================
43
44#include <QSharedPointer>
45#include <QTextStream>
46
47#include <memory>
48
49//=============================================================================================================
50// DEFINE NAMESPACE MNELIB
51//=============================================================================================================
52
53namespace MNELIB
54{
55
56class MNECovMatrix;
57
58//=============================================================================================================
69{
70public:
71 typedef QSharedPointer<MNEProjOp> SPtr;
72 typedef QSharedPointer<const MNEProjOp> ConstSPtr;
73
74 //=========================================================================================================
80 MNEProjOp();
81
82 //=========================================================================================================
86 ~MNEProjOp();
87
88 //=========================================================================================================
95 void free_proj();
96
107
118 void add_item_active(const MNENamedMatrix* vecs, int kind, const QString& desc, bool is_active);
119
129 void add_item(const MNENamedMatrix* vecs, int kind, const QString& desc);
130
138 std::unique_ptr<MNEProjOp> dup() const;
139
152 static std::unique_ptr<MNEProjOp> create_average_eeg_ref(const QList<FIFFLIB::FiffChInfo>& chs, int nch);
153
164 int affect(const QStringList& list, int nlist);
165
176 int affect_chs(const QList<FIFFLIB::FiffChInfo> &chs, int nch);
177
190 int project_vector(Eigen::Ref<Eigen::VectorXf> vec, bool do_complement);
191
201 static std::unique_ptr<MNEProjOp> read_from_node(FIFFLIB::FiffStream::SPtr& stream,
202 const FIFFLIB::FiffDirNode::SPtr& start);
203
213 static std::unique_ptr<MNEProjOp> read(const QString& name);
214
233 static bool makeProjection(const QList<QString>& projnames,
234 const QList<FIFFLIB::FiffChInfo>& chs,
235 int nch,
236 std::unique_ptr<MNEProjOp>& result);
237
248 void report_data(QTextStream &out, const QString &tag, bool list_data, const QStringList &exclude);
249
257 void report(QTextStream &out, const QString &tag);
258
259 //=========================================================================================================
269 int assign_channels(const QStringList& list, int nlist);
270
271 //=========================================================================================================
282 int make_proj_bad(const QStringList& bad);
283
284 //=========================================================================================================
291 int make_proj();
292
293 //=========================================================================================================
302 int project_dvector(Eigen::Ref<Eigen::VectorXd> vec, bool do_complement);
303
304 //=========================================================================================================
313 int apply_cov(MNECovMatrix* c);
314
315public:
316 QList<MNELIB::MNEProjItem> items;
317 int nitems;
318 QStringList names;
319 int nch;
320 int nvec;
321 Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> proj_data;
322};
323
324} // NAMESPACE MNELIB
325
326#endif // MNEPROJOP_H
Single SSP projection vector with kind/active flag and channel labels.
Row/column-labelled dense matrix used wherever FIFF stores per-channel data.
MNELIB shared-library export/import macros and library build metadata.
#define MNESHARED_EXPORT
Definition mne_global.h:40
Recursive node of the parsed FIFF block tree (FIFFB_* hierarchy with directory entries and children).
FIFF binary tag-stream layer: wraps a QIODevice to read and write FIFF tags, directories,...
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
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:72
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:71
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)