Skip to main content

FsAnnotationSet

Namespace: FSLIB  ·  Library: FreeSurfer Library

#include <fs/fs_annotationset.h>

class FSLIB::FsAnnotationSet

Container holding the lh and/or rh FsAnnotation for one parcellation atlas.

Keyed on hemisphere id (0 = lh, 1 = rh). When loaded from a single atlas name both hemispheres share the same colortable layout, so cross-hemisphere region lookup is consistent. The set is intended to be aligned one-to-one with an FsSurfaceSet sharing the same subject and vertex count per hemisphere.

src/examples/ex_fs/main.cpp
FsAnnotationSet parcellation("sample", 2, "aparc", subjectsDir);

Public Methods​

FsAnnotationSet()​

Default constructor.


FsAnnotationSet(subject_id, hemi, atlas, subjects_dir)​

Construts the surface set by reading it of the given files.

Parameters:

  • subject_id : const QString & Name of subject.

  • hemi : qint32 Which hemisphere to load {0 -> lh, 1 -> rh, 2 -> both}.

  • atlas : const QString & Name of the atlas to load (eg. aparc.a2009s, aparc, aparc.DKTatlas40, BA, BA.thresh, ...).

  • subjects_dir : const QString & Subjects directory.


FsAnnotationSet(path, hemi, atlas)​

Construts the surface set by reading it of the given files.

Parameters:

  • path : const QString & path to surface directory.

  • hemi : qint32 Which hemisphere to load {0 -> lh, 1 -> rh, 2 -> both}.

  • atlas : const QString & Name of the atlas to load (eg. aparc.a2009s, aparc, aparc.DKTatlas40, BA, BA.thresh, ...).


FsAnnotationSet(p_LHAnnotation, p_RHAnnotation)​

Constructs an annotation set by assembling given annotations.

Parameters:

  • p_LHAnnotation : const FsAnnotation & Left hemisphere annotation.

  • p_RHAnnotation : const FsAnnotation & Right hemisphere annotation.


FsAnnotationSet(p_sLHFileName, p_sRHFileName)​

Constructs an annotation set by reading from annotation files.

Parameters:

  • p_sLHFileName : const QString & Left hemisphere annotation file.

  • p_sRHFileName : const QString & Right hemisphere annotation file.


~FsAnnotationSet()​

Destroys the annotation set.


clear()​

Initializes the FsAnnotationSet.


data()​

Returns The FsAnnotation set map.

Returns:

  • QMap< qint32, FsAnnotation > & — the annotation set map.

isEmpty()​

True if FsAnnotationSet is empty.

Returns:


insert(p_Annotation)​

Insert an annotation.

Parameters:


toLabels(p_surfSet, p_qListLabels, p_qListLabelRGBAs, lLabelPicks)​

python labels_from_parc

Converts annotation to a label list and colortable

Parameters:

  • p_surfSet : const FsSurfaceSet & the FsSurfaceSet to read the vertex positions from.

  • p_qListLabels : QList< FsLabel > & the converted labels are appended to a given list. Stored data are not affected.

  • p_qListLabelRGBAs : QList< Eigen::RowVector4i > & the converted label RGBAs are appended to a given list. Stored data are not affected.

  • lLabelPicks : const QStringList & the label names which should be picked.

Returns:

  • bool — true if successful, false otherwise.

operator[](idx)​

Subscript operator [] to access annotation by index.

Parameters:

  • idx : qint32 the hemisphere index (0 or 1).

Returns:


operator[](idx)​

Subscript operator [] to access annotation by index.

Parameters:

  • idx : qint32 the hemisphere index (0 or 1).

Returns:


operator[](idt)​

Subscript operator [] to access annotation by identifier.

Parameters:

  • idt : QString the hemisphere identifier ("lh" or "rh").

Returns:


operator[](idt)​

Subscript operator [] to access annotation by identifier.

Parameters:

  • idt : QString the hemisphere identifier ("lh" or "rh").

Returns:


size()​

Returns number of loaded hemispheres.

Returns:

  • qint32 — number of loaded hemispheres.

Static Methods​

read(p_sLHFileName, p_sRHFileName, p_AnnotationSet)​

Reads different annotation files and assembles them to a FsAnnotationSet.

Parameters:

  • p_sLHFileName : const QString & Left hemisphere annotation file.

  • p_sRHFileName : const QString & Right hemisphere annotation file.

  • p_AnnotationSet : FsAnnotationSet & The read annotation set.

Returns:

  • bool — true if succesfull, false otherwise.

Example​

Used in examples​

ex_fs​

FreeSurfer library: surfaces, curvature, parcellations, labels and an atlas volume.

src/examples/ex_fs/main.cpp, line 148
FsAnnotationSet parcellation("sample", 2, "aparc", subjectsDir);
ok &= expect(parcellation.size() == 2, "FsAnnotationSet holds both hemispheres");

ex_clustered_inverse_mne​

Example of a Clustered Inverse Minimum Norm Estimation application.

src/examples/ex_clustered_inverse_mne/main.cpp, line 126
FsSurfaceSet t_surfSet(parser.value(subjectOption), parser.value(hemiOption).toInt(), parser.value(surfOption), parser.value(subjectPathOption));
FsAnnotationSet t_annotationSet(parser.value(subjectOption), parser.value(hemiOption).toInt(), parser.value(annotOption), parser.value(subjectPathOption));

ex_clustered_inverse_mne_raw​

Example of the computation of a clustered inverse mne raw.

src/examples/ex_clustered_inverse_mne_raw/main.cpp, line 139
FsSurfaceSet t_surfSet(parser.value(subjectOption), parser.value(hemiOption).toInt(), parser.value(surfOption), parser.value(subjectPathOption));
FsAnnotationSet t_annotationSet(parser.value(subjectOption), parser.value(hemiOption).toInt(), parser.value(annotOption), parser.value(subjectPathOption));

Also used in ex_clustered_inverse_pwl_rap_music_raw, ex_clustered_inverse_rap_music_raw, ex_connectivity, ex_connectivity_comparison, ex_disp_3D, ex_histogram, ex_inv_api, ex_inverse_mne_raw, ex_inverse_pwl_rap_music, ex_inverse_rap_music, ex_read_fwd, ex_read_fwd_disp_3D, ex_roi_clustered_inverse_pwl_rap_music, ex_st_clustered_inverse_pwl_rap_music.

Authors of this file​