Implementation of MRILIB::MriSlicer: per-orientation extraction with on-the-fly type promotion and per-volume normalisation. More...
#include "mri_slicer.h"#include "mri_vol_data.h"#include <Eigen/LU>#include <algorithm>#include <array>#include <cmath>
Go to the source code of this file.
Implementation of MRILIB::MriSlicer: per-orientation extraction with on-the-fly type promotion and per-volume normalisation.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
Implements the three jobs the header advertises: (1) pick the right axis stride from the volume's (dimX, dimY, dimZ) triple for the requested SliceOrientation; (2) iterate the voxel buffer in the on-disk type (UCHAR / SHORT / INT / FLOAT) and promote to the normalised Eigen::MatrixXf the viewer consumes — keeping the dispatch in one place so the four code paths stay byte-for-byte consistent; (3) compose the emitted sliceToRas as volume.voxToSurfRAS() * orientationAffine so any surface, source estimate or fiducial overlay placed in RAS lands in the right slice without recomputing the volume geometry.
Definition in file mri_slicer.cpp.