| name | geometric-brain-dynamics-mapping-v3 |
| description | Geometric Basis Functions (GBF) framework for noninvasive whole human brain dynamics mapping. Uses participant-specific eigenmodes from cortical surface to resolve inverse problem in EEG/MEG source imaging. Activation: brain dynamics, geometric basis functions, source imaging, EEG/MEG, cortical geometry. |
Geometric Brain Dynamics Mapping (GBF v3)
Overview
This skill implements the methodology from "A geometry aware framework enhances noninvasive mapping of whole human brain dynamics" (arXiv:2604.25592, April 2026). The framework provides a powerful anatomical constraint for electroencephalography (EEG) and magnetoencephalography (MEG) source imaging by embedding participant-specific Geometric Basis Functions (GBFs).
Core Innovation
Problem: Non-invasive electrophysiology lacks methods that accurately reconstruct whole-brain spatiotemporal dynamics while incorporating individual cortical geometry. Current source imaging is limited by simplistic or biologically implausible priors.
Solution: Geometric Basis Functions (GBFs) - eigenmodes derived from each individual's cortical surface that:
- Provide a powerful anatomical constraint
- Resolve the inverse problem with improved reconstruction fidelity
- Align source estimates with geometric organization of neural dynamics
- Yield high localization accuracy and capture fast spatiotemporal dynamics
Activation Keywords
- brain dynamics mapping
- geometric basis functions
- GBF
- EEG source imaging
- MEG source imaging
- cortical geometry
- eigenmodes
- noninvasive brain mapping
- inverse problem
- whole-brain dynamics
Methodology
Step 1: Cortical Surface Processing
Extract participant-specific cortical surface geometry from structural MRI.
def extract_cortical_surface(structural_mri):
"""
Extract cortical surface mesh from structural MRI.
Args:
structural_mri: T1-weighted anatomical scan
Returns:
vertices: Surface vertices [N, 3]
faces: Surface faces [M, 3]
"""
surfaces = reconstruct_surfaces(structural_mri)
pial = surfaces['pial']
white = surfaces['white']
vertices = (pial.vertices + white.vertices) / 2
faces = pial.faces
return vertices, faces
Step 2: Geometric Basis Function Computation
Compute eigenmodes of the cortical surface Laplacian.
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import eigsh
def compute_geometric_basis_functions(vertices, faces, n_modes=200):
"""
Compute Geometric Basis Functions (eigenmodes) from cortical surface.
Args:
vertices: Surface vertices [N, 3]
faces: Surface faces [M, 3]
n_modes: Number of eigenmodes to compute
Returns:
gbf: Geometric basis functions [N, n_modes]
eigenvalues: Corresponding eigenvalues [n_modes]
"""
L = compute_laplace_beltrami(vertices, faces)
M = compute_mass_matrix(vertices, faces)
eigenvalues, eigenvectors = eigsh(L, k=n_modes, M=M, sigma=0)
idx = np.argsort(eigenvalues)
eigenvalues = eigenvalues[idx]
gbf = eigenvectors[:, idx]
return gbf, eigenvalues
def compute_laplace_beltrami(vertices, faces):
"""
Compute discrete Laplace-Beltrami operator using cotangent weights.
"""
n_vertices = len(vertices)
L = csr_matrix((n_vertices, n_vertices))
for face in faces:
i, j, k = face
v_i, v_j, v_k = vertices[i], vertices[j], vertices[k]
e_ij = v_j - v_i
e_ik = v_k - v_i
e_jk = v_k - v_j
e_ji = -e_ij
e_ki = -e_ik
e_kj = -e_jk
cot_i = np.dot(e_ij, e_ik) / np.linalg.norm(np.cross(e_ij, e_ik))
cot_j = np.dot(e_ji, e_jk) / np.linalg.norm(np.cross(e_ji, e_jk))
cot_k = np.dot(e_ki, e_kj) / np.linalg.norm(np.cross(e_ki, e_kj))
L[i, j] -= cot_k /
L[i, k] -= cot_j /
L[j, i] -= cot_k /
L[j, k] -= cot_i /
L[k, i] -= cot_j /
L[k, j] -= cot_i /
L[i, i] += (cot_j + cot_k) /
L[j, j] += (cot_i + cot_k) /
L[k, k] += (cot_i + cot_j) /
L
Step 3: Source Reconstruction with GBF
Reconstruct neural sources as linear combinations of geometric basis functions.
class GBFSourceImaging:
"""
EEG/MEG source imaging using Geometric Basis Functions.
"""
def __init__(self, gbf, forward_model, lambda_reg=0.01):
"""
Initialize GBF source imaging.
Args:
gbf: Geometric basis functions [N_vertices, n_modes]
forward_model: Lead field matrix [N_sensors, N_vertices]
lambda_reg: Regularization parameter
"""
self.gbf = gbf
self.n_modes = gbf.shape[1]
self.A = forward_model @ gbf
self.lambda_reg = lambda_reg
def reconstruct_sources(self, eeg_data):
"""
Reconstruct neural source activity from EEG/MEG data.
Args:
eeg_data: Sensor data [N_sensors, N_times]
Returns:
source_activity: Source activity on cortical surface [N_vertices, N_times]
mode_activity: Mode coefficients [n_modes, N_times]
"""
n_times = eeg_data.shape[1]
AtA = self.A.T @ self.A
AtA_reg = AtA + self.lambda_reg * np.eye(self.n_modes)
mode_activity = np.linalg.solve(AtA_reg, self.A.T @ eeg_data)
source_activity = self.gbf @ mode_activity
return source_activity, mode_activity
Key Features
| Feature | Description | Benefit |
|---|
| Participant-Specific | Individual cortical geometry | Personalized precision |
| Geometric Constraint | Eigenmodes align with anatomy | Biologically plausible |
| Compact Representation | Hundreds of modes vs. thousands of vertices | Efficient computation |
| High Localization | Accurate spatial source localization | Better neuroscience insights |
| Fast Dynamics | Captures spatiotemporal patterns | Temporal resolution preserved |
| Anatomical Pathways | Consistent with white matter tracts | Validated connectivity |
Validation
The framework is validated across multiple paradigms:
- Meta-Source Benchmark: High localization accuracy
- Task-Evoked Data: Accurate stimulus-related activity
- Resting-State Networks: Captures spontaneous dynamics
- Intracranial Stimulation: Ground-truth validation
- Epilepsy Data: Clinical relevance demonstrated
Applications
1. Basic Neuroscience Research
gbf_imaging = GBFSourceImaging(gbf, forward_model)
source_activity, mode_activity = gbf_imaging.reconstruct_sources(eeg_data)
top_modes = analyze_mode_contributions(mode_activity, task_onsets)
2. Clinical Applications
seizure_sources = gbf_imaging.reconstruct_sources( seizure_eeg)
focal_activity = detect_seizure_onset(seizure_sources)
stimulation_map = validate_with_cortical_stimulation(stimulation_sites)
3. Brain-Computer Interfaces
bci_imager = GBFSourceImaging(gbf, forward_model, lambda_reg=0.001)
while bci_running:
eeg_chunk = acquire_eeg(n_samples=256)
sources, _ = bci_imager.reconstruct_sources(eeg_chunk)
features = extract_source_features(sources)
command = classifier.predict(features)
Workflow
Complete Pipeline
def gbf_source_imaging_pipeline(subject_id, eeg_file, mri_file):
"""
Complete GBF source imaging pipeline.
"""
raw_eeg = mne.io.read_raw_fif(eeg_file)
raw_eeg.filter(1, 40)
subjects_dir = os.environ['SUBJECTS_DIR']
vertices, faces = extract_cortical_surface_from_freesurfer(
subject_id, subjects_dir
)
gbf, eigenvalues = compute_geometric_basis_functions(
vertices, faces, n_modes=200
)
fwd = mne.make_forward_solution(
raw_eeg.info, trans, src, bem, eeg=True, meg=False
)
forward_model = fwd['sol']['data']
gbf_imaging = GBFSourceImaging(gbf, forward_model)
epochs = mne.Epochs(raw_eeg, events, event_id, tmin=-0.2, tmax=0.5)
evoked = epochs.average()
source_activity, mode_activity = gbf_imaging.reconstruct_sources(
evoked.data
)
return source_activity, mode_activity, gbf
Comparison with Traditional Methods
| Method | Spatial Resolution | Anatomical Plausibility | Computational Efficiency | Individual Variability |
|---|
| Minimum Norm | Low | Low | High | Not addressed |
| LORETA | Moderate | Moderate | Moderate | Not addressed |
| Beamformer | Moderate | Low | Moderate | Partial |
| GBF (Ours) | High | High | High | Fully Addressed |
Implementation Notes
Dependencies
pip install numpy scipy mne nibabel
Computational Considerations
- GBF Computation: ~1-2 minutes per subject (one-time)
- Source Reconstruction: Real-time capable (>100 Hz)
- Memory: ~500MB for 200 modes on dense surface (~150k vertices)
Hyperparameters
| Parameter | Default | Description |
|---|
n_modes | 200 | Number of geometric basis functions |
lambda_reg | 0.01 | Ridge regression regularization |
surface_density | 'ico5' | Cortical surface density |
Limitations
- Surface-Based: Does not model deep brain structures
- Linear Assumption: Assumes linear mixing of sources
- Stationary Forward Model: Does not account for head movement
- Computational Cost: GBF computation for dense surfaces
Future Directions
- Extension to subcortical structures
- Non-stationary forward modeling
- Multi-modal fusion (EEG + MEG + fMRI)
- Deep learning integration for mode selection
References
@article{wang2026geometry,
title={A geometry aware framework enhances noninvasive mapping of whole human brain dynamics},
author={Wang, Song and Lou, Kexin and Wei, Chen and Sheng, Zhiyuan and Tang, Jiahao and Peng, Kaining and Shen, Xinke and Mei, Shuhao and Chen, Liang and Gu, Dongfeng and Liu, Quanying},
journal={arXiv preprint arXiv:2604.25592},
year={2026}
}
Related Skills
brain-dit-fmri-foundation-model: Brain-DiT for fMRI modeling
meta-learning-in-context-brain-decoding-v5: Cross-subject brain decoding
neural-population-dynamics: Population-level neural dynamics analysis
eeg-brain-connectivity-bci: EEG connectivity analysis
Last updated: 2026-04-30
Paper: arXiv:2604.25592