read_freesurfer_annot: Read Freesurfer Annotation File

View source: R/IO.R

read_freesurfer_annotR Documentation

Read Freesurfer Annotation File

Description

Reads a Freesurfer annotation file and creates a LabeledNeuroSurface object.

Usage

read_freesurfer_annot(file_name, geometry)

Arguments

file_name

Character string; path to the '.annot' file

geometry

A SurfaceGeometry object representing the surface structure

Details

This function reads binary data from a FreeSurfer annotation file, which includes vertex labels, color information, and label names. It then constructs a LabeledNeuroSurface object using this information along with the provided surface geometry.

Value

A LabeledNeuroSurface object containing:

indices

Integer vector of vertex indices

data

Numeric vector of label codes

labels

Character vector of label names

cols

Character vector of label colors in hex format

Examples


geom <- readSurfaceGeometry("path/to/surface.gii")
labeled_surface <- read_freesurfer_annot("path/to/labels.annot", geom)



bbuchsbaum/neurosurf documentation built on June 10, 2025, 8:22 p.m.