A dense matrix with named rows and columns. More...
#include <mne_named_matrix.h>
Public Types | |
| typedef QSharedPointer< MNENamedMatrix > | SPtr |
| typedef QSharedPointer< const MNENamedMatrix > | ConstSPtr |
Public Member Functions | |
| MNENamedMatrix () | |
| Default constructor. | |
| MNENamedMatrix (const MNENamedMatrix &p_MneNamedMatrix) | |
| Copy constructor. | |
| ~MNENamedMatrix () | |
| Destructor. | |
| std::unique_ptr< MNENamedMatrix > | pick (const QStringList &pickrowlist, int picknrow, const QStringList &pickcollist, int pickncol) const |
| Create a sub-matrix by picking named rows and columns. | |
Static Public Member Functions | |
| static std::unique_ptr< MNENamedMatrix > | build (int nrow, int ncol, const QStringList &rowlist, const QStringList &collist, const Eigen::MatrixXf &data) |
| Factory: build a named matrix from its constituent parts. | |
| static std::unique_ptr< MNENamedMatrix > | read (QSharedPointer< FIFFLIB::FiffStream > &stream, const QSharedPointer< FIFFLIB::FiffDirNode > &node, int kind) |
| Factory: read a named matrix from a FIFF file. | |
Public Attributes | |
| int | nrow |
| int | ncol |
| QStringList | rowlist |
| QStringList | collist |
| Eigen::MatrixXf | data |
A dense matrix with named rows and columns.
MNENamedMatrix associates a dense float matrix (Eigen::MatrixXf) with optional row and column name lists (QStringList). It is the C++ equivalent of the MNE-C mneNamedMatrixRec struct, and is used throughout the library to represent projection vectors, CTF compensation matrices, and forward-solution gain matrices.
The class provides factory methods to:
All factory methods return std::unique_ptr<MNENamedMatrix> for clear ownership.
Definition at line 101 of file mne_named_matrix.h.
| typedef QSharedPointer<const MNENamedMatrix> MNELIB::MNENamedMatrix::ConstSPtr |
Const shared pointer type for MNENamedMatrix.
Definition at line 105 of file mne_named_matrix.h.
| typedef QSharedPointer<MNENamedMatrix> MNELIB::MNENamedMatrix::SPtr |
Shared pointer type for MNENamedMatrix.
Definition at line 104 of file mne_named_matrix.h.
| MNENamedMatrix::MNENamedMatrix | ( | ) |
Default constructor.
Creates an empty named matrix with zero rows and columns and no associated name lists.
Definition at line 64 of file mne_named_matrix.cpp.
| MNENamedMatrix::MNENamedMatrix | ( | const MNENamedMatrix & | p_MneNamedMatrix | ) |
Copy constructor.
Performs a deep copy of all members: dimensions, name lists, and matrix data.
| [in] | p_MneNamedMatrix | The named matrix to copy. |
Definition at line 72 of file mne_named_matrix.cpp.
| MNENamedMatrix::~MNENamedMatrix | ( | ) |
Destructor.
All members (Eigen::MatrixXf, QStringList) are value types and clean themselves up automatically.
Definition at line 83 of file mne_named_matrix.cpp.
|
static |
Factory: build a named matrix from its constituent parts.
Assembles an MNENamedMatrix from dimension counts, optional row/column name lists, and a dense data matrix.
| [in] | nrow | Number of rows (must match data.rows()). |
| [in] | ncol | Number of columns (must match data.cols()). |
| [in] | rowlist | Name list for the rows (may be empty). |
| [in] | collist | Name list for the columns (may be empty). |
| [in] | data | Dense float matrix to store. |
Definition at line 89 of file mne_named_matrix.cpp.
| std::unique_ptr< MNENamedMatrix > MNENamedMatrix::pick | ( | const QStringList & | pickrowlist, |
| int | picknrow, | ||
| const QStringList & | pickcollist, | ||
| int | pickncol ) const |
Create a sub-matrix by picking named rows and columns.
Selects a subset of this matrix's rows and columns by matching their names against the supplied pick-lists. If a pick-list is empty, all rows (or columns) of the original are retained.
| [in] | pickrowlist | Row names to select (empty = keep all rows). |
| [in] | picknrow | Expected number of picked rows (used when pickrowlist is empty). |
| [in] | pickcollist | Column names to select (empty = keep all columns). |
| [in] | pickncol | Expected number of picked columns (used when pickcollist is empty). |
nullptr if a requested name was not found. Definition at line 106 of file mne_named_matrix.cpp.
|
static |
Factory: read a named matrix from a FIFF file.
Reads a two-dimensional tagged matrix of the given kind from node (or its first FIFFB_MNE_NAMED_MATRIX child). Row and column name lists are read from the associated FIFF_MNE_ROW_NAMES and FIFF_MNE_COL_NAMES tags when present.
| [in] | stream | Open FIFF stream to read from. |
| [in] | node | Directory node that contains (or is) the named-matrix block. |
| [in] | kind | FIFF tag kind that identifies the matrix data (e.g. FIFF_MNE_FORWARD_SOLUTION). |
nullptr on failure. Definition at line 204 of file mne_named_matrix.cpp.
| QStringList MNELIB::MNENamedMatrix::collist |
Name list for the columns (may be empty if unnamed).
Definition at line 200 of file mne_named_matrix.h.
| Eigen::MatrixXf MNELIB::MNENamedMatrix::data |
Dense data matrix of dimension nrow x ncol.
Definition at line 201 of file mne_named_matrix.h.
| int MNELIB::MNENamedMatrix::ncol |
Number of columns in data.
Definition at line 198 of file mne_named_matrix.h.
| int MNELIB::MNENamedMatrix::nrow |
Number of rows in data.
Definition at line 197 of file mne_named_matrix.h.
| QStringList MNELIB::MNENamedMatrix::rowlist |
Name list for the rows (may be empty if unnamed).
Definition at line 199 of file mne_named_matrix.h.