v2.0.0
Loading...
Searching...
No Matches
mri_cor_io.h File Reference

Reader for the legacy FreeSurfer COR-NNN per-slice volume layout (256 unsigned-char coronal slices on a 1 mm isotropic grid). More...

#include "mri_global.h"
#include "mri_vol_data.h"
#include <QString>
#include <QVector>
Include dependency graph for mri_cor_io.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MRILIB::MriCorIO
 Stateless reader for the FreeSurfer COR-NNN directory layout. More...

Namespaces

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

Detailed Description

Reader for the legacy FreeSurfer COR-NNN per-slice volume layout (256 unsigned-char coronal slices on a 1 mm isotropic grid).

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.0.0
Date
February 2026

COR is the directory-based volume format used by FreeSurfer before MGH became the default. A subject's mri/T1 (and historically mri/orig, mri/brain, ...) directory contains 256 files named COR-001 through COR-256, each a flat 65 536-byte (256\u00d7256 unsigned char) coronal slice. While modern FreeSurfer prefers MGH, COR-format trees still appear in legacy subject directories and in mne-c tutorial data, so mne-cpp must read them to keep round-trip parity with the original MNE C tooling.

The reader fans the 256 files into an MriSlice vector with the canonical coronal-to-surface-RAS coordinate transform:

  • Origin offset (mm): (128, -128, 128)
  • Axis permutation: x \u2192 -x, y \u2192 z, z \u2192 y

which matches the convention emitted by make_cor_set() in the original mne_make_cor_set C tool and is what every downstream BEM / source-space builder in MNE-CPP expects.

Ported from make_cor_set() in MNE C mne_make_cor_set by Matti Hamalainen.

Definition in file mri_cor_io.h.