Projection operator managing a set of linear projection items and the final compiled projector matrix. More...
#include <mne_proj_op.h>
Public Types | |
| typedef QSharedPointer< MNEProjOp > | SPtr |
| typedef QSharedPointer< const MNEProjOp > | ConstSPtr |
Public Member Functions | |
| MNEProjOp () | |
| Default constructor. | |
| ~MNEProjOp () | |
| Destructor. | |
| void | free_proj () |
| Release the compiled projector data. | |
| MNEProjOp * | combine (MNEProjOp *from) |
| Append all projection items from another operator. | |
| 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. | |
| void | add_item (const MNENamedMatrix *vecs, int kind, const QString &desc) |
| Add a projection item that is active by default. | |
| std::unique_ptr< MNEProjOp > | dup () const |
| Create a deep copy of this projection operator. | |
| int | affect (const QStringList &list, int nlist) |
| int | affect_chs (const QList< FIFFLIB::FiffChInfo > &chs, int nch) |
| int | project_vector (Eigen::Ref< Eigen::VectorXf > vec, bool do_complement) |
| void | report_data (QTextStream &out, const QString &tag, bool list_data, const QStringList &exclude) |
| void | report (QTextStream &out, const QString &tag) |
| int | assign_channels (const QStringList &list, int nlist) |
| int | make_proj_bad (const QStringList &bad) |
| int | make_proj () |
| int | project_dvector (Eigen::Ref< Eigen::VectorXd > vec, bool do_complement) |
| int | apply_cov (MNECovMatrix *c) |
Static Public Member Functions | |
| 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. | |
| static std::unique_ptr< MNEProjOp > | read (const QString &name) |
| 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. | |
Public Attributes | |
| QList< MNELIB::MNEProjItem > | items |
| int | nitems |
| QStringList | names |
| int | nch |
| int | nvec |
| Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | proj_data |
Projection operator managing a set of linear projection items and the final compiled projector matrix.
MNEProjOp aggregates zero or more MNEProjItem entries, each holding a named matrix of projection vectors. When the operator is compiled (make_projector), the individual items are orthogonalised into a single dense projector stored in proj_data.
Definition at line 86 of file mne_proj_op.h.
| typedef QSharedPointer<const MNEProjOp> MNELIB::MNEProjOp::ConstSPtr |
Const shared pointer type for MNEProjOp.
Definition at line 90 of file mne_proj_op.h.
| typedef QSharedPointer<MNEProjOp> MNELIB::MNEProjOp::SPtr |
Shared pointer type for MNEProjOp.
Definition at line 89 of file mne_proj_op.h.
| MNEProjOp::MNEProjOp | ( | ) |
Default constructor.
Creates an empty operator with no projection items.
Definition at line 76 of file mne_proj_op.cpp.
| MNEProjOp::~MNEProjOp | ( | ) |
Destructor.
Definition at line 85 of file mne_proj_op.cpp.
| void MNEProjOp::add_item | ( | const MNENamedMatrix * | vecs, |
| int | kind, | ||
| const QString & | desc ) |
Add a projection item that is active by default.
Convenience wrapper around add_item_active() with is_active = TRUE.
| [in] | vecs | Named matrix holding the projection vectors. |
| [in] | kind | Projection kind constant. |
| [in] | desc | Human-readable description of the projection. |
Definition at line 165 of file mne_proj_op.cpp.
| void MNEProjOp::add_item_active | ( | const MNENamedMatrix * | vecs, |
| int | kind, | ||
| const QString & | desc, | ||
| bool | is_active ) |
Add a projection item with an explicit active/inactive state.
The projection kind (MEG/EEG) is auto-detected from channel names.
| [in] | vecs | Named matrix holding the projection vectors. |
| [in] | kind | Projection kind constant. |
| [in] | desc | Human-readable description of the projection. |
| [in] | is_active | Whether the item is active on load. |
Definition at line 121 of file mne_proj_op.cpp.
| int MNEProjOp::affect | ( | const QStringList & | list, |
| int | nlist ) |
Count how many active projection vectors affect a given list of channel names.
| [in] | list | List of channel names to test. |
| [in] | nlist | Number of channel names. |
Definition at line 223 of file mne_proj_op.cpp.
| int MNEProjOp::affect_chs | ( | const QList< FIFFLIB::FiffChInfo > & | chs, |
| int | nch ) |
Count how many active projection vectors affect the given channels. Convenience wrapper that extracts channel names and delegates to affect().
| [in] | chs | Channel information list. |
| [in] | nch | Number of channels. |
Definition at line 237 of file mne_proj_op.cpp.
| int MNEProjOp::apply_cov | ( | MNECovMatrix * | c | ) |
Apply this projection operator to a covariance matrix from both sides: C' = (I - P) C (I - P)^T (or P C P^T if do_complement is false).
| [in,out] | c | The covariance matrix to project. |
Definition at line 780 of file mne_proj_op.cpp.
| int MNEProjOp::assign_channels | ( | const QStringList & | list, |
| int | nlist ) |
Assign a channel name list to this projection operator, invalidating any previously compiled projector.
| [in] | list | Channel name list. |
| [in] | nlist | Number of channels. |
Definition at line 501 of file mne_proj_op.cpp.
Append all projection items from another operator.
Each item's active_file flag is preserved.
| [in] | from | Source operator whose items are copied. |
Definition at line 104 of file mne_proj_op.cpp.
|
static |
Create an average EEG reference projector.
Builds a uniform-weight vector (
) across all EEG channels.
| [in] | chs | Channel information list. |
| [in] | nch | Number of channels. |
Definition at line 189 of file mne_proj_op.cpp.
| std::unique_ptr< MNEProjOp > MNEProjOp::dup | ( | ) | const |
Create a deep copy of this projection operator.
Copies all items, their vectors, descriptions, and active states.
Definition at line 172 of file mne_proj_op.cpp.
| void MNEProjOp::free_proj | ( | ) |
| int MNEProjOp::make_proj | ( | ) |
Compile the projection operator via SVD (no bad channels). Convenience wrapper around make_proj_bad().
Definition at line 681 of file mne_proj_op.cpp.
| int MNEProjOp::make_proj_bad | ( | const QStringList & | bad | ) |
Compile the projection operator via SVD, excluding bad channels. Active projection items are picked, expanded to the assigned channel list, bad channels are zeroed, and SVD is performed to produce an orthogonal projector matrix stored in proj_data.
| [in] | bad | List of bad channel names. |
Definition at line 530 of file mne_proj_op.cpp.
|
static |
Load and combine SSP projection operators from files for the selected channels.
Reads projection items from each file in projnames, and if EEG channels are present adds an average EEG reference projector when none is found. Returns nullptr if the resulting projector does not affect any of the given channels.
Refactored: make_projection (dipole_fit_setup.c)
| [in] | projnames | List of FIFF file paths containing projection data. |
| [in] | chs | Channel information list. |
| [in] | nch | Number of channels. |
| [out] | result | The combined projection operator (nullptr when no projection is needed). |
Definition at line 715 of file mne_proj_op.cpp.
| int MNEProjOp::project_dvector | ( | Eigen::Ref< Eigen::VectorXd > | vec, |
| bool | do_complement ) |
Apply the compiled projection operator to a double-precision data vector.
| [in,out] | vec | Data vector. |
| [in] | do_complement | If true, compute (I - P) * vec. |
Definition at line 688 of file mne_proj_op.cpp.
| int MNEProjOp::project_vector | ( | Eigen::Ref< Eigen::VectorXf > | vec, |
| bool | do_complement ) |
Apply the compiled projection operator to a data vector in-place.
If do_complement is true, the projected components are subtracted from vec (signal cleaning). Otherwise, vec is replaced by the projection itself.
| [in,out] | vec | Data vector of length nch. |
| [in] | do_complement | If true, compute the complement (I - P) * vec. |
Definition at line 250 of file mne_proj_op.cpp.
|
static |
Read a projection operator from a FIFF file by path. Convenience wrapper that opens the file and delegates to read_from_node().
| [in] | name | Path to the FIFF file. |
Definition at line 428 of file mne_proj_op.cpp.
|
static |
Read all linear projection items from a FIFF tree node.
| [in] | stream | An open FIFF stream. |
| [in] | start | The tree node to search for projection blocks. |
Definition at line 282 of file mne_proj_op.cpp.
| void MNEProjOp::report | ( | QTextStream & | out, |
| const QString & | tag ) |
Write a one-line-per-item summary of all projection items to a text stream (no vector data). Convenience wrapper around report_data().
| [in,out] | out | The text stream to write to. |
| [in] | tag | Prefix string printed before each line. |
Definition at line 494 of file mne_proj_op.cpp.
| void MNEProjOp::report_data | ( | QTextStream & | out, |
| const QString & | tag, | ||
| bool | list_data, | ||
| const QStringList & | exclude ) |
Write a formatted summary of all projection items to a text stream, optionally including the full projection vector data while zeroing out excluded channels.
| [in,out] | out | The text stream to write to. |
| [in] | tag | Prefix string printed before each line. |
| [in] | list_data | If true, print full vector data. |
| [in] | exclude | Channel names to exclude from the display. |
Definition at line 446 of file mne_proj_op.cpp.
| QList<MNELIB::MNEProjItem> MNELIB::MNEProjOp::items |
The projection items.
Definition at line 334 of file mne_proj_op.h.
| QStringList MNELIB::MNEProjOp::names |
Names of the channels in the final compiled projector.
Definition at line 336 of file mne_proj_op.h.
| int MNELIB::MNEProjOp::nch |
Number of channels in the final projector.
Definition at line 337 of file mne_proj_op.h.
| int MNELIB::MNEProjOp::nitems |
Number of items.
Definition at line 335 of file mne_proj_op.h.
| int MNELIB::MNEProjOp::nvec |
Number of orthogonalized vectors in the final projector.
Definition at line 338 of file mne_proj_op.h.
| Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> MNELIB::MNEProjOp::proj_data |
The compiled projector: orthogonalized projection vectors (nvec x nch).
Definition at line 339 of file mne_proj_op.h.