40 if (node->find_tag(stream, kind, tag)) {
58 auto matrix = std::make_unique<MNESparseNamedMatrix>();
59 matrix->nrow =
data->rows();
60 matrix->ncol =
data->cols();
61 if (block->find_tag(stream,
FIFF_MNE_NROW, tag) && *tag->toInt() != matrix->nrow) {
62 qCritical(
"MNESparseNamedMatrix::read - FIFF_MNE_NROW conflicts with the matrix data.");
65 if (block->find_tag(stream,
FIFF_MNE_NCOL, tag) && *tag->toInt() != matrix->ncol) {
66 qCritical(
"MNESparseNamedMatrix::read - FIFF_MNE_NCOL conflicts with the matrix data.");
71 if (matrix->rowlist.size() != matrix->nrow) {
72 qCritical(
"MNESparseNamedMatrix::read - Incorrect number of entries in the row name list.");
78 if (matrix->collist.size() != matrix->ncol) {
79 qCritical(
"MNESparseNamedMatrix::read - Incorrect number of entries in the column name list.");
83 matrix->data = std::move(
data);
Symbolic FIFF tag, block, value, unit and channel-type constants shared across FIFFLIB.
#define FIFF_MNE_ROW_NAMES
#define FIFF_MNE_COL_NAMES
#define FIFFB_MNE_NAMED_MATRIX
FIFF tag: the 16-byte tag header (kind, type, size, next) plus its decoded payload.
Sparse variant of MNELIB::MNENamedMatrix, i.e. a sparse matrix with row and column name lists.
Core MNE data structures (source spaces, source estimates, hemispheres).
FIFF file I/O, in-memory data structures and high-level readers/writers.
QSharedPointer< FiffDirNode > SPtr
static FiffSparseMatrix::UPtr fiff_get_float_sparse_matrix(const FIFFLIB::FiffTag::UPtr &tag)
std::unique_ptr< FiffSparseMatrix > UPtr
FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every...
fiff_long_t start_block(fiff_int_t kind)
QSharedPointer< FiffStream > SPtr
fiff_long_t write_int(fiff_int_t kind, const fiff_int_t *data, fiff_int_t nel=1, fiff_int_t next=FIFFV_NEXT_SEQ)
fiff_long_t write_float_sparse_rcs(fiff_int_t kind, const Eigen::SparseMatrix< float > &mat)
fiff_long_t write_name_list(fiff_int_t kind, const QStringList &data)
static QStringList split_name_list(QString p_sNameList)
fiff_long_t end_block(fiff_int_t kind, fiff_int_t next=FIFFV_NEXT_SEQ)
std::unique_ptr< FiffTag > UPtr
std::unique_ptr< FIFFLIB::FiffSparseMatrix > data
void write(FIFFLIB::FiffStream &stream, int kind) const
static std::unique_ptr< MNESparseNamedMatrix > read(FIFFLIB::FiffStream::SPtr &stream, const FIFFLIB::FiffDirNode::SPtr &node, int kind)