Covariance matrix storage. More...
#include <mne_cov_matrix.h>
Public Types | |
| typedef QSharedPointer< MNECovMatrix > | SPtr |
| typedef QSharedPointer< const MNECovMatrix > | ConstSPtr |
Public Member Functions | |
| MNECovMatrix (int p_kind, int p_ncov, const QStringList &p_names, const Eigen::VectorXd &p_cov, const Eigen::VectorXd &p_cov_diag, FIFFLIB::FiffSparseMatrix *p_cov_sparse) | |
| ~MNECovMatrix () | |
| std::unique_ptr< MNECovMatrix > | dup () const |
| int | is_diag () const |
| int | add_inv () |
| int | condition (float rank_threshold, int use_rank) |
| int | decompose_eigen_small (float p_small, int use_rank) |
| int | decompose_eigen () |
Static Public Member Functions | |
| static std::unique_ptr< MNECovMatrix > | create_dense (int kind, int ncov, const QStringList &names, const Eigen::VectorXd &cov) |
| static std::unique_ptr< MNECovMatrix > | create_diag (int kind, int ncov, const QStringList &names, const Eigen::VectorXd &cov_diag) |
| static std::unique_ptr< MNECovMatrix > | create_sparse (int kind, int ncov, const QStringList &names, FIFFLIB::FiffSparseMatrix *cov_sparse) |
| static std::unique_ptr< MNECovMatrix > | create (int kind, int ncov, const QStringList &names, const Eigen::VectorXd &cov, const Eigen::VectorXd &cov_diag) |
Public Attributes | |
| int | kind |
| int | ncov |
| int | nfree |
| int | nproj |
| int | nzero |
| QStringList | names |
| Eigen::VectorXd | cov |
| Eigen::VectorXd | cov_diag |
| std::unique_ptr< FIFFLIB::FiffSparseMatrix > | cov_sparse |
| Eigen::VectorXd | lambda |
| Eigen::VectorXd | inv_lambda |
| Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | eigen |
| std::unique_ptr< MNEProjOp > | proj |
| std::unique_ptr< MNESssData > | sss |
| Eigen::VectorXi | ch_class |
| QStringList | bads |
| int | nbad |
Covariance matrix storage.
Stores a noise or source covariance matrix in dense (packed lower-triangle), diagonal, or sparse form together with its eigendecomposition and associated metadata (projection operator, SSS info, channel classification, bad channels).
Definition at line 104 of file mne_cov_matrix.h.
| typedef QSharedPointer<const MNECovMatrix> MNELIB::MNECovMatrix::ConstSPtr |
Const shared pointer type for MNECovMatrix.
Definition at line 108 of file mne_cov_matrix.h.
| typedef QSharedPointer<MNECovMatrix> MNELIB::MNECovMatrix::SPtr |
Shared pointer type for MNECovMatrix.
Definition at line 107 of file mne_cov_matrix.h.
| MNECovMatrix::MNECovMatrix | ( | int | p_kind, |
| int | p_ncov, | ||
| const QStringList & | p_names, | ||
| const Eigen::VectorXd & | p_cov, | ||
| const Eigen::VectorXd & | p_cov_diag, | ||
| FIFFLIB::FiffSparseMatrix * | p_cov_sparse ) |
Construct a covariance matrix.
| [in] | p_kind | Covariance kind (sensor or source). |
| [in] | p_ncov | Dimension (number of channels). |
| [in] | p_names | Channel names. |
| [in] | p_cov | Packed lower-triangle data (may be empty). |
| [in] | p_cov_diag | Diagonal data (may be empty). |
| [in] | p_cov_sparse | Sparse covariance data (may be nullptr). |
Definition at line 118 of file mne_cov_matrix.cpp.
| MNECovMatrix::~MNECovMatrix | ( | ) |
Destructor.
Definition at line 141 of file mne_cov_matrix.cpp.
| int MNECovMatrix::add_inv | ( | ) |
Compute the inverse square-root of eigenvalues (or diagonal elements) for whitening, storing the result in inv_lambda.
Definition at line 176 of file mne_cov_matrix.cpp.
| int MNECovMatrix::condition | ( | float | rank_threshold, |
| int | use_rank ) |
Condition the covariance matrix by eigendecomposition with per-channel-type scaling, zeroing sub-threshold eigenvalues, and reconstructing.
| [in] | rank_threshold | Eigenvalue threshold ratio for rank estimation. |
| [in] | use_rank | If positive, override the automatic rank estimate. |
Definition at line 200 of file mne_cov_matrix.cpp.
|
inlinestatic |
Create a covariance matrix from either dense or diagonal data.
| [in] | kind | Covariance kind (sensor or source). |
| [in] | ncov | Dimension (number of channels). |
| [in] | names | Channel names. |
| [in] | cov | Packed lower-triangle data (may be empty). |
| [in] | cov_diag | Diagonal data (may be empty). |
Definition at line 207 of file mne_cov_matrix.h.
|
inlinestatic |
Create a dense (full lower-triangle packed) covariance matrix.
| [in] | kind | Covariance kind (sensor or source). |
| [in] | ncov | Dimension (number of channels). |
| [in] | names | Channel names. |
| [in] | cov | Packed lower-triangle data (length ncov*(ncov+1)/2). Ownership transferred. |
Definition at line 149 of file mne_cov_matrix.h.
|
inlinestatic |
|
inlinestatic |
Create a sparse covariance matrix.
| [in] | kind | Covariance kind (sensor or source). |
| [in] | ncov | Dimension (number of channels). |
| [in] | names | Channel names. |
| [in] | cov_sparse | Sparse covariance data (note: data are floats). |
Definition at line 187 of file mne_cov_matrix.h.
| int MNECovMatrix::decompose_eigen | ( | ) |
Convenience wrapper for decompose_eigen_small() with default threshold and no rank override.
Definition at line 389 of file mne_cov_matrix.cpp.
| int MNECovMatrix::decompose_eigen_small | ( | float | p_small, |
| int | use_rank ) |
Perform eigenvalue decomposition of the covariance matrix, zero sub-threshold eigenvalues, classify eigenvectors by channel type, and compute inverse square-roots for whitening.
| [in] | p_small | Eigenvalue threshold (negative uses default). |
| [in] | use_rank | If positive, override automatic rank estimate. |
Definition at line 320 of file mne_cov_matrix.cpp.
| std::unique_ptr< MNECovMatrix > MNECovMatrix::dup | ( | ) | const |
Create a deep copy of this covariance matrix including data, channel classes, bad channel list, projection, and SSS info.
Definition at line 147 of file mne_cov_matrix.cpp.
| int MNECovMatrix::is_diag | ( | ) | const |
Check whether this covariance matrix is stored in diagonal form.
Definition at line 169 of file mne_cov_matrix.cpp.
| QStringList MNELIB::MNECovMatrix::bads |
Channel names designated bad during computation.
Definition at line 297 of file mne_cov_matrix.h.
| Eigen::VectorXi MNELIB::MNECovMatrix::ch_class |
Per-channel type classification for regularization (MEG grad, MEG mag, EEG).
Definition at line 296 of file mne_cov_matrix.h.
| Eigen::VectorXd MNELIB::MNECovMatrix::cov |
Packed lower-triangle covariance data (ncov*(ncov+1)/2 elements).
Definition at line 288 of file mne_cov_matrix.h.
| Eigen::VectorXd MNELIB::MNECovMatrix::cov_diag |
Diagonal covariance data (ncov elements).
Definition at line 289 of file mne_cov_matrix.h.
| std::unique_ptr<FIFFLIB::FiffSparseMatrix> MNELIB::MNECovMatrix::cov_sparse |
Sparse covariance matrix (note: data are floats).
Definition at line 290 of file mne_cov_matrix.h.
| Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> MNELIB::MNECovMatrix::eigen |
Eigenvectors of the covariance matrix (nzero columns removed).
Definition at line 293 of file mne_cov_matrix.h.
| Eigen::VectorXd MNELIB::MNECovMatrix::inv_lambda |
Inverse square-roots of eigenvalues (for whitening).
Definition at line 292 of file mne_cov_matrix.h.
| int MNELIB::MNECovMatrix::kind |
Covariance kind: sensor or source.
Definition at line 282 of file mne_cov_matrix.h.
| Eigen::VectorXd MNELIB::MNECovMatrix::lambda |
Eigenvalues of the covariance matrix.
Definition at line 291 of file mne_cov_matrix.h.
| QStringList MNELIB::MNECovMatrix::names |
Channel names (optional).
Definition at line 287 of file mne_cov_matrix.h.
| int MNELIB::MNECovMatrix::nbad |
Number of bad channels.
Definition at line 298 of file mne_cov_matrix.h.
| int MNELIB::MNECovMatrix::ncov |
Dimension (number of channels).
Definition at line 283 of file mne_cov_matrix.h.
| int MNELIB::MNECovMatrix::nfree |
Number of degrees of freedom used in estimation.
Definition at line 284 of file mne_cov_matrix.h.
| int MNELIB::MNECovMatrix::nproj |
Number of dimensions projected out.
Definition at line 285 of file mne_cov_matrix.h.
| int MNELIB::MNECovMatrix::nzero |
Number of zero or small eigenvalues.
Definition at line 286 of file mne_cov_matrix.h.
| std::unique_ptr<MNEProjOp> MNELIB::MNECovMatrix::proj |
The projection operator active when this matrix was computed.
Definition at line 294 of file mne_cov_matrix.h.
| std::unique_ptr<MNESssData> MNELIB::MNECovMatrix::sss |
SSS data from the associated raw data file.
Definition at line 295 of file mne_cov_matrix.h.