Skip to main content

This is a preprint.

It has not yet been peer reviewed by a journal.

The National Library of Medicine is running a pilot to include preprints that result from research funded by NIH in PMC and PubMed.

bioRxiv logoLink to bioRxiv
[Preprint]. 2025 Sep 18:2025.09.16.676602. [Version 1] doi: 10.1101/2025.09.16.676602

sEEG-Suite: An Interactive Pipeline for Semi-Automated Contact Localization and Anatomical Labeling with Brainstorm

Chinmay Chinara 1,*, Raymundo Cassani 2,*, Takfarinas Medani 1, Anand A Joshi 1, Samuel Medina Villalon 3,7, Yash S Vakilna 4,6, Johnson P Hampson 4, Kenneth Taylor 5, Francois Tadel 8, Dileep Nair 5, Christian G Bénar 3, Sylvain Baillet 2, John C Mosher 4, Richard M Leahy 1
PMCID: PMC12458114  PMID: 41000975

Summary

Stereoelectroencephalography (sEEG) is a critical tool for mapping epileptic networks in patients with drug-resistant epilepsy. Accurate localization and labeling of sEEG contacts are essential for identifying the seizure onset zone (SOZ) and ensuring optimal resective surgery. Traditional methods for localizing and labeling sEEG contacts rely on manual processing, which is prone to human error and variability. To address these challenges, we developed and integrated a semi-automatic sEEG contact localization and labeling pipeline within Brainstorm1, an open-source software platform for multimodal brain imaging analysis2-8, widely adopted in the neuroscience community with over 50,000 registered users and an active online user forum. The software has been supported by the National Institute of Health (NIH) for over two decades. The pipeline presented in this paper performs three key steps: (1) import and apply rigid co-registration of post-implantation Computed Tomography (CT) or post-CT with pre-implantation Magnetic Resonance Imaging (pre-MRI), (2) post-CT image segmentation and semi-automatic detection of sEEG contacts using GARDEL9, which has been integrated as a Brainstorm plugin, and (3) automatic anatomical labeling of contacts using standard and commonly used brain anatomy templates and atlases. Integrating this pipeline into Brainstorm brings the best of both worlds: GARDEL’s automation and Brainstorm’s multimodal data compatibility, and rich library of visualization and advanced analysis tools at both sensor and source level6. This sEEG-Suite tool facilitates reproducible research, supports clinical workflows, and accelerates sEEG-based investigations of invasive brain recordings.

Tutorials and Documentation:

Brainstorm offers a comprehensive collection of detailed tutorials that cover all major components of the platform, supporting users from basic data processing to advanced multimodal analyses. Within this ecosystem, the sEEG-suite is accompanied by its own dedicated tutorials, with each section of the suite linking to a corresponding resource. For convenience, the complete set of tutorials for stereo-electroencephalography (sEEG) analysis can be accessed here: sEEG-suite: Stereo-electroencephalography (sEEG) Analysis.

Figure 1 illustrates the complete end-to-end workflow for sEEG analysis in Brainstorm. The process begins with the acquisition of anatomical and implantation imaging, including both pre- and post-MRI and post-CT scans. The CT image is rigidly co-registered to the MRI to ensure alignment of anatomical and electrode information, after which skull stripping is applied to remove non-brain structures and CT artifacts. From the CT, an intensity thresholded isosurface is generated to identify candidate electrode contacts that will be used during the localization process. At this stage, Brainstorm offers two localization strategies: a manual interface that allows users to add/remove/merge/rename electrodes and add/remove contacts, and an automated localization procedure using GARDEL, which streamlines contact detection and reduces the need for extensive manual intervention. Once preliminary electrode positions are obtained, users can refine and correct them to generate a finalized set of electrode coordinates. These coordinates are then subjected to automated anatomical labeling, in which each contact is mapped to underlying cortical and subcortical structures based on atlas information derived from the MRI segmentation or provided from the different atlases available in Brainstorm. The localized and labeled electrode contacts can further be linked to the raw electrophysiological recordings, enabling Brainstorm to integrate anatomy with the corresponding time series data.

Figure 1:

Figure 1:

End-to-end flowchart for sEEG analysis in Brainstorm

Anatomy and preprocessing:

pre-MRI (Figure 2a) and post-CT (Figure 2b) scans are acquired for each subject. The post-CT volume is rigidly co-registered with the pre-MRI volume using the Statistical Parametric Mapping (SPM) or USC’s CT2MRI (available as a Brainstorm plugin) (Figure 2c). The pre-MRI serves as an anatomically grounded reference for subsequent processing. Specifically, the pre-MRI is used to perform skull-stripping of the post-CT using tissue segmentation obtained either by BrainSuite10 or SPM11 (using function mri_skullstrip.m), effectively removing extracranial tissues and eliminating artifacts associated with the sEEG electrode wire bundles (Figure 2d). The resulting artifact-free post-CT volume is then subjected to an automatic intensity thresholding to detect and extract metal artifacts, which are potential candidates for electrode contact localization (Figure 2e). More details can be found in the tutorial: CT to MRI co-registration.

Figure 2:

Figure 2:

(a) pre-MRI; (b) post-CT; (c) post-CT co-registered to pre-MRI and skull-stripped using SPM (the colored image is the post-CT overlaid on the pre-MRI to show their proper alignment); (d) Skull-stripped post-CT by itself; (e) Isosurface generated from skull-stripped post-CT using intensity thresholding to capture metal artifacts as candidate contacts

Manual contact localization:

Prior to localizing the electrode contacts, knowledge of the implantation scheme is required in order to have the correct naming convention (used by the center/neurosurgeons) for the various electrodes used. Brainstorm’s iEEG graphical panel allows creating an electrode implantation manually by first defining the electrode model and constructor (through a list of predefined uniformly spaced electrode models from various constructors, such as DIXI, PMT, etc, or users can choose to define and load their own model). The user can then set the electrode tip and skull entry to render the electrode (Figure 3). This process can be done in the 3D space (using the intensity thresholded mesh generated in the previous section), in the 2D MRI viewer (using the intensity thresholded post-CT overlaid on the pre-MRI), or only on post-MRI if the CT is not available. More details can be found in the tutorial: SEEG contact localization and labeling.

Figure 3:

Figure 3:

(a) Create an electrode and assign label to it (in red); (b) Define the electrode model (in red); (c) On the 3D figure (SEEG/3D: gardel), set the electrode tip (in blue) and skull entry (in orange) using the surface selection button (in red) to render the electrode both in 2D MRI viewer and 3D figure

Automatic contact localization:

With the click of a single button inside Brainstorm (Figure 4), we have live, interactive visualization of the detection process, enabling users to observe contact identification, grouping, and ordering in real time. The electrode names are automatically assigned from A-Z, AA-ZZ, etc., in the order they are detected, which can be renamed as desired during post-processing (Figure 5). On the button click, GARDEL uses the skull-stripped post-CT volume along with the intensity threshold to identify high-density regions corresponding to metallic artifacts that are considered as electrode contacts. These detected points are grouped into individual leads, with contacts sorted along each electrode trajectory, designating the deepest contact as the first in sequence. This integration reduces the need for manual contact detection and electrode indexing, significantly streamlining the localization workflow. More details can be found in the tutorial: Automatic SEEG Contact Localization using GARDEL.

Figure 4:

Figure 4:

The Brainstorm interface displaying the automatically detected contacts, with the GARDEL button (in orange) that triggers the automatic detection

Figure 5:

Figure 5:

Renaming electrode (a) Electrode A before renaming; (b) Brainstorm interface to rename the electrode (double click on electrode A and change name to AA’); (c) Electrode A renamed to AA’ (along with all the contacts)

Post-processing of the electrodes/contacts:

All the necessary post-processing can be done using the Brainstorm interface interactively. If there is a wrongly detected electrode, we can delete and manually rectify it by creating it from scratch (as mentioned in the Manual contact localization section above) along with renaming them if needed (Figure 5). There could be cases where a single electrode may be detected as multiple in which case we need to merge them as one (Figure 6). We also allow fine-tuning at the contact level, where we can add/remove them (Figure 7-8). On doing any of the editing operations, it is also ensured that the ordering of the contacts is maintained with the deepest contact as first in the sequence. More details can be found in the tutorial section: Edit the contacts positions.

Figure 6:

Figure 6:

Merging electrodes using the Brainstorm iEEG panel; (a) Electrodes I and J are wrongly detected as separate electrodes; (b) Brainstorm interface showing option for merging them; (c) The merged electrode in iEEG panel (I and J get replaced by Imerged); (d) The rendered merged electrode

Figure 7:

Figure 7:

Removing a contact using 3D figure; (a) Wrongly detected contact (selected contact C12 in red); (b) Brainstorm interface showing option for removing it (right click on the C12 contact to get this menu); (c) Contact removed

Figure 8:

Figure 8:

Adding a contact using 3D figure; (a) Missed detecting contact (3rd from top for electrode A in red); (b) Brainstorm interface showing option for adding it (turn on surface/centroid selection and select electrode A in iEEG panel, select the surface point and right click on it to get this menu); (c) Missing contact A3 added

Automated anatomical labeling:

Brainstorm supports multiple standardized brain anatomy templates (ICBM152, Colin27, USCBrain, FsAverage, etc.) and brain atlases (AAL, Desikan-Killiany, Brainetome, Schaefer, etc.), all of which can be added from the interface as shown in Figure 9(a-b). The spatial coordinates of contacts localized by the steps above are automatically cross-referenced against these atlases, resulting in detailed anatomical labels (e.g., specific cortical gyri, subcortical nuclei) as shown in Figure 9(c-d). This enriched labeling framework provides a comprehensive anatomical context for each contact (the region of the brain the contact belongs to), facilitating both clinical interpretation and research analyses. More details can be found in the tutorial section on anatomical labeling. Work by12 demonstrates a clinical validation study using this feature of Brainstorm.

Figure 9:

Figure 9:

(a) The different brain anatomy templates supported inside Brainstorm (b) The different brain atlases supported inside Brainstorm (c) Brainstorm interface to compute the anatomical labeling (in the iEEG panel select the electrode A, go to Electrodes > Compute atlas labels) (d) The computed anatomical labels for contacts in electrode boldA using the AAL3 atlas

Link to raw recordings:

Once the sEEG contacts have been localized, we can associate them with the corresponding raw electrophysiological recordings. This link ensures that anatomical localization can be directly tied to the recorded brain signals. To establish this connection, it is essential that the contact names match exactly with the channel names in the raw recordings. Any mismatch (such as differences in naming conventions, capitalization, or numbering) will prevent Brainstorm from aligning the contacts with the appropriate channels. Detailed instructions on how to perform this linking can be found in the tutorial section: Access the recordings. Following these guidelines ensures that each localized contact is correctly mapped to its electrophysiological data, allowing for reliable analysis and visualization. Once this step is completed, users can proceed either with the sEEG data analysis within Brainstorm using its rich and complete set of tools or export the final data into any of the supported formats for analysis with other software.

Statement of Need

Intracranial electrode localization, particularly for sEEG, is a foundational step in epilepsy surgery planning and neuroscience research. At present, many researchers and clinicians rely on manual workflows or a patchwork of separate tools for localization, which results in time-consuming procedures, inter-operator variability, and fragmented pipelines. Manual identification and labeling of electrode contacts can take several hours per subject, slowing down the workflows, while subjective differences between operators introduce inconsistencies in results. Moreover, existing practices often require multiple platforms, i.e., one for CT-MRI co-registration, another for electrode detection, and another for anatomical labeling, and another for data analysis, thereby adding unnecessary complexity and risk of errors in the final results.

Integrating GARDEL with Brainstorm provides seamless, one-click deployment of intracranial electrode localization directly within Brainstorm, eliminating the need for external scripts and reducing manual intervention. This reduces localization time from hours to minutes (with some minor post-processing), enabling researchers to efficiently scale analyses across larger patient cohorts. The integration also enhances reproducibility by standardizing detection parameters, minimizing manual intervention, and unifying the entire workflow of localization and labeling with the advanced analysis of electrophysiological data into a single interactive environment.

While other tools, such as DEETO13, FASCILE14, LeGUI15 and 3D Slicer’s sEEG Assistant16 have demonstrated dramatic speedups compared to manual localization, they do not provide an end-to-end processing workflow from anatomical to functional analyses like Brainstorm that does.

Acknowledgements

Research reported in this publication was supported by the National Institute of Biomedical Imaging and Bioengineering (NIBIB) of the National Institutes of Health (NIH) under award numbers R01EB026299 and RF1NS133972, DOD award HT94252310149.

References

  • 1.Tadel F, Baillet S, Mosher JC, Pantazis D, Leahy RM. Brainstorm: a user-friendly application for MEG/EEG analysis. Comput Intell Neurosci 2011;2011:879716. 10.1155/2011/879716. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Tadel F, Bock E, Niso G, Mosher JC, Cousineau M, Pantazis D, et al. MEG/EEG group analysis with Brainstorm. Front Neurosci 2019;13:76. 10.3389/fnins.2019.00076. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Niso G, Tadel F, Bock E, Cousineau M, Santos A, Baillet S. Brainstorm pipeline analysis of resting-state data from the Open MEG Archive. Front Neurosci 2019;13:284. 10.3389/fnins.2019.00284. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Nasiotis K, Cousineau M, Tadel F, Peyrache A, Leahy RM, Pack CC, et al. Integrated open-source software for multiscale electrophysiology. Sci Data 2019;6:231. 10.1038/s41597-019-0242-z. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Medani T, Garcia-Prieto J, Tadel F, Antonakakis M, Erdbrügger T, Höltershinken M, et al. Brainstorm-DUNEuro: An integrated and user-friendly Finite Element Method for modeling electromagnetic brain activity. Neuroimage 2023;267:119851. 10.1016/j.neuroimage.2022.119851. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Vakilna YS, Atilgan D, Hampson J, Chinara C, Medani T, Leahy RM, et al. Time-frequency fingerprint analysis in SEEG source-space to identify the epileptogenic zone. Ann Clin Transl Neurol 2025. 10.1002/acn3.70115. [DOI] [Google Scholar]
  • 7.da Silva Castanheira J, Orozco Perez HD, Misic B, Baillet S. Brief segments of neurophysiological activity enable individual differentiation. Nat Commun 2021;12:5713. 10.1038/s41467-021-25895-8. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Delaire É, Vincent T, Cai Z, Machado A, Hugueville L, Schwartz D, et al. NIRSTORM: a Brainstorm extension dedicated to functional near-infrared spectroscopy data analysis, advanced 3D reconstructions, and optimal probe design. Neurophotonics 2025;12:025011. 10.1117/1.NPh.12.2.025011. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Medina Villalon S, Paz R, Roehri N, Lagarde S, Pizzo F, Colombet B, et al. EpiTools, A software suite for presurgical brain mapping in epilepsy: Intracerebral EEG. J Neurosci Methods 2018;303:7–15. 10.1016/j.jneumeth.2018.03.018. [DOI] [PubMed] [Google Scholar]
  • 10.Shattuck DW, Leahy RM. BrainSuite: an automated cortical surface identification tool. Med Image Anal 2002;6:129–42. 10.1016/s1361-8415(02)00054-3. [DOI] [PubMed] [Google Scholar]
  • 11.Friston KJ, Holmes AP, Worsley KJ, Poline J-P, Frith CD, Frackowiak RSJ. Statistical parametric maps in functional imaging: A general linear approach. Hum Brain Mapp 1994;2:189–210. 10.1002/hbm.460020402. [DOI] [Google Scholar]
  • 12.Taylor KN, Joshi AA, Hirfanoglu T, Grinenko O, Liu P, Wang X, et al. Validation of semi-automated anatomically labeled SEEG contacts in a brain atlas for mapping connectivity in focal epilepsy. Epilepsia Open 2021;6:493–503. 10.1002/epi4.12499. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Arnulfo G, Narizzano M, Cardinale F, Fato MM, Palva JM. Automatic segmentation of deep intracerebral electrodes in computed tomography scans. BMC Bioinformatics 2015;16:99. 10.1186/s12859-015-0511-6. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Ervin B, Rozhkov L, Buroker J, Leach JL, Mangano FT, Greiner HM, et al. Fast Automated stereo-EEG Electrode Contact Identification and Labeling Ensemble. Stereotact Funct Neurosurg 2021;99:393–404. 10.1159/000515090. [DOI] [PubMed] [Google Scholar]
  • 15.Davis TS, Caston RM, Philip B, Charlebois CM, Anderson DN, Weaver KE, et al. LeGUI: A fast and accurate Graphical User Interface for automated detection and anatomical localization of intracranial electrodes. Front Neurosci 2021;15:769872. 10.3389/fnins.2021.769872. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Narizzano M, Arnulfo G, Ricci S, Toselli B, Tisdall M, Canessa A, et al. SEEG assistant: a 3DSlicer extension to support epilepsy surgery. BMC Bioinformatics 2017;18:124. 10.1186/s12859-017-1545-8. [DOI] [PMC free article] [PubMed] [Google Scholar]

Articles from bioRxiv are provided here courtesy of Cold Spring Harbor Laboratory Preprints

RESOURCES