v2.0.0
Loading...
Searching...
No Matches
MRILIB Namespace Reference

Volume I/O, voxel geometry and slice resampling for structural MRI data inside mne-cpp. More...

Classes

class  MriCorFifIO
 Stateless serialiser that turns an MriVolData into a FIFF MRI set (COR.fif). More...
class  MriCorIO
 Stateless reader for the FreeSurfer COR-NNN directory layout. More...
class  MriMghIO
 Stateless decoder for FreeSurfer MGH and MGZ volume containers. More...
class  MriNiftiIO
 Stateless decoder for NIfTI-1 single-file volumes (.nii and .nii.gz). More...
struct  MriSliceImage
 Single 2D MRI cross-section produced by MriSlicer (pixel buffer + RAS metadata). More...
class  MriSlicer
 Orthogonal-plane resampler (axial / coronal / sagittal) from MriVolData to MriSliceImage. More...
struct  MriSlice
 Single 2D MRI slice (pixels + slice→RAS transform) used as the volume's storage unit. More...
class  MriVolData
 Format-agnostic 3D MRI volume: header geometry, voxel buffer (as a vector of MriSlice), scan parameters and provenance. More...

Enumerations

enum class  SliceOrientation { Axial , Coronal , Sagittal }

Functions

const char * buildDateTime ()
const char * buildHash ()
const char * buildHashLong ()

Variables

MGH Format Version
constexpr int MRI_MGH_VERSION = 1
MGH Voxel Data Types

Data type codes for voxels in MGH/MGZ files. From FreeSurfer mri.h and MNE C mne_types_mne-c.h.

See: https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MghFormat "type: data type of the image buffer; can be one of the following: UCHAR, SHORT, INT, or FLOAT (specified as 0, 4, 1, or 3, respectively)"

constexpr int MRI_UCHAR = 0
constexpr int MRI_INT = 1
constexpr int MRI_LONG = 2
constexpr int MRI_FLOAT = 3
constexpr int MRI_SHORT = 4
constexpr int MRI_BITMAP = 5
constexpr int MRI_TENSOR = 6
Frame Loading Constants
constexpr int MRI_ALL_FRAMES = -1
constexpr int MRI_NO_FRAMES = -2
MGH Header Constants

Fixed offsets and sizes in the MGH file header. See: https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MghFormat

constexpr int MRI_MGH_DATA_OFFSET = 284
constexpr int MRI_MGH_HEADER_FIXED_SIZE = 30
MGH Footer Tag Types

Tag identifiers found in the MGH footer after the voxel data. From FreeSurfer tags.h.

constexpr int MGH_TAG_OLD_SURF_GEOM = 20
constexpr int MGH_TAG_OLD_MGH_XFORM = 30
constexpr int MGH_TAG_MGH_XFORM = 31
COR Slice Constants

Fixed dimensions for FreeSurfer COR slice files. COR files contain 256 coronal slices of 256×256 unsigned chars at 1mm isotropic.

constexpr int COR_NSLICE = 256
constexpr int COR_WIDTH = 256
constexpr int COR_HEIGHT = 256
constexpr float COR_PIXEL_SIZE = 1e-3f

Detailed Description

Volume I/O, voxel geometry and slice resampling for structural MRI data inside mne-cpp.

Hosts every public type that participates in loading a 3D MRI volume (MGH/MGZ, NIfTI-1, FreeSurfer COR), describing it in memory (MriVolData, MriSlice), resampling it onto an orthogonal viewing plane (MriSlicer, MriSliceImage) and re-serialising it through the FIFF MRI block hierarchy (MriCorFifIO).

Enumeration Type Documentation

◆ SliceOrientation

enum class MRILIB::SliceOrientation
strong

Slice orientation for orthogonal MRI volume slicing.

Enumerator
Axial 
Coronal 
Sagittal 

Definition at line 75 of file mri_slicer.h.

Function Documentation

◆ buildDateTime()

const char * MRILIB::buildDateTime ( )

Returns the build date and time.

Definition at line 30 of file mri_global.cpp.

◆ buildHash()

const char * MRILIB::buildHash ( )

Returns the short git hash.

Definition at line 31 of file mri_global.cpp.

◆ buildHashLong()

const char * MRILIB::buildHashLong ( )

Returns the long git hash.

Definition at line 32 of file mri_global.cpp.

Variable Documentation

◆ COR_HEIGHT

int MRILIB::COR_HEIGHT = 256
constexpr

Height of each COR slice in pixels.

Definition at line 135 of file mri_types.h.

◆ COR_NSLICE

int MRILIB::COR_NSLICE = 256
constexpr

Number of COR slices.

Definition at line 133 of file mri_types.h.

◆ COR_PIXEL_SIZE

float MRILIB::COR_PIXEL_SIZE = 1e-3f
constexpr

Pixel size for COR slices (1mm in meters).

Definition at line 136 of file mri_types.h.

◆ COR_WIDTH

int MRILIB::COR_WIDTH = 256
constexpr

Width of each COR slice in pixels.

Definition at line 134 of file mri_types.h.

◆ MGH_TAG_MGH_XFORM

int MRILIB::MGH_TAG_MGH_XFORM = 31
constexpr

MGH Talairach transform tag (contains path to .xfm file).

Definition at line 119 of file mri_types.h.

◆ MGH_TAG_OLD_MGH_XFORM

int MRILIB::MGH_TAG_OLD_MGH_XFORM = 30
constexpr

Old MGH transform tag.

Definition at line 118 of file mri_types.h.

◆ MGH_TAG_OLD_SURF_GEOM

int MRILIB::MGH_TAG_OLD_SURF_GEOM = 20
constexpr

Old surface geometry tag.

Definition at line 117 of file mri_types.h.

◆ MRI_ALL_FRAMES

int MRILIB::MRI_ALL_FRAMES = -1
constexpr

Load all frames.

Definition at line 84 of file mri_types.h.

◆ MRI_BITMAP

int MRILIB::MRI_BITMAP = 5
constexpr

Bitmap (unused in practice).

Definition at line 73 of file mri_types.h.

◆ MRI_FLOAT

int MRILIB::MRI_FLOAT = 3
constexpr

32-bit float.

Definition at line 71 of file mri_types.h.

◆ MRI_INT

int MRILIB::MRI_INT = 1
constexpr

Signed 32-bit integer.

Definition at line 69 of file mri_types.h.

◆ MRI_LONG

int MRILIB::MRI_LONG = 2
constexpr

Long integer (unused in practice).

Definition at line 70 of file mri_types.h.

◆ MRI_MGH_DATA_OFFSET

int MRILIB::MRI_MGH_DATA_OFFSET = 284
constexpr

Fixed byte offset where image data begins (bytes 0-283 are header).

Definition at line 100 of file mri_types.h.

◆ MRI_MGH_HEADER_FIXED_SIZE

int MRILIB::MRI_MGH_HEADER_FIXED_SIZE = 30
constexpr

Size of the fixed portion of the header (before RAS info).

Definition at line 103 of file mri_types.h.

◆ MRI_MGH_VERSION

int MRILIB::MRI_MGH_VERSION = 1
constexpr

Current MGH file format version.

Definition at line 50 of file mri_types.h.

◆ MRI_NO_FRAMES

int MRILIB::MRI_NO_FRAMES = -2
constexpr

Do not load data at all.

Definition at line 85 of file mri_types.h.

◆ MRI_SHORT

int MRILIB::MRI_SHORT = 4
constexpr

Signed 16-bit short.

Definition at line 72 of file mri_types.h.

◆ MRI_TENSOR

int MRILIB::MRI_TENSOR = 6
constexpr

Tensor (unused in practice).

Definition at line 74 of file mri_types.h.

◆ MRI_UCHAR

int MRILIB::MRI_UCHAR = 0
constexpr

Unsigned char (8-bit).

Definition at line 68 of file mri_types.h.