BST-2-ZI Plugin: Advanced EEG Source Imaging
- BST-2-ZI Plugin is a MATLAB-based tool integrating Brainstorm with Zeffiro Interface for high-fidelity, multi-compartment EEG source imaging.
- It generates tetrahedral finite element models with variable resolution and applies a complete electrode model to handle both invasive and non-invasive EEG data.
- The plugin enhances deep brain source localization by combining stereo-EEG and scalp-EEG data within a unified, automated computational pipeline.
The BST-2-ZI Plugin is a MATLAB-based software tool that integrates Brainstorm (BST) with Zeffiro Interface (ZI), enabling high-fidelity, multi-compartment finite element modeling for electroencephalography (EEG) source imaging workflows with an explicit focus on stereotactic EEG (stereo-EEG). It automates the transfer of anatomical segmentations and parcellation atlases from BST into ZI, supporting tetrahedral mesh generation at variable spatial resolutions and implementing the complete electrode model (CEM) for both invasive and non-invasive electrode configurations. This pipeline encompasses all stages from MRI-based tissue segmentation to forward and inverse modeling of EEG data, facilitating anatomically accurate source localization, particularly for deep brain structures using combined stereo-EEG and scalp electrode configurations (Prieto et al., 31 Jan 2026).
1. Plugin Structure and Data Processing Pipeline
The BST-2-ZI Plugin comprises a MATLAB package deployed within the ZI software environment, specifically within the directory structure +utilities/+brainstorm2zef/. The core components include a settings file, zef_bst_default.m, which houses experimental defaults such as protocol name, compartment labeling, mesh resolution, and contact impedance specification, and a run script, zef_bst_plugin_start.m, which orchestrates the data flow.
The data transfer sequence is governed as follows:
- Users select a Brainstorm protocol (e.g., ICBM152 template), then invoke the plugin via the BST GUI or MATLAB command line.
- A modal GUI solicits user choices (settings file, run mode), with three operation modes: 'Fresh start' (direct export), 'Import compartments' (reuse precomputed meshes), or 'Use project' (open existing ZI project).
- The plugin parses BST's surface reconstructions, accessible as structured arrays (
bstScout(i).Name,bstScout(i).Surface,bstScout(i).Faces). - Voxel-based atlases are surface-converted using BST's mesh processing utilities and inscribed into ZI's compartment table.
- The plugin launches ZI's meshing APIs, resulting in a comprehensive tetrahedral FE mesh (Prieto et al., 31 Jan 2026).
2. Multi-Compartment Finite Element Model Generation
The FE mesh construction initializes from a set of closed, triangular surface representations , each corresponding to a distinct anatomical compartment or parcellation unit. Any unlabeled volume is filled with an envelope compartment (default conductivity: 0.33 S/m).
Resolution control is set in the settings file:
- Base element size: 0.6 mm
- Regions proximal to stereo-EEG probes: refined to 0.3 mm
Tissue compartments receive scalar, isotropic conductivities:
- WM: 0.14 S/m; GM: 0.33 S/m; CSF: 1.79 S/m; compact skull: 0.0064 S/m; spongy skull: 0.028 S/m; scalp: 0.43 S/m; eyes: 1.5 S/m; blood: 0.7 S/m; muscle: 0.33 S/m; probe: S/m; probe encapsulation: 0.33 S/m.
The conductivity at position is expressed as: with the characteristic function of compartment (Prieto et al., 31 Jan 2026).
3. Complete Electrode Model (CEM) Formulation
CEM provides a rigorous boundary treatment for both electrode types:
- No-flux outside electrodes: ,
- Net zero current per electrode:
- Electrode-skin interface jump: with (total impedance).
In weak form, the system searches for : where is any test function (Prieto et al., 31 Jan 2026).
4. Forward Problem and Lead-Field Matrix Computation
The forward modeling is governed by the PDE:
Finite element discretization employs basis expansions: with system assembly in block form:
Coefficient matrices are constructed via standard FE/ZI routines (assembleMass, assembleStiffness, assembleCEM). The empirical EEG/SEEG data are related to the sources by the lead-field operator:
where is the referencing operator (Prieto et al., 31 Jan 2026).
5. Inverse Methods and Source Localization
The BST-2-ZI workflow supports multiple inverse solutions:
- Minimum-Norm Estimate (MNE):
- sLORETA: Applies noise-normalized MNE.
- Dipole Scan: Location-wise optimization.
- Scalar Unit-Noise-Gain Beamformer (sUNGB):
These methods leverage the anatomical specificity and variable lead-field sensitivity delivered by the FE/CEM-based forward models (Prieto et al., 31 Jan 2026).
6. Numerical Simulation Protocols and Empirical Results
Experiments employ BST’s ICBM152 template with Desikan–Killiany and Aseg atlases, constituting 116 tissue compartments. Scalp electrode arrays (72 contacts, 10–20 system, ring geometry, ) and a Medtronic 3389-like stereo-EEG probe (1.27 mm diameter, four 1.5 mm contacts, 0.5 mm spacing, 0.5 mm encapsulation, ) are modeled within a mesh of 18.7 million nodes and 91.8 million tetrahedra (base size: 0.6 mm; probe regions: 0.3 mm).
Synthetic sources comprise a single dipole within the left thalamic VPN nucleus, 16 mm from probe tip, with varying orientations (parallel/perpendicular to probe axis). Reconstructions are performed under additive white noise (SNR = 30 dB), contrasting scalp-EEG alone with joint scalp- and stereo-EEG arrays.
Key findings:
- Stereo-EEG lead-field volumes exhibit strong localization near the probe, in contrast to diffuse sensitivity in scalp-EEG.
- Incorporating probe contacts significantly sharpens source focus in the VPN nucleus.
- Dipole orientation impacts localization, with parallel orientations yielding greater accuracy.
- The sUNGB method yields the most concentrated reconstructions and is comparatively resistant to orientation variability.
These results indicate that BST-2-ZI enables anatomically precise multi-compartment CEM modeling, supporting source localization enhancement—especially within deep brain regions—by combining invasive and non-invasive EEG acquisition (Prieto et al., 31 Jan 2026).