libfs
Header-only C++11 library for accessing FreeSurfer neuroimaging data
Public Member Functions | Public Attributes | List of all members
fs::Annot Struct Reference

An annotation, also known as a brain surface parcellation. Assigns to each vertex a region, identified by the region_label. The region name and color for each region can be found in the Colortable. More...

#include <libfs.h>

Collaboration diagram for fs::Annot:
Collaboration graph
[legend]

Public Member Functions

std::vector< int32_t > region_vertices (const std::string &region_name) const
 Get all vertices of a region given by name in the brain surface parcellation. Returns an integer vector, the vertex indices.
 
std::vector< int32_t > region_vertices (int32_t region_label) const
 Get all vertices of a region given by label in the brain surface parcellation. Returns an integer vector, the vertex indices.
 
std::vector< uint8_t > vertex_colors (bool alpha=false) const
 Get the vertex colors as an array of uchar values, 3 consecutive values are the red, green and blue channel values for a single vertex. More...
 
size_t num_vertices () const
 Get the number of vertices of this parcellation (or the associated surface). More...
 
std::vector< size_t > vertex_regions () const
 Compute the region indices in the Colortable for all vertices in this brain surface parcellation. With the region indices, it becomes very easy to obtain all region names, labels, and color channel values from the Colortable. More...
 
std::vector< std::string > vertex_region_names () const
 Compute the region names in the Colortable for all vertices in this brain surface parcellation.
 

Public Attributes

std::vector< int32_t > vertex_indices
 Indices of the vertices, these always go from 0 to N-1 (where N is the number of vertices in the respective surface/annotation). Not really needed.
 
std::vector< int32_t > vertex_labels
 The label code for each vertex, defining the region it belongs to. Check in the Colortable for a region that has this label.
 
Colortable colortable
 A Colortable defining the regions (most importantly, the region name and visualization color).
 

Detailed Description

An annotation, also known as a brain surface parcellation. Assigns to each vertex a region, identified by the region_label. The region name and color for each region can be found in the Colortable.

Member Function Documentation

◆ num_vertices()

size_t fs::Annot::num_vertices ( ) const
inline

Get the number of vertices of this parcellation (or the associated surface).

Exceptions
std::runtime_erroron invalid annot

◆ vertex_colors()

std::vector<uint8_t> fs::Annot::vertex_colors ( bool  alpha = false) const
inline

Get the vertex colors as an array of uchar values, 3 consecutive values are the red, green and blue channel values for a single vertex.

Parameters
alphawhether to include the alpha channel and return 4 values per vertex instead of 3.

◆ vertex_regions()

std::vector<size_t> fs::Annot::vertex_regions ( ) const
inline

Compute the region indices in the Colortable for all vertices in this brain surface parcellation. With the region indices, it becomes very easy to obtain all region names, labels, and color channel values from the Colortable.

See also
The function vertex_region_names uses this function to get the region names for all vertices.

The documentation for this struct was generated from the following file: