Skip to main content

FsSurfaceSet

Namespace: FSLIB  ·  Library: FreeSurfer Library

#include <fs/fs_surfaceset.h>

class FSLIB::FsSurfaceSet

Container holding the lh and/or rh FsSurface for one subject and one surface kind.

The set is keyed on the hemisphere id (0 = lh, 1 = rh) so callers can do set[0] / set[1] or iterate over set.data(). All member surfaces are loaded with the same surf name (e.g. pial), so the set is homogeneous across hemispheres and stays aligned with a paired FsAnnotationSet sharing the same vertex indexing.

src/examples/ex_fs/main.cpp
FsSurfaceSet both("sample", 2, "white", subjectsDir); // 2 = both hemispheres

Public Methods​

FsSurfaceSet()​

Default constructor.


FsSurfaceSet(subject_id, hemi, surf, 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}.

  • surf : const QString & Name of the surface to load (eg. inflated, orig ...).

  • subjects_dir : const QString & Subjects directory.


FsSurfaceSet(path, hemi, surf)​

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}.

  • surf : const QString & Name of the surface to load (eg. inflated, orig ...).


FsSurfaceSet(p_LHSurface, p_RHSurface)​

Constructs a surface set by assembling given surfaces.

Parameters:

  • p_LHSurface : const FsSurface & Left hemisphere surface.

  • p_RHSurface : const FsSurface & Right hemisphere surface.


FsSurfaceSet(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.


~FsSurfaceSet()​

Destroys the FsSurfaceSet class.


clear()​

Initializes the FsAnnotationSet.


data()​

Returns The surface set map.

Returns:

  • QMap< qint32, FsSurface > & — the surface set map.

isEmpty()​

True if FsSurfaceSet is empty.

Returns:


insert(p_Surface)​

Insert a surface.

Parameters:


surf()​

The kind of Surfaces which are held by the FsSurfaceSet (eg.

inflated, orig ...)

Returns:

  • QString — the loaded surfaces (eg. inflated, orig ...).

operator[](idx)​

Subscript operator [] to access surface by index.

Parameters:

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

Returns:


operator[](idx)​

Subscript operator [] to access surface by index.

Parameters:

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

Returns:


operator[](idt)​

Subscript operator [] to access surface by identifier.

Parameters:

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

Returns:


operator[](idt)​

Subscript operator [] to access surface 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_SurfaceSet)​

Reads different surface files and assembles them to a FsSurfaceSet.

Parameters:

  • p_sLHFileName : const QString & Left hemisphere surface file.

  • p_sRHFileName : const QString & Right hemisphere surface file.

  • p_SurfaceSet : FsSurfaceSet & The read surface set.

Returns:

  • bool — true if succesfull, false otherwise.

Example​

Used in examples​

ex_fs_surface​

Example of an FreeSurfer FsSurface application.

src/examples/ex_fs_surface/main.cpp, line 81
//
// pial
//
FsSurfaceSet tSurfSetPial(subject, hemi, "pial", subjectPath);

ex_fs​

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

src/examples/ex_fs/main.cpp, line 124
FsSurfaceSet both("sample", 2, "white", subjectsDir); // 2 = both hemispheres
ok &= expect(both.size() == 2 && both[0].rr().rows() == 155407, QString("FsSurfaceSet holds %1 hemispheres").arg(both.size()));

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));

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

Authors of this file​