Implementation of MRILIB::MriMghIO: byte-exact MGH/MGZ parser and zlib-streamed MGZ decoder. More...
#include "mri_mgh_io.h"#include <fiff/fiff_coord_trans.h>#include <fiff/fiff_constants.h>#include <fiff/fiff_file.h>#include <QFile>#include <QFileInfo>#include <QDataStream>#include <QDebug>#include <QRegularExpression>#include <zlib.h>#include <Eigen/Core>
Go to the source code of this file.
Implementation of MRILIB::MriMghIO: byte-exact MGH/MGZ parser and zlib-streamed MGZ decoder.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
Implements the big-endian header parse, the column-major voxel buffer reader (templated over the four MGH voxel types — UCHAR / SHORT / INT / FLOAT — so quantisation is preserved instead of being eagerly promoted to float), and the optional footer-tag walker that recovers TR / TE / flipAngle / FoV plus the talairach.xfm path. MGZ inputs are routed through a single zlib inflate() call with MAX_WBITS+16 (gzip wrapping enabled) so the on-disk and in-memory paths share the same parser. Output is materialised as the slice-of-slices MriVolData representation consumed by every downstream rendering and export path. Ported from make_mgh_cor_set() in MNE C mne_make_cor_set by Matti Hamalainen.
Definition in file mri_mgh_io.cpp.