Skip to main content

MriSlice

Namespace: MRILIB  ·  Library: MRI Library

#include <mri/mri_vol_data.h>

struct MRILIB::MriSlice

Single 2D MRI slice (pixels + slice→RAS transform) used as the volume's storage unit.

Mirrors the on-disk FIFFB_MRI_SLICE record so that round-tripping through COR.fif is lossless: each slice owns its pixel buffer in the source's native FIFFV_MRI_PIXEL_BYTE / _WORD / _FLOAT encoding, its width/height in pixels and millimetres, and an explicit FiffCoordTrans mapping slice (column, row) to MRI surface RAS. The slicing pipeline and the COR.fif writer consume slices directly every format-specific loader (MGH, NIfTI, raw COR) builds its volume as a vector of these.

Ported from mriSliceRec in the original MNE C mne_make_cor_set.

src/examples/ex_mri/main.cpp
QVector<MriSlice> corSlices;
MriCorIO::read(corDir, corSlices);

Public Methods​

MriSlice()​

Default constructor.


Example​

Used in examples​

ex_mri​

MRI library: MGH/MGZ and NIfTI volumes, voxel/RAS transforms, slicing and COR sets.

src/examples/ex_mri/main.cpp, line 139
QVector<MriSlice> corSlices;
MriCorIO::read(corDir, corSlices);
ok &= expect(corSlices.size() == 256 && corSlices[7].pixels.size() == 256 * 256 && corSlices[7].pixels[0] == 7,
QString("COR set: %1 slices of 256x256, slice 7 holds 7").arg(corSlices.size()));

Authors of this file​