Reader for FreeSurfer per-vertex annotation (parcellation) files such as lh.aparc.annot. More...
#include "fs_global.h"#include "fs_colortable.h"#include <QString>#include <QSharedPointer>#include <Eigen/Core>

Go to the source code of this file.
Classes | |
| class | FSLIB::FsAnnotation |
| Single-hemisphere FreeSurfer parcellation: vertex → region label plus embedded colortable. More... | |
Namespaces | |
| namespace | FSLIB |
| FreeSurfer surface, annotation and parcellation I/O for mne-cpp. | |
Reader for FreeSurfer per-vertex annotation (parcellation) files such as lh.aparc.annot.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
A FreeSurfer .annot file assigns one parcellation label to each surface vertex and ships the colour-lookup table needed to render it. It is the output of mris_ca_label / mri_annotation2label and is produced by recon-all for every standard atlas (Desikan-Killiany aparc, Destrieux aparc.a2009s, aparc.DKTatlas40, Brodmann BA, …). The file is big-endian and has the layout:
int32 num_verticesnum_vertices × (int32 vertex_index, int32 packed_rgba_label)TAG_OLD_COLORTABLE / TAG_NEW_COLORTABLE block carrying the embedded colortable (struct names + RGBA), parsed into an FsColortableThe per-vertex label is the int32 obtained by packing R + (G ≪ 8) + (B ≪ 16) + (A ≪ 24) of the assigned region’s colortable entry; reverse mapping from packed value to colortable row yields the anatomical name. Format reference: utils/read_annotation.c in FreeSurfer.
This class loads one hemisphere; combine two instances via FsAnnotationSet for whole-brain parcellations.
Definition in file fs_annotation.h.