Skip to main content

FiffNamedMatrix

Namespace: FIFFLIB  ·  Library: FIFF Library

#include <fiff/fiff_named_matrix.h>

class FIFFLIB::FiffNamedMatrix

FIFF named matrix: dense / sparse Eigen matrix plus row-name and column-name string lists.

Used wherever the on-disk FIFF block pairs a matrix with channel-name metadata: SSP projectors (FIFFB_PROJ_ITEM), CTF compensators (FIFFB_MNE_CTF_COMP_DATA), forward gain matrices, MNE inverse operators, noise covariances. The name lists let downstream code index the matrix by name instead of by position, which is what the pick_channels / apply_proj paths rely on.

src/examples/ex_fiff_api/main.cpp
const FiffProj& pca = info.projs[0]; // "PCA-v1", 1 vector over 102 magnetometers, inactive
QList<FiffProj> projs = info.projs;
FiffProj::activate_projs(projs);

Inheritance​


Public Methods​

FiffNamedMatrix()​

Default constructor.


FiffNamedMatrix(p_nrow, p_ncol, p_row_names, p_col_names, p_data)​

Constructs named matrix with given parameters.

(No plausibility check is performed)

Parameters:

  • p_nrow : fiff_int_t Number of rows.

  • p_ncol : fiff_int_t Number of cols.

  • p_row_names : const QStringList & Row names.

  • p_col_names : const QStringList & Column names.

  • p_data : const Eigen::MatrixXd & Data of the named matrix.


FiffNamedMatrix(p_FiffNamedMatrix)​

Copy constructor.

Parameters:

  • p_FiffNamedMatrix : const FiffNamedMatrix & Named matrix which should be copied.

~FiffNamedMatrix()​

Destroys the named matrix.


clear()​

Initializes the named matrix.


isEmpty()​

Returns true if named matrix contains no data.

Returns:

  • bool — true if named matrix is empty.

transpose_named_matrix()​

Transpose a named matrix (FiffNamedMatrix).


Example​

Used in examples​

ex_fiff_api​

FIFF library: measurement info, channels, digitizer, transforms, projectors, covariance, events,.

src/examples/ex_fiff_api/main.cpp, line 159
FiffProj::activate_projs(projs);
ok &= expect(pca.desc == "PCA-v1" && !pca.active && pca.data->nrow == 1 && pca.data->ncol == 102 && projs[0].active,
"FiffProj/FiffNamedMatrix: PCA-v1 is 1 x 102 and inactive until activated");

Authors of this file​