Orthogonal-plane resampler that turns a 3D MriVolData into the 2D textures consumed by the slice viewer. More...


Go to the source code of this file.
Classes | |
| struct | MRILIB::MriSliceImage |
| Single 2D MRI cross-section produced by MriSlicer (pixel buffer + RAS metadata). More... | |
| class | MRILIB::MriSlicer |
| Orthogonal-plane resampler (axial / coronal / sagittal) from MriVolData to MriSliceImage. More... | |
Namespaces | |
| namespace | MRILIB |
| Volume I/O, voxel geometry and slice resampling for structural MRI data inside mne-cpp. | |
Enumerations | |
| enum class | MRILIB::SliceOrientation { MRILIB::Axial , MRILIB::Coronal , MRILIB::Sagittal } |
Orthogonal-plane resampler that turns a 3D MriVolData into the 2D textures consumed by the slice viewer.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
The slicer is the bridge between the format-specific MRI readers (MriMghIO, MriNiftiIO, MriCorIO) and the MriSlicesPlugin / MriSlicesView widgets that render axial / coronal / sagittal cross-sections in mne_analyze_studio. Two cooperating types live here:
Eigen::MatrixXf pixel buffer ready to upload as an OpenGL texture, paired with its own slice-to-RAS 4\u00d74 transform so the viewer can overlay surface meshes, source estimates or fiducials in the correct world space without re-deriving the geometry from the volume header.The static MriSlicer::extract() method does the actual work: it picks the right axis stride from the volume header, dispatches by on-disk voxel type (UCHAR / SHORT / INT / FLOAT) so quantisation matches the source, normalises by the per-volume max so windowing stays stable across slices, and composes sliceToRas from the volume's voxToSurfRAS() pre-multiplied by the orientation-specific in-slice affine.
Definition in file mri_slicer.h.