v2.0.0
Loading...
Searching...
No Matches
UTILSLIB::SurfaceLaplacian Class Reference

Surface Laplacian / Current Source Density (CSD) transformation. More...

#include <surface_laplacian.h>

Static Public Member Functions

static SurfaceLaplacianResult compute (const Eigen::MatrixXd &matData, const Eigen::MatrixX3d &matPositions, double dLambda2=1e-5, int iStiffness=4, int iNLegendreTerms=50, double dSphereRadius=-1.0)
static Eigen::MatrixXd computeTransform (const Eigen::MatrixX3d &matPositions, double dLambda2=1e-5, int iStiffness=4, int iNLegendreTerms=50, double dSphereRadius=-1.0)

Detailed Description

Surface Laplacian / Current Source Density (CSD) transformation.

Computes a reference-free spatial Laplacian of EEG data using spherical spline interpolation (Perrin et al. 1989). This improves spatial resolution by acting as a high-pass spatial filter that enhances local sources and attenuates volume-conducted far-field activity.

Eigen::MatrixX3d pos = ...; // EEG electrode positions (n_ch × 3)
Eigen::MatrixXd data = ...; // EEG data (n_ch × n_times)
auto result = SurfaceLaplacian::compute(data, pos);
// result.matData → CSD-transformed data
// result.matTransform → n_ch × n_ch transformation matrix
static SurfaceLaplacianResult compute(const Eigen::MatrixXd &matData, const Eigen::MatrixX3d &matPositions, double dLambda2=1e-5, int iStiffness=4, int iNLegendreTerms=50, double dSphereRadius=-1.0)

Definition at line 76 of file surface_laplacian.h.

Member Function Documentation

◆ compute()

SurfaceLaplacianResult SurfaceLaplacian::compute ( const Eigen::MatrixXd & matData,
const Eigen::MatrixX3d & matPositions,
double dLambda2 = 1e-5,
int iStiffness = 4,
int iNLegendreTerms = 50,
double dSphereRadius = -1.0 )
static

Compute the surface Laplacian (CSD) transformation.

Parameters
[in]matDataEEG data matrix (n_channels × n_times).
[in]matPositionsElectrode positions in 3D (n_channels × 3), in head coordinates.
[in]dLambda2Regularization parameter (default 1e-5).
[in]iStiffnessSpline stiffness parameter (default 4).
[in]iNLegendreTermsNumber of Legendre terms to evaluate (default 50).
[in]dSphereRadiusSphere radius in metres; if <= 0, fitted from positions (default -1).
Returns
SurfaceLaplacianResult with transformed data and transform matrix.

Definition at line 218 of file surface_laplacian.cpp.

◆ computeTransform()

MatrixXd SurfaceLaplacian::computeTransform ( const Eigen::MatrixX3d & matPositions,
double dLambda2 = 1e-5,
int iStiffness = 4,
int iNLegendreTerms = 50,
double dSphereRadius = -1.0 )
static

Compute only the CSD transformation matrix (without applying to data).

Parameters
[in]matPositionsElectrode positions in 3D (n_channels × 3).
[in]dLambda2Regularization parameter (default 1e-5).
[in]iStiffnessSpline stiffness parameter (default 4).
[in]iNLegendreTermsNumber of Legendre terms (default 50).
[in]dSphereRadiusSphere radius; if <= 0, fitted from positions.
Returns
Transformation matrix (n_channels × n_channels).

Definition at line 141 of file surface_laplacian.cpp.


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