v2.0.0
Loading...
Searching...
No Matches
INVLIB::InvLabelTimeCourse Class Reference

Extract ROI-level time courses from vertex-level source estimates. More...

#include <inv_label_time_course.h>

Static Public Member Functions

static Eigen::MatrixXd extract (const InvSourceEstimate &stc, const QList< FSLIB::FsLabel > &labels, const QString &sMode="mean_flip", bool bAllowEmpty=false)
static Eigen::VectorXd computeSignFlip (const Eigen::MatrixXd &stcData)

Detailed Description

Extract ROI-level time courses from vertex-level source estimates.

Provides the five standard aggregation modes used in MNE-Python's extract_label_time_course():

  • mean: Simple average across vertices in the label.
  • mean_flip: Mean with sign-flip so that dominant orientation is positive.
  • pca_flip: First PCA component, flipped to align with dominant sign.
  • max: Maximum absolute value at each time point.
  • auto: mean_flip for scalar STCs.
QList<FSLIB::FsLabel> labels = ...;
Eigen::MatrixXd tc = InvLabelTimeCourse::extract(stc, labels, "mean_flip");
// tc: n_labels × n_times
static Eigen::MatrixXd extract(const InvSourceEstimate &stc, const QList< FSLIB::FsLabel > &labels, const QString &sMode="mean_flip", bool bAllowEmpty=false)
Source-space inverse-solution container with dense grid plus optional focal-dipole,...

Definition at line 73 of file inv_label_time_course.h.

Member Function Documentation

◆ computeSignFlip()

VectorXd InvLabelTimeCourse::computeSignFlip ( const Eigen::MatrixXd & stcData)
static

Compute sign-flip vector for a label based on vertex normals.

For surface source spaces, the sign of each vertex's contribution should be flipped if its normal opposes the dominant direction in the label. This ensures coherent averaging.

Parameters
[in]stcDataSource data for the label vertices (n_verts × n_times).
Returns
Sign vector (+1 or -1 per vertex).

Definition at line 60 of file inv_label_time_course.cpp.

◆ extract()

MatrixXd InvLabelTimeCourse::extract ( const InvSourceEstimate & stc,
const QList< FSLIB::FsLabel > & labels,
const QString & sMode = "mean_flip",
bool bAllowEmpty = false )
static

Extract label time courses from a source estimate.

Parameters
[in]stcSource estimate (vertices × times).
[in]labelsList of labels defining ROIs.
[in]sModeAggregation mode: "mean", "mean_flip", "pca_flip", "max", "auto".
[in]bAllowEmptyIf true, empty labels produce zero rows; if false, skip them.
Returns
Matrix of shape (n_labels × n_times).

Definition at line 80 of file inv_label_time_course.cpp.


The documentation for this class was generated from the following files: