covariance data More...
#include <fiff_cov.h>
Public Types | |
| typedef QSharedPointer< FiffCov > | SPtr |
| typedef QSharedPointer< const FiffCov > | ConstSPtr |
| typedef QSharedDataPointer< FiffCov > | SDPtr |
Public Member Functions | |
| FiffCov () | |
| FiffCov (QIODevice &p_IODevice) | |
| FiffCov (const FiffCov &p_FiffCov) | |
| ~FiffCov () | |
| void | clear () |
| bool | isEmpty () const |
| FiffCov | pick_channels (const QStringList &p_include=defaultQStringList, const QStringList &p_exclude=defaultQStringList) |
| FiffCov | prepare_noise_cov (const FiffInfo &p_info, const QStringList &p_chNames) const |
| FiffCov | regularize (const FiffInfo &p_info, double p_fMag=0.1, double p_fGrad=0.1, double p_fEeg=0.1, bool p_bProj=true, QStringList p_exclude=defaultQStringList) const |
| bool | save (const QString &fileName) const |
| FiffCov & | operator= (const FiffCov &rhs) |
Static Public Member Functions | |
| static FiffCov | compute_from_epochs (const FiffRawData &raw, const Eigen::MatrixXi &events, const QList< int > &eventCodes, float tmin, float tmax, float bmin=0.0f, float bmax=0.0f, bool doBaseline=false, bool removeMean=true, unsigned int ignoreMask=0, float delay=0.0f) |
| static FiffCov | computeGrandAverage (const QList< FiffCov > &covs) |
Public Attributes | |
| fiff_int_t | kind |
| Eigen::VectorXi | chClass |
| bool | diag |
| fiff_int_t | dim |
| QStringList | names |
| Eigen::MatrixXd | data |
| QList< FiffProj > | projs |
| QStringList | bads |
| fiff_int_t | nfree |
| Eigen::VectorXd | eig |
| Eigen::MatrixXd | eigvec |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const FIFFLIB::FiffCov &p_FiffCov) |
covariance data
Fiff cov data, which corresponds to a covariance data matrix
Definition at line 83 of file fiff_cov.h.

| typedef QSharedPointer<const FiffCov> FIFFLIB::FiffCov::ConstSPtr |
Const shared pointer type for FiffCov.
Definition at line 87 of file fiff_cov.h.
| typedef QSharedDataPointer<FiffCov> FIFFLIB::FiffCov::SDPtr |
Shared data pointer type for FiffCov.
Definition at line 88 of file fiff_cov.h.
| typedef QSharedPointer<FiffCov> FIFFLIB::FiffCov::SPtr |
Shared pointer type for FiffCov.
Definition at line 86 of file fiff_cov.h.
| FiffCov::FiffCov | ( | ) |
Constructs the covariance data matrix.
Definition at line 75 of file fiff_cov.cpp.
| FiffCov::FiffCov | ( | QIODevice & | p_IODevice | ) |
Constructs a covariance data matrix, by reading from a IO device.
| [in] | p_IODevice | IO device to read from the evoked data set. |
Definition at line 87 of file fiff_cov.cpp.
| FiffCov::FiffCov | ( | const FiffCov & | p_FiffCov | ) |
Copy constructor.
| [in] | p_FiffCov | Covariance data matrix which should be copied. |
Definition at line 110 of file fiff_cov.cpp.
| FiffCov::~FiffCov | ( | ) |
Destroys the covariance data matrix.
Definition at line 129 of file fiff_cov.cpp.
| void FiffCov::clear | ( | ) |
Initializes the covariance data matrix.
Definition at line 135 of file fiff_cov.cpp.
|
static |
Compute a noise covariance matrix from raw data based on event-locked epochs. Ported from compute_cov.c (MNE-C).
| [in] | raw | The raw data. |
| [in] | events | Event matrix (nEvents x 3): [sample, before, after]. |
| [in] | eventCodes | Which event codes to include. |
| [in] | tmin | Start of time window relative to event (seconds). |
| [in] | tmax | End of time window relative to event (seconds). |
| [in] | bmin | Baseline start (seconds, relative to event). Only used if doBaseline is true. |
| [in] | bmax | Baseline end (seconds, relative to event). Only used if doBaseline is true. |
| [in] | doBaseline | Whether to apply baseline correction before covariance computation. |
| [in] | removeMean | Whether to remove sample mean from the covariance estimate. |
| [in] | ignoreMask | Bit mask ANDed away from event codes before matching (default: 0 = no masking). |
| [in] | delay | Delay in seconds applied to the event sample before extracting the epoch (default: 0). |
Definition at line 486 of file fiff_cov.cpp.
Compute a weighted grand-average covariance from multiple covariance matrices, weighting each by its degrees of freedom (nfree).
| [in] | covs | List of covariance matrices to combine. |
Definition at line 627 of file fiff_cov.cpp.
|
inline |
True if FIFF covariance is empty.
Definition at line 264 of file fiff_cov.h.
Assignment Operator
| [in] | rhs | FiffCov which should be assigned. |
Definition at line 465 of file fiff_cov.cpp.
| FiffCov FiffCov::pick_channels | ( | const QStringList & | p_include = defaultQStringList, |
| const QStringList & | p_exclude = defaultQStringList ) |
python pick_channels_cov
Pick channels from covariance matrix
| [in] | p_include | List of channels to include (if empty, include all available). (optional). |
| [in] | p_exclude | Channels to exclude (if empty, do not exclude any). (optional). |
Definition at line 151 of file fiff_cov.cpp.
Prepare noise covariance matrix. Before creating inverse operator.
| [in] | p_info | measurement info. |
| [in] | p_chNames | Channels which should be taken into account. |
Definition at line 179 of file fiff_cov.cpp.
| FiffCov FiffCov::regularize | ( | const FiffInfo & | p_info, |
| double | p_fMag = 0.1, | ||
| double | p_fGrad = 0.1, | ||
| double | p_fEeg = 0.1, | ||
| bool | p_bProj = true, | ||
| QStringList | p_exclude = defaultQStringList ) const |
Regularize noise covariance matrix
This method works by adding a constant to the diagonal for each channel type separatly. Special care is taken to keep the rank of the data constant.
| [in] | p_info | The measurement info (used to get channel types and bad channels). |
| [in] | p_fMag | Regularization factor for MEG magnetometers. |
| [in] | p_fGrad | Regularization factor for MEG gradiometers. |
| [in] | p_fEeg | Regularization factor for EEG. |
| [in] | p_bProj | Apply or not projections to keep rank of data. |
| [in] | p_exclude | List of channels to mark as bad. If None, bads channels are extracted from both info['bads'] and cov['bads']. |
Definition at line 326 of file fiff_cov.cpp.
| bool FiffCov::save | ( | const QString & | fileName | ) | const |
Save this covariance matrix to a FIFF file.
| [in] | fileName | Output file path. |
Definition at line 601 of file fiff_cov.cpp.
|
friend |
overloading the stream out operator<<
| [in] | out | The stream to which the fiff covariance should be assigned to. |
| [in] | p_FiffCov | FiffCov which should be assigned to the stream. |
Definition at line 271 of file fiff_cov.h.
| QStringList FIFFLIB::FiffCov::bads |
List of bad channels.
Definition at line 253 of file fiff_cov.h.
| Eigen::VectorXi FIFFLIB::FiffCov::chClass |
Channel classification vector.
Definition at line 247 of file fiff_cov.h.
| Eigen::MatrixXd FIFFLIB::FiffCov::data |
Covariance data.
Definition at line 251 of file fiff_cov.h.
| bool FIFFLIB::FiffCov::diag |
If the covariance is stored in a diagonal order.
Definition at line 248 of file fiff_cov.h.
| fiff_int_t FIFFLIB::FiffCov::dim |
Dimension of the covariance (dim x dim).
Definition at line 249 of file fiff_cov.h.
| Eigen::VectorXd FIFFLIB::FiffCov::eig |
Vector of eigenvalues.
Definition at line 255 of file fiff_cov.h.
| Eigen::MatrixXd FIFFLIB::FiffCov::eigvec |
Matrix of eigenvectors (each row represents an eigenvector).
Definition at line 256 of file fiff_cov.h.
| fiff_int_t FIFFLIB::FiffCov::kind |
Covariance kind -> fiff_constants.h.
Definition at line 246 of file fiff_cov.h.
| QStringList FIFFLIB::FiffCov::names |
Channel names.
Definition at line 250 of file fiff_cov.h.
| fiff_int_t FIFFLIB::FiffCov::nfree |
Number of degrees of freedom.
Definition at line 254 of file fiff_cov.h.
| QList<FiffProj> FIFFLIB::FiffCov::projs |
List of available ssp projectors.
Definition at line 252 of file fiff_cov.h.