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

MRI volume and coordinate-system I/O (volumes, voxel geometry, transforms). More...

Classes

class  MriCorFifIO
 COR.fif FIFF file writer. More...
class  MriCorIO
 FreeSurfer COR slice file reader. More...
class  MriMghIO
 FreeSurfer MGH/MGZ file reader. More...
struct  MriSliceImage
 Extracted MRI slice image. More...
class  MriSlicer
 MRI volume slicer. More...
struct  MriSlice
 Single MRI slice data. More...
class  MriVolData
 MRI volume data from FreeSurfer MGH/MGZ file. 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

MRI volume and coordinate-system I/O (volumes, voxel geometry, transforms).

Enumeration Type Documentation

◆ SliceOrientation

enum class MRILIB::SliceOrientation
strong

Slice orientation for orthogonal MRI volume slicing.

Enumerator
Axial 
Coronal 
Sagittal 

Definition at line 72 of file mri_slicer.h.

Function Documentation

◆ buildDateTime()

const char * MRILIB::buildDateTime ( )

Returns the build date and time.

Definition at line 45 of file mri_global.cpp.

◆ buildHash()

const char * MRILIB::buildHash ( )

Returns the short git hash.

Definition at line 46 of file mri_global.cpp.

◆ buildHashLong()

const char * MRILIB::buildHashLong ( )

Returns the long git hash.

Definition at line 47 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 142 of file mri_types.h.

◆ COR_NSLICE

int MRILIB::COR_NSLICE = 256
constexpr

Number of COR slices.

Definition at line 140 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 143 of file mri_types.h.

◆ COR_WIDTH

int MRILIB::COR_WIDTH = 256
constexpr

Width of each COR slice in pixels.

Definition at line 141 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 126 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 125 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 124 of file mri_types.h.

◆ MRI_ALL_FRAMES

int MRILIB::MRI_ALL_FRAMES = -1
constexpr

Load all frames.

Definition at line 91 of file mri_types.h.

◆ MRI_BITMAP

int MRILIB::MRI_BITMAP = 5
constexpr

Bitmap (unused in practice).

Definition at line 80 of file mri_types.h.

◆ MRI_FLOAT

int MRILIB::MRI_FLOAT = 3
constexpr

32-bit float.

Definition at line 78 of file mri_types.h.

◆ MRI_INT

int MRILIB::MRI_INT = 1
constexpr

Signed 32-bit integer.

Definition at line 76 of file mri_types.h.

◆ MRI_LONG

int MRILIB::MRI_LONG = 2
constexpr

Long integer (unused in practice).

Definition at line 77 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 107 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 110 of file mri_types.h.

◆ MRI_MGH_VERSION

int MRILIB::MRI_MGH_VERSION = 1
constexpr

Current MGH file format version.

Definition at line 57 of file mri_types.h.

◆ MRI_NO_FRAMES

int MRILIB::MRI_NO_FRAMES = -2
constexpr

Do not load data at all.

Definition at line 92 of file mri_types.h.

◆ MRI_SHORT

int MRILIB::MRI_SHORT = 4
constexpr

Signed 16-bit short.

Definition at line 79 of file mri_types.h.

◆ MRI_TENSOR

int MRILIB::MRI_TENSOR = 6
constexpr

Tensor (unused in practice).

Definition at line 81 of file mri_types.h.

◆ MRI_UCHAR

int MRILIB::MRI_UCHAR = 0
constexpr

Unsigned char (8-bit).

Definition at line 75 of file mri_types.h.