FreeSurfer MGH/MGZ file reader. More...
#include <mri_mgh_io.h>
Static Public Member Functions | |
| static bool | read (const QString &mgzFile, MriVolData &volData, QVector< FIFFLIB::FiffCoordTrans > &additionalTrans, const QString &subjectMriDir=QString(), bool verbose=false) |
FreeSurfer MGH/MGZ file reader.
Reader for FreeSurfer MGH/MGZ volume files.
Reads the header, voxel data, and footer tags from MGH/MGZ files into an MriVolData structure. Automatically decompresses .mgz files using gunzip.
Based on the FreeSurfer MGH format specification: https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MghFormat
Ported from make_mgh_cor_set() in MNE C mne_make_cor_set by Matti Hamalainen.
Definition at line 108 of file mri_mgh_io.h.
|
static |
Reads a FreeSurfer MGH or MGZ file.
Parses the header geometry (dimensions, voxel sizes, direction cosines, center RAS), reads voxel data into per-slice MriSlice structures, and extracts footer tags including the Talairach .xfm path.
For .mgz files, automatic gzip decompression is performed via zlib.
| [in] | mgzFile | Path to the .mgz or .mgh file. |
| [out] | volData | MriVolData structure to populate. |
| [out] | additionalTrans | Additional coordinate transforms found in footer (e.g., Talairach). |
| [in] | subjectMriDir | Path to subject's mri/ directory (for resolving relative .xfm paths). |
| [in] | verbose | If true, print progress information. |
Definition at line 78 of file mri_mgh_io.cpp.