Semi-Automatic SEEG Localization and Interactive Neuroimage Visualization in Epilepsy Patients

Presented During:

Poster No:


Submission Type:

Abstract Submission 


Adam Li1, Chester Huynh1, Christopher Coogan2, Joon Kang2, Nathan Crone2, Zachary Fitzgerald3, Jorge Gonzalez-Martinez4, Sridevi Sarma1


1Johns Hopkins University, Baltimore, MD, 2Johns Hopkins Hospital, Baltimore, MD, 3Cleveland Clinic, Cleveland, OH, 4University of Pittsburg Medical Center, Pittsburg, PA

First Author:

Adam Li  
Johns Hopkins University
Baltimore, MD


Chester Huynh  
Johns Hopkins University
Baltimore, MD
Christopher Coogan  
Johns Hopkins Hospital
Baltimore, MD
Joon Kang  
Johns Hopkins Hospital
Baltimore, MD
Nathan Crone  
Johns Hopkins Hospital
Baltimore, MD
Zachary Fitzgerald  
Cleveland Clinic
Cleveland, OH
Jorge Gonzalez-Martinez  
University of Pittsburg Medical Center
Pittsburg, PA
Sridevi Sarma  
Johns Hopkins University
Baltimore, MD


Currently, there exist pipelines, such as FreeSurfer [15, 16], or deep learning based models [17, 18], that automatically segment structural MRI images based on an anatomical atlas. From there, manual localization of implanted electrodes have been developed within FieldTrip [19] and img_pipe [20], but are generally optimized mainly for ECoG electrodes. In epilepsy monitoring, more and more patients are being implanted with SEEG depth electrodes, as they provide access to sub-cortical structures and the 3D network of the brain [21, 22, 23]. Currently the open-sourced tools for localizing iEEG is limited in three ways: i) not optimized for SEEG and requires manual localization, ii) running pipelines have a high learning curve, or require very special data structures and iii) do not provide a way for visualization of the SEEG in the context of the 3D brain.

In this work, we developed an open-sourced repository ( pipeline) that abstracts automatic segmentation on the structural T1 MRI, semi-automates localization of the SEEG electrodes and visualizes SEEG electrodes within a 3D brain. We validated the accuracy of our spatial localizations with respect to a manual localization, and our anatomical assignments of SEEG electrodes on a cohort of n=40 epilepsy patients.


We developed a software repository that makes use of existing tools for the sole purpose of augmenting SEEG time-series analysis with anatomical information. We abstracted away the various pipelines that were required with the use of Snakemake [24], which is a bioinformatics workflow engine that encodes workflows in Python making it very accessible. The pipeline encapsulates a variety of workflows that can all be ran independently making them agnostic to a specific data structure:

1. automatic segmentation workflow: Freesurfer commands are called to map patient-specific brains to an anatomical atlas
2. coregistration mapping workflow: FSL, or other affine registration commands convert the CT image space to the T1 MRI space
3. contact localization workflow: runs a semi-automated algorithm for localizing the SEEG electrodes within the CT image
4. post-processing workflow: runs summary analysis to store all the electrode coordinates in BIDS compliant format
5. pooled-patient workflow: runs a nonlinear transformation to map the patient-specific MRI to a template brain, such as the MNI atlas, to compare multiple patients on the same brain space.
6. visualization workflow: runs a local interactive Flask server that shows the localized SEEG electrodes in a 3D brain space


Thus far, we developed a software tool for semi-automatically locating and labeling SEEG depth electrodes in patient CT to provide labeled point clouds for each channel along each electrode, which will ultimately be utilized in the final visualization tool to allow for classification of each point cloud and development of time series animations that showcase features chosen by the user.

To measure success of our semi-automated localization and labeling tool, we compared its output with manually labeled data. Since the manually labeled data only has one coordinate for each of the electrode channels, we computed the centroid point of each cluster found by the tool. We matched points by labels and computed the Euclidean norm between the computed centroids and manually labeled points. The absolute error fell within 3mm for all contacts across each of the electrodes. In the figures, we show the output example of our semi-automated algorithm process, and end-visualizations that can be rendered in the browser via a Flask web-server.
Supporting Image: ReconVisualization.jpg
   ·Automatic segmentation of the structural MRI along with visualized SEEG electrodes in the 3D brain space rendered in a local Flask web-server.
Supporting Image: OverallErrorByElectrode.png
   ·Electrode localization error on average with voxels on the y-axis and electrode label on the x-axis.


We found that our software pipeline was able to lower localization times by a factor of 5X, and maintained error rates of on average a 1-5 voxels per electrode. In addition, we provide a simple abstracted command-line interface that is flexible to use, and an interactive visualization workflow at the end that depends on open-source software.

Neuroinformatics and Data Sharing:

Databasing and Data Sharing
Workflows 1
Informatics Other 2


Electroencephaolography (EEG)
Other - Open-source software

1|2Indicates the priority used for review

My abstract is being submitted as a Software Demonstration.


Please indicate below if your study was a "resting state" or "task-activation” study.


Healthy subjects only or patients (note that patient studies may also involve healthy subjects):


Are you Internal Review Board (IRB) certified? Please note: Failure to have IRB, if applicable will lead to automatic rejection of abstract.


Was any human subjects research approved by the relevant Institutional Review Board or ethics panel? NOTE: Any human subjects studies without IRB approval will be automatically rejected.


Was any animal research approved by the relevant IACUC or other animal research panel? NOTE: Any animal studies without IACUC approval will be automatically rejected.

Not applicable

Please indicate which methods were used in your research:

Structural MRI
Other, Please specify  -   CT

Which processing packages did you use for your study?

Free Surfer
Other, Please list  -   Snakemake

Provide references using author date format

[1]M. J. Brodie, S. D. Shorvon, R. Canger, P. Halasz, S. Johannessen, P. Thompson, H. G.Wieser, and P. Wolf. Commission on EuropeanAffairs: Appropriate standards of epilepsy careacross Europe. Epilepsia, 38(11):1245–1250, nov1997.
[2]Anne T. Berg and Molly M. Kelly. Defining intractability: Comparisons among published definitions. Epilepsia, 47(2):431–436, feb 2006.
[3]Patrick Kwan and Martin J. Brodie. Early Identification of Refractory Epilepsy. New England Journal of Medicine, 342(5):314–319, feb 2000.
[4]Anne T. Berg. Identification of Pharmacoresistant Epilepsy.Neurologic Clinics, 27(4):1003–1013, nov 2009.
[5]WHO and World Health Organization.Epilepsy, 2019.[6]Anthony K. Ngugi, Christian Bottomley,Immo Kleinschmidt, Josemir W. Sander, andCharles R. Newton. Estimation of the burden of active and life-time epilepsy: A meta-analytic approach.Epilepsia, 51(5):883–890, may 2010.
[7]Charles E. Begley and Tracy L. Durgin. The direct cost of epilepsy in the United States: A systematic review of estimates, sep 2015.
[8]Hans O. Lüders, Imad Najm, Dileep Nair, Peter Widdess-Walsh, and William Bingman. The epileptogenic zone: General principles.Epileptic Disorders, 8(SUPPL. 2), 2006.
[9]Lara Jehi. The epileptogenic zone: Concept and definition, 2018.
[10]W PENFIELD. Epileptogenic lesions.Actaneurologica et psychiatrica Belgica, 56(2):75–88,feb 1956.
[11]Wilder Penfield and Herbert Jasper.Epilepsyand the Functional Anatomy of the HumanBrain., volume 155. Little Brown, Boston, [1sted.]. edition, 1954.
[12]Martha Morrell. Brain stimulation for epilepsy:Can scheduled or responsive neurostimulation stop seizures?, apr 2006.
[13]Barbara C. Jobst, Terrance M. Darcey, Vijay M.Thadani, and David W. Roberts. Brain stimulation for the treatment of epilepsy: Brain Stimulation in Epilepsy.Epilepsia, 51:88–92,jul 2010.
[14]Samuel Wiebe, Warren T. Blume, John P.Girvin, and Michael Eliasziw. A randomized,controlled trial of surgery for temporal-lobeepilepsy.New England Journal of Medicine, 345(5):311–318, aug 2001.
[15]Bruce Fischl. FreeSurfer.NeuroImage,62(2):774–781, aug 2012.
[16]Bruce Fischl, et al. Automatically Parcellating the Human Cerebral Cortex. Cortex, 14:11–22, 2004.
[17]Christian Wachinger, Martin Reuter, and Tasilo Klein. DeepNAT: Deep ConvolutionalNeural Network for Segmenting Neuroanatomy.Technical report.