v2.0.0
Loading...
Searching...
No Matches
mri_slicer.cpp File Reference

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>
Include dependency graph for mri_slicer.cpp:

Go to the source code of this file.

Detailed Description

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

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.0
Date
April 2026

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.