Search tips
Search criteria 


Logo of nihpaAbout Author manuscriptsSubmit a manuscriptHHS Public Access; Author Manuscript; Accepted for publication in peer reviewed journal;
Epilepsia. Author manuscript; available in PMC 2015 December 1.
Published in final edited form as:
PMCID: PMC4285663

An open-source, automated platform for visualizing subdural electrodes using 3D CT-MRI coregistration



Visualizing implanted subdural electrodes in 3D space can greatly aid planning, executing, and validating resection in epilepsy surgery. Coregistration software is available, but cost, complexity, insufficient accuracy or validation limit adoption. We present a fully automated open-source application, based upon a novel method using post-implant CT and post-implant MR images, for accurately visualizing intracranial electrodes in 3D space.


CT-MR rigid brain coregistration, MR non-rigid registration, and prior-based segmentation were carried out on 7 subjects. Post-implant CT, post-implant MR, and an external labeled atlas were then aligned in the same space. The coregistration algorithm was validated by manually marking identical anatomical landmarks on the post-implant CT and post-implant MR images. Following coregistration, distances between the center of the landmark masks on the post-implant MR and the coregistered CT images were calculated for all subjects. Algorithms were implemented in open-source software and translated into a “drag and drop” desktop application for Apple Mac OS X.


Despite post-operative brain deformation, the method was able to automatically align intra-subject multi-modal images and segment cortical subregions so that all electrodes could be visualized on the parcellated brain. Manual marking of anatomical landmarks validated the coregistration algorithm with a mean misalignment distance of 2.87 ± 0.58 mm between the landmarks. Software was easily used by operators without prior image processing experience.


We demonstrate an easy to use, novel platform for accurately visualizing subdural electrodes in 3D space on a parcellated brain. We rigorously validated this method using quantitative measures. The method is unique because it involves no pre-processing, is fully automated, and freely available worldwide. A desktop application, as well as the source code, are both available for download on the International Epilepsy Electrophysiology Portal ( for use and interactive refinement.

Keywords: Electrode localization, 3D CT-MRI coregistration, Electrocorticography, Subdural electrodes, Epilepsy surgery

1. Introduction

Surgery is the most effective treatment for intractable drug-resistant partial epilepsy.1,2 During phase II (invasive) monitoring, subdural electrodes for electrocorticography (ECoG) are often implanted to precisely localize the ictal onset zone, seizure spread, and for functional brain mapping with electrical stimulation. ECoG findings are delineated with respect to electrode locations. The accuracy of resection depends upon clear and exact visualization of this combined electrode map relative to the cortical surface. Pre-operative imaging methods have been developed for 3D electrode visualization on reconstructed post-implantation brain images. These electrode visualization tools improve the integration of intracranial electrophysiological data with other imaging modalities that map the epileptic network, identify eloquent brain regions, and localize important functions by overlaying fMRI and MEG recordings on pre-surgical MRI scans.3

To date many different imaging techniques have been employed to visualize intracranial electrodes. Such methods include projecting lateral skull radiographs onto MRI,4 curvilinear reformatting of 3D MRI,5 surface CT reconstruction,6 and fusing intraoperative digital photography with pre-implantation MRI.7,8 Recently developed labor-intensive methods rely on intraoperative photographs and avoid conventional techniques of CT-MRI coregistration.3 These techniques have been validated more rigorously than earlier work, with more promising electrode localization accuracy. Because these methods rely on intraoperative photographs, not all electrodes can be visualized on the final 3D rendered image. Matching MRI to photographs relies on electrodes that are in view of the camera. Given that electrodes are often positioned under the skull and away from the exposed cortex, electrode contacts on the outer boundaries of the grid as well as strip electrodes may not be visualized.9

Although not as rigorously validated, and with higher electrode localization error, many epilepsy centers more commonly coregister conventional post-implant CT and pre-implant MRI to generate a final 3D image to display implanted electrodes.10-16 These algorithms employ surface oriented, mutual-information based, or landmark-based methods.13 These methods are more prone to errors from preprocessing (e.g. brain surface extraction, skull segmentation) and manual marking of landmarks for coregistration. Most of these algorithms also rely on projecting electrodes onto the cortical surface, with the aim of addressing coregistration errors due to brain shift that occurs during and after subdural electrodes implantation. This is related to blood and fluid accumulating underneath the craniotomy flap as well as the thickness of the implanted material.17-20 This nonlinear deformation especially affects electrodes under the bone flap, causing them to be buried when visualized in a model created by the pre-implant MRI.3,9 Parenchymal shift introduced by implantation of subdural electrodes can often be larger than one centimeter,21 potentially causing localization errors at least this large when the post-implant CT is coregistered with the pre-implant MRI.7 The effect of brain shift is significantly reduced when the post-implant CT is coregistered with the post-implant MRI.

One aim of this study is to demonstrate the feasibility of a novel and fully automated method of coregistering CT and MRI that accurately and reliably visualizes all electrodes in 3D space by coregistering the post-implant CT with the post-implant MRI. The final image showing the electrodes is displayed on a parcellated brain with rich cortical annotation. In conjunction with results of cortical stimulation mapping, the goal of the parcellated brain image is to aid in determining the approximate boundaries of functional anatomy. We are able to visualize all electrode contacts and include the effect of brain shift on electrode visualization by coregistering the post-implant CT with the post-implant MR image. This method is one of the most rigorously validated CT-MRI coregistration algorithms for visualization of intracranial electrodes, and is among the first to be done on a parcellated brain.

A second contribution of the present study is that we share our source code, and provide a free, easy to use “drag and drop” application on the International Epilepsy Electrophysiology Portal (, a platform to accelerate collaborative science. We propose that crowd-sourced tools and open source standards, may increase scientific collaboration across centers and accelerate investigator-driven multi-center studies in the translational neurosciences.

2. Methods

2.1 Patients and electrodes

Seven patients with intractable drug-resistant epilepsy were included in our experiments. All subjects were implanted with subdural electrodes for intracranial EEG monitoring. Mean age at implant was 31 years (range 21 – 42). Four of the subjects were male and three were female. The Institutional Review Board of the University of Pennsylvania approved this study.

Intracranial EEG electrode placement was planned at a multidisciplinary surgical conference during which multimodality imaging, scalp video EEG, clinical history, and neuropsychological testing were reviewed. The StealthStation neuronavigation (Medtronic, Minneapolis, MN) was utilized in the operating room to assist in implantation. Platinum electrodes embedded in a silastic membrane (Ad-Tech Medical Instrument Corporation, Racine, WI) were used. The diameter of each electrode disc was 4 mm and electrode spacing from center to center was 10 mm. The implanted units had between 4 and 64 contacts (grids: 8 X 8, 4 X 8, 2 X 8, strips: 1 X 4, 1 X 6, 1 X 8). Electrodes were implanted on the frontal, temporal, and parietal regions (right hemisphere in two subjects, left hemisphere in two subjects, bilaterally in three subjects). Six subjects were implanted with both subdural grids and strips, while one subject was implanted with only strips. Overall 9 grids (1 in 4 subjects, 2 in 1 subject, 3 in 1 subject) and 32 strips (range 1 – 14) for a total of 548 contacts (36 minimum, 92 maximum for each subject) were implanted.

Patients were stabilized post-operatively in the neurointensive care unit for approximately 24 hours before being transferred to the epilepsy monitoring unit for intracranial EEG monitoring. Based on the results of intracranial EEG monitoring, five of the subjects were determined to have seizures of extra-temporal onset and two of the subjects had seizures of temporal onset.

2.2 Acquisition of CT and MR images

All subjects had both post-implant CT and post-implant MRI scans. The post-implant spiral CT images (Siemens, Germany) were obtained first, within 12 hours of surgery for all subjects. Both bone and tissue windows were obtained (120 KV, 300 mA, axial slices 1.0 mm thickness).

A post-implant MRI with volumetric sequences was obtained a mean of 12.4 hours after the post-implant CT (range 2 – 20.3 hours) on a 1.5-Tesla (T) MRI machine (Siemens, Germany) equipped with ultra-gradients, a standard head coil, and vacuum cushion to reduce patient movement. MRI protocol included axial T1 (TE = 2.79 ms, TR = 1180 ms, FOV = 25, flip angle = 15°, matrix of 256 × 256 mm2, 1.0 mm slice thickness) ; sagittal T1 weighted images (TE = 12 ms, TR = 410 ms, FOV = 23, flip angle = 80°, matrix of 256 × 192 mm2, 5.0 mm slice thickness); axial FLAIR (TE = 98 ms, TR = 10000 ms, FOV = 23, flip angle = 150°, matrix of 256 × 166 mm2, 3.0 mm slice thickness). The timing of acquisition of both the CT and MRI post-implantation scans was based on the current protocol employed at the Hospital of the University of Pennsylvania to minimize patient transport and discomfort.

MRI for intracranial electrode localization could be safely performed for both 1.5-T and 3-T MRI after evaluation by Ad-Tech Medical Instrument Corporation in accordance with ASTM F2052-02 Standard Test Method for measurement of Magnetically Induced Displacement Force on Medical Devices in the Magnetic Resonance Environment and for heating (summary provided by company). Independent verification of safety with respect to any possible heating of the electrodes has also been reported by Carmichael et al.22

2.3 CT and MR image alignment

In an initial step, mutual information is used as the similarity metric to align the two images for each subject. CT data are transformed into MR space, with the CT designated as the floating image and the MR the fixed image. Rigid and subsequent affine transformations are applied to the CT image to account for differences between the two brain images in position, rotation, and scale. The transformation parameters for the CT image are probed, adjusting the similarity matrix, and the transformation corresponding to the maximum value of mutual information is chosen as the best position of the floating image to align with the fixed image. This is a standard method to register multi-modal intra-subject image volumes.23

High intensity electrodes in the CT image are extracted by applying a predefined threshold. Although skull and other bone tissues are brighter than soft brain tissues in CT, metal electrodes are even brighter than most hard tissues. Thresholding may result in extraction of non-electrode objects such as high intensity bone areas and electrode connection wires. These artifacts are deleted by applying a brain mask that keeps only electrodes inside or close to the brain. The brain mask is automatically generated by applying the Brain Extraction Tool (BET) provided from the Functional MRI of the Brain Software Library (Oxford, UK).24 Electrode segmentation is mapped to the MR space by means of the CT to MR image transform obtained previously.

2.4 Brain parcellation

An external brain atlas with rich cortical annotation is used to segment the subject MR scan. We chose the atlas of Non-rigid Image Registration Evaluation Project (NIREP) from the University of Iowa, which is based on 16 normal adult T1-weighted brain scans and has 32 cortical gray matter labels.25 Skull and other non-brain tissues in the subject MR images are stripped by applying the BET.24

The correspondence between the patient MR image and the NIREP atlas is established by non-rigidly registering the gray scale atlas to the patient MR image. Cross-correlation is used as the similarity metric. The non-rigid registration can overcome local brain deformation and shift resulting from electrode placement and surgical intervention, even though the atlas used is based on normal healthy brains.

Atlas labels are propagated to the subject MR image through the deformation resulting from the non-rigid registration. In order to further adapt the labels to the patient's anatomy, we perform prior-based segmentation on the subject MR image using the propagated labels as priors.26 The segmentation algorithm, Atropos, adopts a Bayesian framework and finite mixtures to maximize the posterior probability of a set of labels using Expectation Maximization. The smoothness of segmentation is enforced by a Markov random field component, which encourages each label to be similar to its spatial neighbors on the image grid. Atropos further refines the resultant brain parcellation to fit the tissue boundary of the MR image. The implementation of the rigid and non-rigid registration, as well as prior-based segmentation, are based on the open-source software ANTS (University of Pennsylvania, Philadelphia, PA) and its accompanying tools (e.g. Atropos). The non-rigid registration method implemented in ANTS, specifically symmetric normalization (SyN), has been ranked among the most accurate registration methods.27

The flow chart of the processing pipeline is shown in Fig. 1. The running time is approximately 20 minutes for CT-MR coregistration, and approximately 3 hours for brain parcellation.

Figure 1
The flowchart of the image processing pipeline. Subject CT (top left) is registered to subject MR image (middle). An external labeled atlas (top right) is also registered to subject MR image. The results of the two registrations are integrated to generate ...

2.5 Visualization

The resultant electrode and cortical subregion segmentations are visualized in 3D space with distinct colors. The solid segmentations are converted to mesh-based surface representations for efficient manipulation, such as rotation and translation. Smoothing is applied to remove the wavy shape of the segmentations in cases of limited image resolution. We use the open-source software ITK-SNAP (University of Pennsylvania, Philadelphia, PA) and Visualization Toolkit (VTK, Kitware Inc.) for the visualization task. This enables simultaneous 3D image rendering and volume navigation using highly customizable parameters such as the opacity.28

In some cases the electrodes in the final segmentation appear partially or fully buried by the brain tissue. We remedy this by using a post-processing script in MATLAB (The Mathworks Inc., Natick, MA). This script takes as inputs the brain mask produced from the MR and the aligned electrode mask produced from the CT after it is registered to the MR. A ray is projected from the center of the brain to the cortical surface, passing through each individual electrode. The center of the mass of each electrode is found and shifted outward along the ray until the center of the electrode reaches the surface. This method involves movement of the electrodes along the Z axis (radial axis with respect to the brain center). There is no movement of the electrodes along the X-Y plane, a factor that would contribute to electrode localization error. To prevent movement of the depth electrodes, we set a threshold distance, and any electrode that would have to be projected beyond the threshold distance is left in place. This produces a new electrode mask that is combined with the parcellated brain. Our excavation algorithm is similar to the work of prior investigators.7,9

We provide access to all source code for all software described in sections 2.3 to 2.5 through GitHub, a recognized free code repository (

2.6 Validation

Alignment between the subject CT and MR images is the core component of the pipeline, allowing for improved visualization of the electrodes with respect to neuroanatomy. To verify the validity of this alignment, we established a protocol to specify the true correspondence between the two image modalities based on anatomical features available in both scans. In the first step of the validation, a single investigator marked 4 identical landmarks on both the post-implant CT and post-implant T1 MRI for all 7 subjects, independent of the coregistration. The landmarks used were the pineal gland, midline inferior most point of the nasal bridge, a frontal cortical point immediately posterior to the superior most midline of the frontal sinus, and the confluence of sinuses with overlap at the internal occipital protuberance. Precise identification of cortical landmarks in the vicinity of electrodes contacts on the MR images could be made, but these same cortical landmarks could not be manually found on the post-implant CT. Post-operative edema as well as metal artifact made identification of these specific cortical points virtually impossible on the post-implant CT. Thus, the above subcortical, bony landmark, and frontal and posterior cortical landmarks were chosen given the feasibility of their segmentation on the post-implant CT. Examples of these marked landmarks for 4 subjects are shown for both the T1 MRI and CT (Fig. 2). Note that the coregistration algorithm did not use the information from these landmarks and vice versa.

Figure 2
Segmented MRI landmarks of the pineal gland (subject 3, image A), midline inferior most point of the nasal bridge (subject 7, image B), a frontal cortical point immediately posterior to the superior most midline of the frontal sinus (subject 2, image ...

2.7 User Interface

Two different user interfaces were created. One is designed for Linux operating systems and requires familiarity with the command line. A second push-button application was designed for the Apple Mac OS X, coded in Objective-C. Once opened, the application requires that only one file from each set of DICOM images be dragged and dropped into the appropriate location on the interactive interface. In both applications parcellation is selectable as a processing option (not required given that the user may desire faster processing time). A “progress bar” tracks processing, allowing the user to know that the application is proceeding normally (Fig 3).

Figure 3
Screen shot of the “drag and drop” Apple Mac OS X application from the International Epilepsy Electrophysiology Portal (

3. Results

The automated pipeline successfully performed rigid registration between the CT and MR images for all 7 subjects, and all electrode contacts were visualized. Even though the intensity atlas was constructed based on normal healthy brains, the non-rigid registration between the subject MR images and the atlas was also successful for all 7 subjects. Post-implant brains were partly deformed as a consequence of the craniotomy and subsequent electrode implantation. In addition, epileptic pathology often results in structural changes in the cerebrum. Despite these factors, independent visualization of the brain segmentation by two epileptologists (KD, AA) determined that parcellation conformed to known structural anatomy, serving as a good reference for electrode localization (Fig. 4).

Figure 4
3D surface visualization of cortices overlaid with electrodes for subjects 1, 4 and 3 (left, middle and right columns, respectively). Users can choose either a monochrome brain (first row) or a colored parcellated cortex (second row).

The “excavation” algorithm to correct visualization of buried electrodes only needed to be applied to subjects 3 and 7. One example result is shown in Fig. 5. Depth electrodes were not visualized on the surface per the algorithm previously described in section 2.5.

Figure 5
The visualization of electrodes on a monochrome brain for subject 7 before (left subfigure) and after (right subfigure) applying the excavation algorithm.

To validate electrode locations we quantitatively assessed the accuracy of alignment between the MR and CT for each subject. The 3-dimensional coordinates of the segmented masks from the T1 MR images were averaged to locate the center of the image. Following coregistration of the post-implant CT with the post-implant T1 MRI, the same procedure was repeated to calculate the center of the masks on the coregistered CT image. The distance between the centers of the two masks was calculated in a standardized and automated manner. The mean of the distances were as follows: Pineal gland (mean distance, SD) 3.46 mm ± 1.00 mm, inferior point of nasal bridge 2.08 mm ± 0.81 mm, frontal cortical point 2.94 mm ± 1.35 mm, and confluence of sinuses 2.98 mm ± 1.21 mm. In comparison, the voxel size for all 7 subjects in the X-Y-Z plane was 0.5 mm X 0.5 mm X 1 mm for the post-implant CT, and 1 mm X 1 mm X 1 mm for the post-implant T1 MRI. The results of the distances from the center of the masks on the T1 MRI to that of the coregistered CT are shown for all 7 subjects (Table 1).

Table 1
Distances (mm) from the center of the masks on the T1 MRI to that of the coregistered CT for all 7 patients.

The software was tested by individuals of different educational levels, including undergraduate students, research assistants, physicians and Ph.D. researchers. Interface elements were iteratively assessed and refined to enable trouble-free use that was deemed to be intuitive by novice users.

4. Discussion

Accurate and clear visualization of intracranial electrodes is essential to accurately target regions for resection in epilepsy surgery localized by electrophysiology. This study demonstrates the feasibility of applying a state-of-the-art automated method to coregister and segment electrode locations using CT and post-operative MR. We also demonstrate that it is practical to parcellate epileptic brain images after electrode implantation. Algorithms are implemented in an automated, intuitive interface that is free for use.

The proposed coregistration method is effective and practical, as it works directly on raw imaging data in a fully automated manner. Once input images are provided, manual intervention is not necessary. No complex pre-processing, such as brain surface extraction, skull stripping, or brain tissue segmentation is required due to registration of raw images with voxel-based whole head (including head and skull) matching. We eliminate pre-processing steps that can propagate errors to registration. Our adopted implementation (ANTS) has also been validated by external users.27,29,30 One limitation of our coregistration method is that in rare cases it cannot accommodate large discrepancies in head-position between MR and CT. Coregistration with errors of this nature is obvious by gross visual inspection. No subject tested in this experiment had such a head-pose discrepancy.

Another reason for the high level of accuracy of our coregistration method is that the post-implant MRI, and not the pre-implant MRI is used for registration. In patients chronically implanted with intracranial electrodes there is often edema as well as subdural blood overlying implanted electrodes. These factors, along with electrode thickness, can contribute to brain tissue displacement relative to the pre-operative MRI.7 The unequal shift in electrodes causes inaccuracies in localization based on mutual information algorithms that coregister the post-implant CT with the pre-implant MR.3 By using only post-implantation images, effects of brain shift are not ignored. The subjects in our study had the post-implant MRI performed soon after (mean of 12.4 hours) the post-implant CT. This minimized the effect of any brain shift occurring in the intervening time period between the two scans. The majority of groups employing coregistration algorithms have used the pre-implant MRI. This is due to concerns that the final coregistered image will distort anatomical detail in the vicinity of the electrodes if the post-implant MRI is used.31 Results of our final coregistration images for all subjects showed that the anatomical detail in the vicinity of the electrodes was not compromised.

Due to brain shift, other groups employing coregistration of the post-implant CT to the pre-implant MRI have had to devise complicated algorithms to “de-bury” electrodes on the final 3D coregistered image for all subjects.32 This process often adds additional processing time and may compromise accuracy. Even though we used the post-implant MRI for all subjects to include brain shift, we had to apply a simplified excavation algorithm to several electrodes in 2 subjects. Not surprisingly, in these 2 subjects the intervening time period from acquisition of the post-implant MRI to that of the initial post-implant CT was above the mean of 12.4 hours (subject 3, 13.75 hours; subject 7, 17 hours), providing enough time for significant brain shift to occur. If the post-implant MR images had been obtained sooner relative to acquisition of the post-implant CT, then it is possible that the excavation algorithm might not have been required.

The small number of subjects for validation is a limitation of this application. The number of patients was limited to the number of patients scanned with MRI post-implant at our center at the time the study was performed. However, in contrast to most other CT-MRI coregistration algorithms, our results have been validated on all subjects. Our mean electrode localization error of 2.87 ± 0.58 mm is equal to or better than other reported methods. Given that the inter-electrode distance is usually 10 mm, an error of even 4 mm is substantial and could possibly cause the electrode to be localized on an incorrect gyrus.3 Using the pre-implant MRI images for the registration algorithm, and validation with intra-operative implantation photographs, others have reported a mean electrode localization error ranging from 2 ± 0.12 mm to 6.8 ± 2.4 mm.11,12,32 Our method of validation using internal landmarks appears to more accurately assess the electrode localization error compared to conventional methods of using intraoperative photographs. The timing of the post-implant CT acquisition with respect to when the implantation intra-operative photograph was obtained is not reported in the studies referenced above. If there is considerable delay from when the post-implant CT is obtained, then blood and CSF accumulation can occur in the epidural and subdural spaces, causing migration of implanted electrodes.33 Electrode grid movement may potentially be more than the mean localization error of the electrodes, raising concerns with only using intraoperative implantation photographs as a validation technique. Using intraoperative photographs also relies on manual inspection of electrodes relative to anatomical landmarks. Although our method of validation involves manual segmentation of landmarks, the exact same points are found on both the CT and MRI images, with distances between the centers of the masks calculated in an automated fashion. Also, 2D photograph based distance measures are artificially smaller than the actual 3D distance measures in 3D images. If a line segment is projected in 3D space to a 2D plane (e.g. a 2D photograph), then the length of the projected line segment will be smaller than the original length based on the Pythagorean theorem.

Recent 3D electrode visualization algorithms developed by Pieters et al. address concerns of grid shift when solely using implantation photographs as a validation technique. Similar to work by Hermes et al, they also use implantation and explantation photographs, and report substantial grid movement in some of the subjects that was subsequently incorporated into their validation analysis (mean electrode localization error of 2.0 mm). Their recursive grid partitioning method for electrode visualization requires the user to manually mark grid corners based on intra-operative photographs. Even though this technique is accurate, it requires these additional manual steps, and only works to visualize grid electrode contacts seen in the surgical field at the time the implantation photograph is taken. An extrapolation method is employed for the remaining non-visible grid electrodes. Subsequently, strip electrodes cannot be visualized on the final 3D image. This illustrates that conventional CT-MRI coregistration algorithms are critical to localize electrodes that are not visible in the surgical field during craniotomy, as is commonly the case when recording from non-convexity cortex such as the temporal lobe.12 Our coregistration algorithm does not have this limitation, and our final 3D rendered images clearly show all electrode contacts for all subjects.

Even with our level of electrode localization accuracy, grid movement at the time of explantation and resection still presents a challenge, a factor that is not taken into account with post-implant CT-MRI coregistration. In cases of suspected grid movement, repeat CT and MR imaging immediately prior to explantation, with subsequent implementation of our proposed coregistration algorithm could potentially eliminate the negative impact of grid movement on electrode localization error.

We also demonstrate parcellation on the final 3D coregistered brain image. Accurate cortical parcellation is a challenging task, since boundaries between gyri and sulci are not well defined by MRI features, but by prior knowledge or artificial delimitation.34 Accurately mapping between two different brains (e.g. template and patient) is still an unsolved problem due to the lack of one-to-one correspondence between cortical folds of two individuals.35 Furthermore, the functional anatomy of epilepsy patients may be shifted due to reorganization secondary to pathological plasticity in epileptogenic networks.36-38 This is the main limitation of any parcellation algorithm applied to epileptic brain; thus, all clinical information gained from these images should only be used in conjunction with results of cortical stimulation or other electrophysiologic based mapping.39,40 Specific to the subjects in this study, for reasons explained, the parcellated images only provided a general approximation of functional anatomy of epileptic brains relative to normal adult brain scans. For all 7 subjects, the results of electrophysiologic based mapping were primarily used to determine the boundaries of resection.

In this paper we present a method for accurately visualizing subdural implanted electrodes in patients undergoing evaluation for surgical treatment of epilepsy. We believe our work is an important addition to currently available approaches because its accuracy is competitive with the best methods currently available, it is easy to use, fully automated, and free for use through the International Epilepsy Electrophysiology Portal ( As with software of any kind, we expect our platform to continuously evolve. By providing access to source code, improvement and updating will occur with greater ease. Our platform has the potential to be adopted by the worldwide epilepsy community, and to become the standard through which functional and pathological localization can be compared across epilepsy centers. This collaborative effort will hopefully improve the accuracy of epilepsy surgery.


This study was funded by National Institutes of Health (NIH), Epilepsy Foundation (EF), Mirowski Family Foundation, and Citizens United for Research in Epilepsy (CURE) grants through the University of Pennsylvania. NIH (8KL2TR000139-07, 2KL2RR024132-06), University of Pennsylvania Institute for Translational Medicine and Therapeutics; NIH (DA022807, NS045839); The National Library of Medicine, American Recovery and Reinvestment Act (HHSN276201000492P); EF Research and Training Fellowship for Clinicians (190678); CURE (“Flexible, Active, Implantable Devices for Epilepsy”). The International Epilepsy Electrophysiology Portal is funded by the NIH (5-U24-NS-063930-04).


6. Conflicts of Interest

None of the authors have any conflict of interest to disclose. We confirm that we have read the Journal's position on issues involved in ethical publication and affirm that this report is consistent with those guidelines.


1. Wiebe S, Blume WT, Girvin JP, Eliasziw M. A randomized, controlled trial of surgery for temporal-lobe epilepsy. N Engl J Med. 2001;345:311–8. [PubMed]
2. Engel J, Jr, Wiebe S, French J, Sperling M, Williamson P, Spencer D, Gumnit R, Zahn C, Westbrook E, Enos B. Practice parameter: temporal lobe and localized neocortical resections for epilepsy. Epilepsia. 2003;44:741–51. [PubMed]
3. Pieters TA, Conner CR, Tandon N. Recursive grid partitioning on a cortical surface model: an optimized technique for the localization of implanted subdural electrodes. J Neurosurg. 2013;118:1086–97. [PubMed]
4. Winkler PA, Vollmar C, Krishnan KG, Pfluger T, Brückmann H, Noachtar S. Usefulness of 3-D reconstructed images of the human cerebral cortex for localization of subdural electrodes in epilepsy surgery. Epilepsy Res. 2000;41:169–78. [PubMed]
5. Schulze-Bonhage AH, Huppertz HJ, Comeau RM, Honegger JB, Spreer JM, Zentner JK. Visualization of subdural strip and grid electrodes using curvilinear reformatting of 3D MR imaging data sets. Am J Neurodariol. 2002;23:400–3. [PubMed]
6. Hunter JD, Hanan DM, Singer BF, Shaikh S, Brubaker KA, Hecox KE, Towle VL. Locating chronically implanted subdural electrodes using surface reconstruction. Clin Neurophysiol. 2005;116:1984–7. [PubMed]
7. Dalal SS, Edwards E, Kirsch HE, Barbaro NM, Knight RT, Nagarajan SS. Localization of neurosurgically implanted electrodes via photograph-MRI-radiograph coregistration. J Neurosci Methods. 2008;174:106–r15. [PMC free article] [PubMed]
8. Wellmer J, von Oertzen J, Schaller C, Urbach H, König R, Widman G, Van Roost D, Elger CE. Digital photography and 3D MRI-based multimodal imaging for individualized planning of resective neocortical epilepsy surgery. Epilepsia. 2002;43:1543–50. [PubMed]
9. Hermes D, Miller KJ, Noordmans HJ, Vansteensel MJ, Ramsey NF. Automated electrocorticographic electrode localization on individually rendered brain surfaces. J Neurosci Methods. 2010;185:293–8. [PubMed]
10. Immonen A, Jutila L, Könönen M, Mervaala E, Partanen J, Puranen M, Rinne J, Ylinen A, Vapalahti M. 3-D reconstructed magnetic resonance imaging in localization of subdural EEG electrodes. Case illustration. Epilepsy Res. 2003;54:59–62. [PubMed]
11. Sebastiano F, Di Gennaro G, Esposito V, Picardi A, Morace R, Sparano A, Mascia A, Colonnese C, Cantore G, Quarato PP. A rapid and reliable procedure to localize subdural electrodes in presurgical evaluation of patients with drug-resistant focal epilepsy. Clin Neurophysiol. 2006;117:341–7. [PubMed]
12. Tao JX, Hawes-Ebersole S, Baldwin M, Shah S, Erickson RK, Ebersole JS. The accuracy and reliability of 3D CT/MRI co-registration in planning epilepsy surgery. Clin Neurophysiol. 2009;120:748–53. [PubMed]
13. Nelles M, Koenig R, Kandyba J, Schaller C, Urbach H. Fusion of MRI and CT with subdural grid electrodes. Zentralbl Neurochir. 2004;65:174–9. [PubMed]
14. Silberbusch MA, Rothman MI, Bergey GK, Zoarski GH, Zagardo MT. Subdural grid implantation for intracranial EEG recording: CT and MR appearance. Am J Neuroradiol. 1998;19:1089–93. [PubMed]
15. Ken S, Di Gennaro G, Giulietti G, Sebastiano F, De Carli D, Garreffa G, Colonnese C, Passariello R, Lotterie JA, Maraviglia B. Quantitative evaluation for brain CT/MRI coregistration based on maximization of mutual information in patients with focal epilepsy investigated with subdural electrodes. Magn Reson Imaging. 2007;25:883–8. [PubMed]
16. Morris K, O'Brien TJ, Cook MJ, Murphy M, Bowden SC. A computer-generated stereotactic “Virtual Subdural Grid” to guide resective epilepsy surgery. Am J Neuroradiol. 2004;25:77–83. [PubMed]
17. Studholme C, Novotny E, Zubal IG, Duncan JS. Estimating tissue deformation between functional images induced by intracranial electrode implantation using anatomical MRI. Neuroimage. 2001;13:561–76. [PubMed]
18. Skrinjar O, Nabavi A, Duncan J. Model-driven brain shift compensation. Med Image Anal. 2002;6:361–73. [PubMed]
19. Elias WJ, Fu KM, Frysinger RC. Cortical and subcortical brain shift during stereotactic procedures. J Neurosurg. 2007;107:983–8. [PubMed]
20. Hastreiter P, Rezk-Salama C, Soza G, Bauer M, Greiner G, Fahlbusch R, Ganslandt O, Nimsky C. Strategies for brain shift evaluation. Med Image Anal. 2004;8:447–64. [PubMed]
21. Hill DL, Maurer CR, Jr, Maciunas RJ, Barwise JA, Fitzpatrick JM, Wang MY. Measurement of intraoperative brain surface deformation under a craniotomy. Neurosurgery. 1998;43:514–28. [PubMed]
22. Carmichael DW, Thornton JS, Rodionov R, Thornton R, McEvoy A, Allen PJ, Lemieux L. Safety of localizing epilepsy monitoring intracranial electroencephalograph electrodes using MRI: radiofrequency-induced heating. J Magn Reson Imaging. 2008;28:1233–44. [PMC free article] [PubMed]
23. Maes F, Collignon A, Vandermeulen D, Marchal G, Suetens P. Multimodality image registration by maximization of mutual information. IEEE Trans Med Imaging. 1997;16:187–98. [PubMed]
24. Smith S. Fast robust automated brain extraction. Human Brain Mapp. 2002;17:143–55. [PubMed]
25. Christensen G, Geng X, Kuhl J, Bruss J, Grabowski T, Pirwan I, Van-nier M, Allen J, Damasio H. Introduction to the non-rigid image registration evaluation project (NIREP). In: Pluim JPW, Likar B, Gerritsen FA, editors. Biomedical Image Registration. Springer; Berlin Heidelburg: 2006. pp. 128–135.
26. Avants B, Tustison N, Wu J, Cook P, Gee J. An open source multivariate framework for n-tissue segmentation evaluation on public data. Neuroinformatics. 2011;9:381–400. [PMC free article] [PubMed]
27. Klein A, Andersson J, Ardekani B, Ashburner J, Avants B, Chiang M, Christensen G, Collins D, Gee J, Hellier P, Hyun S, Jenkinson M, Lepage C, Rueckert D, Thompson P, Vercauteren T, Woods R, Mann J, Parsey R. Evaluation of 14 nonlinear deformation algorithms applied to human brain MRI registration. NeuroImage. 2009;46:786–802. [PMC free article] [PubMed]
28. Yushkevich PA, Piven J, Hazlett HC, Smith RG, Ho S, Gee JC, Gerig G. User-guided 3D active contour segmentation of anatomical structures: Significantly improved efficiency and reliability. Neuroimage. 2006;31:1116–1128. [PubMed]
29. Mallar CM, Steadman P, van Eede MC, Calcott RD, Gu V, Shaw P, Raznahan A, Louis CD, Lerch JP. Performing label-fusion based segmentation using multiple automatically generated templates. Hum Brain Mapp. 2013;34:2635–54. [PMC free article] [PubMed]
30. Ripollés P, Marco-Pallarés J, de Diego-Balaguer R, Miró J, Falip M, Juncadella M, Rubio F, Rodriguez-Fornells A. Analysis of automated methods for spatial normalization of lesioned brains. Neuroimage. 2012;60:1296–306. [PubMed]
31. Darcey TM, Roberts DW. Technique for the localization of intracranially implanted electrodes. J Neurosurg. 2010;113:1182–5. [PubMed]
32. Dykstra AR, Chan AM, Quinn BT, Zepeda R, Keller CJ, Cormier J, Madsen JR, Eskandar EN, Cash SS. Individualized localization and cortical surface-based registration of intracranial electrodes. Neuroimage. 2012;59:3563–70. [PMC free article] [PubMed]
33. LaViolette PS, Rand SD, Ellingson BM, Raghavan M, Lew SM, Schmainda KM, Mueller W. 3D visualization of subdural electrode shift as measured at craniotomy reopening. Epilepsy Res. 2011;94:102–9. [PMC free article] [PubMed]
34. Fischl B, van der Kouwe A, Destrieux C, Halgren E, Ségonne F, Salat DH, Busa E, Seidman LJ, Goldstein J, Kennedy D, Caviness V, Makris N, Rosen B, Dale AM. Automatically parcellating the human cerebral cortex. Cereb Cortex. 2004;14:11–22. [PubMed]
35. Mangin JF, Jouvent E, Cachia A. In-vivo measurement of cortical morphology: means and meanings. Curr Opin Neurol. 2010;23:359–67. [PubMed]
36. Burneo JG, Kuzniecky RI, Bebin M, Knowlton RC. Cortical reorganization in malformations of cortical development: a magnetoencephalographic study. Neurology. 2004;63:1818–24. [PubMed]
37. Gondo K, Kira H, Tokunaga Y, Harashima C, Tobimatsu S, Yamamoto T, Hara T. Reorganization of the primary somatosensory area in epilepsy associated with focal cortical dysplasia. Dev Med Child Neurol. 2000;42:839–42. [PubMed]
38. Mäkelä JP, Vitikainen AM, Lioumis P, Paetau R, Ahtola E, Kuusela L, Valanne L, Blomstedt G, Gaily E. Functional plasticity of the motor cortical structures demonstrated by navigated TMS in two patients with epilepsy. Brain Stimul. 2013;6:286–91. [PubMed]
39. Crone NE, Miglioretti DL, Gordon B, Sieracki JM, Wilson MT, Uematsu S, Lesser RP. Functional mapping of human sensorimotor cortex with electrocorticographic spectral analysis. I. Alpha and beta event-related desynchronization. Brain. 1998;121:2271–99. [PubMed]
40. Gaona CM, Sharma M, Freudenburg ZV, Breshears JD, Bundy DT, Roland J, Barbour DL, Schalk G, Leuthardt EC. Nonuniform high-gamma (60-500 Hz) power changes dissociate cognitive task and anatomy in human cortex. J Neurosci. 2011;31:2091–100. [PMC free article] [PubMed]