Core beamformer math. More...
#include <inv_beamformer_compute.h>
Static Public Member Functions | |
| static bool | computeBeamformer (const Eigen::MatrixXd &G, const Eigen::MatrixXd &Cm, double reg, int nOrient, BeamformerWeightNorm weightNorm, BeamformerPickOri pickOri, bool reduceRank, BeamformerInversion invMethod, const Eigen::MatrixX3d &nn, Eigen::MatrixXd &W, Eigen::MatrixX3d &maxPowerOri) |
| static Eigen::VectorXd | computePower (const Eigen::MatrixXd &Cm, const Eigen::MatrixXd &W, int nOrient) |
| static Eigen::MatrixXd | symMatPow (const Eigen::MatrixXd &X, double p, bool reduceRank=false) |
Core beamformer math.
Shared computation routines used by both LCMV and DICS beamformers.
All methods are static — no state is kept between calls.
Definition at line 75 of file inv_beamformer_compute.h.
|
static |
Compute beamformer spatial filter weights from a leadfield and data covariance (or CSD).
This implements the core LCMV/DICS algorithm:
| [in] | G | Leadfield matrix (n_channels, n_sources * n_orient). |
| [in] | Cm | Data covariance or CSD matrix (n_channels, n_channels). Real-valued. |
| [in] | reg | Regularization parameter (fraction of trace to add, e.g. 0.05). |
| [in] | nOrient | Orientations per source: 1 (fixed) or 3 (free). |
| [in] | weightNorm | Weight normalization strategy. |
| [in] | pickOri | Orientation selection mode. |
| [in] | reduceRank | If true, reduce leadfield rank by 1 (for MEG sphere models). |
| [in] | invMethod | Denominator inversion strategy (matrix or scalar). |
| [in] | nn | Source normals (n_sources, 3). Used for max-power sign alignment. |
| [out] | W | Output spatial filter weights (n_sources * n_orient_out, n_channels). |
| [out] | maxPowerOri | Output max-power orientations (n_sources, 3). Empty if not max-power. |
Definition at line 193 of file inv_beamformer_compute.cpp.
|
static |
Compute source power from spatial filter weights and a data covariance / CSD matrix.
power_i = trace(W_i Cm W_i^T)
| [in] | Cm | Data covariance or CSD (n_channels, n_channels). |
| [in] | W | Spatial filter weights (n_sources * n_orient, n_channels). |
| [in] | nOrient | Orientations per source. |
Definition at line 382 of file inv_beamformer_compute.cpp.
|
static |
Symmetric matrix power: X^p via eigendecomposition.
| [in] | X | Symmetric matrix. |
| [in] | p | Power exponent (e.g. -1, -0.5). |
| [in] | reduceRank | Drop smallest eigenvalue before exponentiating. |
Definition at line 157 of file inv_beamformer_compute.cpp.