Implementation of MRILIB::MriVolData: header-driven geometry computations and the suffix-dispatch loader. More...
#include "mri_vol_data.h"#include "mri_mgh_io.h"#include "mri_nifti_io.h"#include <fiff/fiff_file.h>
Go to the source code of this file.
Implementation of MRILIB::MriVolData: header-driven geometry computations and the suffix-dispatch loader.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
Houses the non-trivial methods MriVolData declares:
voxToSurfRAS() / surfRASToVox() build the canonical 4\u00d74 affines from the MGH Mdc direction- cosine matrix, spacing vector and c_ras centre, matching FreeSurfer's MRIxfmCRS2XYZtkreg() exactly (the same convention MNE-Python's _read_mri_info returns) so source-space and BEM tooling stay coordinate-compatible.voxelDataAsFloat() flattens the slice-of-slices representation back into the column-major x-fastest buffer that downstream resamplers and exporters expect, promoting UCHAR / SHORT / INT inputs to float on the fly.read() inspects the path suffix and dispatches to MriMghIO (.mgh / .mgz), MriNiftiIO (.nii / .nii.gz), or the COR directory loader, giving callers a single "load whatever this is" entry point. Definition in file mri_vol_data.cpp.