Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2020 Jan 1.
Published in final edited form as: J Neurosci Methods. 2018 Sep 26;311:408–417. doi: 10.1016/j.jneumeth.2018.09.026

Cognitive Tasks and Human Ambulatory Electrocorticography using the RNS System

Stephen Meisenhelter a,*, Markus E Testorf b,c, Mark A Gorenstein c, Nicholas R Hasulak d, Thomas K Tcheng d, Joshua P Aronson c, Barbara C Jobst a,c
PMCID: PMC6439470  NIHMSID: NIHMS1508820  PMID: 30267724

Abstract

3.1. Background

Electrocorticography studies are typically conducted in patients undergoing video EEG monitoring, but these studies are subject to confounds such as the effects of pain, recent anesthesia, analgesics, drug changes, antibiotics, and implant effects.

3.2. New Method

Techniques were developed to obtain electrocorticographic (ECoG) data from freely moving subjects performing navigational tasks using the RNS® System (NeuroPace, Inc., Mountain View, CA), a brain-responsive neurostimulation medical device used to treat focal onset epilepsy, and to align data from the RNS System with cognitive task events with high precision. These subjects had not had recent surgery, and were therefore not confounded by the perioperative variables that affect video EEG studies.

3.3. Results

Task synchronization using the synchronization marker technique provides a quantitative measure of clock uncertainty, and can align data to task events with less than 4ms of uncertainty. Hippocampal ECoG activity was found to change immediately before an incorrect response to a math problem compared to hippocampal activity before a correct response. In addition, subjects were found to have variable but significant changes in theta band power in the hippocampus during navigation compared to when subjects were not navigating. We found that there is theta-gamma phase-amplitude coupling in the right hippocampus while subjects stand still during a navigation task.

3.4. Comparison with Existing Methods

An alignment technique described in this study improves the upper bound on task-ECoG alignment uncertainty from approximately 30ms to under 4ms. The RNS System is one of the first platforms capable of providing untethered ambulatory ECoG recording in humans, allowing for the study of real world instead of virtual navigation. Compared to intracranial video EEG studies, studies using the RNS System platform are not subject to confounds caused by the drugs and recent surgery inherent to the perioperative environment. Furthermore, these subjects provide the opportunity to record from the same electrodes over the course of many years.

3.5. Conclusions

The RNS System enables us to study human navigation with unprecedented clarity. While RNS System patients have fewer electrodes implanted than video EEG patients, the lack of external artifact and confounds from recent surgery make this system a useful tool to further human electrophysiology research.

Keywords: RNS System, Memory, Navigation, Ambulatory ECoG, ECoG, Electrocorticography, Epilepsy, Cognition


10.1. Background

Electrocorticography studies are typically conducted in patients undergoing video EEG monitoring, but these studies are subject to confounds such as the effects of pain, recent anesthesia, analgesics, drug changes, antibiotics, and implant effects.

10.2. New Method

We developed techniques for using the NeuroPace RNS® System, a brain-responsive neurostimulation system to treat partial onset epilepsy, to obtain electrocorticographic (ECoG) data from freely moving subjects performing navigational tasks in a research setting.

10.3. Results

Task synchronization using the synchronization marker technique provides a quantitative measure of clock uncertainty, and can align data to task events with less than 4ms of uncertainty. We found that hippocampal ECoG activity changes during parts of a free recall task and during navigation.

10.4. Comparison with Existing Methods

An alignment technique described in this study improves the upper bound on task-ECoG alignment uncertainty from approximately 30ms to under 4ms. The RNS System is one of the first platforms capable of providing untethered ambulatory ECoG recording in humans, allowing for the study of real world instead of virtual navigation.

10.5. Conclusions

The RNS System enables us to study human navigation with unprecedented clarity. While RNS System patients have fewer electrodes implanted than video EEG patients, the lack of external artifact and confounds from recent surgery make this system a useful tool to further human electrophysiology research.

4. Introduction

Electrocorticographic (ECoG) recording is a widely used technique in human neuroscience research. Studies using ECoG recording often seek to gain a better understanding of the neurophysiology of cognition by correlating subject behavior with electrical signals from the cortical surface or from depth electrodes targeting deep brain structures[1]. Since the implantation of intracranial electrodes is associated with surgical risk, human subjects are usually recruited from a pool of epilepsy patients who have electrodes temporarily implanted for video EEG monitoring prior to epilepsy surgery[1, 2].

While this scenario provides an ethically acceptable means of recording ECoG signals, it suffers from a number of inherent confounding factors[3]. In particular, patients are typically tethered to the recording equipment. As a result, tasks involving navigation often rely on movement in a virtual environment. Several studies have questioned the equivalence of virtual and physical environments in human neuroscience research[4]. Perhaps even more important is that subjects are asked to perform cognitive tasks only days after the implantation procedure, while they are still recovering from the surgical injury[3]. Patients’ cognitive abilities may be affected by antibiotics, recent anesthesia, and analgesic medications they receive as part of their perioperative care. There is also evidence that electrode impedances change for several weeks after implantation[5], likely due to the healing process at the electrode-brain interface[6]. Furthermore, at many epilepsy centers clinicians attempt to provoke seizures during video EEG monitoring by reducing anti-epilepsy drugs (AEDs). Existing literature indicates that tapering AEDs alters background EEG activity and cognitive performance[7, 8, 9], an effect that is likely to confound the results of ECoG studies conducted with these subjects.

While these factors are significant and widely recognized, until very recently this was the only way to conduct ECoG studies involving human subjects. This article reports on the use of the RNS® System (NeuroPace, Inc.) in a research study, which eliminates the confounding factors described above by testing ambulatory subjects months to years after surgery.

The RNS System consists of a chronically implanted neurostimulator and leads and was approved by the FDA in 2013 for use as an adjunctive therapy for focal onset seizures in individuals aged 18 years of age or older. The neurostimulator continuously screens ECoG for characteristic patterns of epileptiform activity, individualized to the patient, and delivers responsive neural electrical stimulation if these patterns are detected. The RNS System was effective in reducing median seizure frequency by up to 70% in clinical trial patients at 6 years of follow-up[10]. Using this system, it is possible to obtain recordings from the same electrodes over several years and in an ambulatory setting. In a research setting, the neurostimulator can be configured to collect research data while simultaneously delivering clinically indicated therapy.

Devices like the RNS System provide unprecedented access to the human brain for neuroscience research. However, the RNS System was not initially designed for research applications, and the system lacks many features that are typically found on intracranial recording systems. For instance, there is no provided method to export data from the system in real-time, and until recently, recordings were limited in duration to four minutes. Also, there is no built-in method for an external computer to programmatically control the programmer to send commands to the neurostimulator. Since the RNS System is an FDA regulated medical device, it is not permissible to modify any part of the system, including the programmer software, to add features required for research studies.

This study details the steps necessary to use the RNS System in research applications and demonstrates how this can be accomplished without modifying the RNS System. Use of the RNS System system during recording sessions as well as the handling and processing of ECoG data are both described.

The discussion is complemented by preliminary findings from cognitive tasks which demonstrate the capabilities of the RNS System platform for ECoG recording. This includes a free recall task that demonstrates programmatic control of aspects of the neurostimulator. In addition, a spatial navigation task was conducted in which subjects navigated through a physical environment with no tether. Our results correlate the spectral properties of the recorded data with behavior and validate the quality of data obtained from the RNS System.

5. Materials and Methods

This study was conducted with the approval and supervision of the Dartmouth College Committee for the Protection of Human Subjects. Subjects provided their written informed consent prior to enrollment in this study.

5.1. The RNS System

The RNS System (NeuroPace, Inc., Mountain View, CA) is a closed-loop brain-responsive neurostimulation system and was developed as an adjunctive therapy for focal onset epilepsy. This study was conducted using the RNS-300M Neurostimulator and a laptop-based Programmer. Patients are implanted with 2 intracranial leads with four contacts each, located at and around the seizure onset zone. The neurostimulator replaces a section of the patient’s skull, is extradural, does not protrude above the skull, and; since it is under the scalp, is not visible externally. The neurostimulator continuously monitors ECoG activity in four bipolar channels. The detection algorithms continuously screen ECoG activity and the device delivers electrical stimulation in response to detected epileptiform activity. Patients cannot normally perceive stimulation being delivered. The neurostimulator is programmed to save an ECoG record (a short period of ECoG data, generally around 90 seconds) in response to several conditions, including detection of electrographic seizure patterns, abnormal ECoG activity that persists beyond a programmed duration, and time of day. The neurostimulator has various detection algorithms (line length, area under the curve, band-pass) that can be configured by a clinician to detect a patient’s epileptiform activity. Patients can also manually save ECoG records by swiping a magnet over the neurostimulator. Patients and clinicians interact with the RNS System through the use of a Programmer and Wand, consisting of a laptop computer and a handheld short range wireless transceiver (Fig. 1). Using these tools, clinicians can update detection and stimulation parameters and download previously stored ECoG data, freeing space for additional recordings. The neurostimulator is powered by an internal primary cell battery. The neurostimulators used in this study (RNS-300M) were estimated to be replaced every 3–5 years. All recordings were made at 250 samples per second, per channel, using a hardware bandpass filter set at 4–90Hz.

Figure 1:

Figure 1:

Computer control of the RNS System is achieved through the use of Research Accessories. The task computer runs the cognitive task and issues commands to the Programmer Accessory. The Programmer Accessory is a microcontroller that connects to the Programmer via USB and appears as a computer mouse to the Programmer. It receives commands from the task computer and translates them into mouse movements on the Programmer to directs it to capture ECoG recordings from the neurostimulator using the Wand. The Wand is a wireless transceiver that communicates with the neurostimulator. The Wand Accessory inserts synchronization markers into the data stream when commanded by the Programmer Accessory.

5.2. Subject Population

The RNS System was used to record ECoG data from six subjects during this study, as show in Table 1. Three subjects had two hippocampal depth electrodes, each with 4 contacts, placed bilaterally.

Table 1:

Demographic and electrode information for subjects participating in this study. PIQ = performance intelligence quotient (WAIS-III), VIQ = verbal intelligence quotient (WAIS-III). Subject 5’s electrodes in the primary motor area are in the hand and face areas.

Subject 1 2 3 4 5 6

Age 52 36 57 53 31 45
Language Dominance Left Left Left Left Left Left
Years Since Implant 8 8 1 9 2 1.5
Electrode Placement Bilateral Hipp. Bilateral Hipp. Bilateral Hipp. L. Hipp, L. Lat. Neocortex L. Primary Motor L. Frontal Parietal L. Hipp, L. Temp. Cortex
Seizure Onset Zone Bilateral Hipp. Bilateral Hipp. Bilateral Hipp. L. Hipp. L. Frontal L. Hipp.
Distribution of Sustained Epileptiform Activity 60% Left, 40% Right >90% Right Bilateral, Right leading left >90% Left Left Left
Seizure Reduction with RNS System 66% 60% 40% 80% 90% 75%
VIQ (WAIS-III) Not Available 82 110 105 101 103
PIQ (WAIS-III) Not Available 97 103 109 95 88

Because our subjects live throughout a large region of upper New England, their participation in this study was scheduled to coincide with their periodic clinical visits. Subjects typically participate in the experimental tasks and then proceed with their clinical appointment. All subjects participated voluntarily and provided written informed consent to participate in this study. The subjects received a small stipend to compensate for travel costs.

5.3. Communicating with the Neurostimulator

There are several ways that ECoG recordings can be saved from the RNS System.First, ECoG can be streamed to the Programmer for up to four minutes while the Programmer is in communication with the neurostimulator. After four minutes, this “Real-Time ECoG” must be stopped and stored to the Programmer hard drive, resulting in an interruption of the real-time data for several seconds. Second, momentarily applying a magnetic field to the neurostimulator will trigger ECoG storage, typically of the previous 60 seconds and the subsequent 30 seconds. This is generally done using a small magnet. Third, the neurostimulator can be programmed by a clinician to make scheduled recordings. Lastly, ECoG storage may be triggered by a variety of userconfigurable detection events. The RNS System can store approximately 7.5 minutes of 4-channel ECoG data to its internal memory, which may then be downloaded to the Programmer. ECoG storage can be configured to record multiple shorter segments of ECoG that total to approximately 7.5 minutes of 4-channel data.

The RNS System was designed as a therapeutic system, meaning that there is no built-in method to control the neurostimulator programmatically using a research computer or to synchronize ECoG recordings from the neurostimulator with a cognitive task. Because the neurostimulator is implantable, it lacks the DC inputs that are commonly found on intracranial monitoring equipment and are often used to insert synchronization markers during video EEG studies.

A prototype system, collectively termed Research Accessories, was developed in collaboration with NeuroPace for controlling the RNS System programmatically. This system consists of two hardware components: the Programmer Accessory and the Wand Accessory (Fig 1).

The Programmer Accessory is a custom circuit board combined with a commercially available, open-source microcontroller (Arduino Due) that provides the capability to start and stop RNS System recordings using the “Real Time ECoG” feature, and to save those recordings. The Arduino emulates a computer mouse on the Programmer using an open-source library (Mouse, Arduino). Commands are sent to the Arduino through a serial-over-USB connection from a task computer, and consist of single ASCII characters. Upon receipt of the real-time ECoG command, the Arduino causes the mouse pointer on the Programmer to move to, and click on, the Stop button of the Programmer interface, and then the Store button, followed by the Start button to re-start the Real-Time ECoG recording. A Python-based tool was developed to provide a user-friendly application programming interface to the Programmer Accessory.

The Wand Accessory is an attachment that fits over the NeuroPace Wand and provides the capability to insert synchronization markers into ECoG data while using the “Real Time ECoG” feature of the RNS System. The Wand Accessory receives power and commands via the Programmer Accessory. This device consists of a coil antenna, custom circuit board and microcontroller. When the Programmer Accessory activates the “Mark” command, the Wand Accessory inserts a synchronization marker into the real-time ECoG signal by applying a brief electrical pulse to the coil antenna, briefly interrupting the telemetry signal during ECoG value transmission and resulting in a repeatable and temporally-precise artifact. As telemetry noise may cause similar artifacts on the real-time ECoG signal, the pattern of interruption was chosen to be a unique multi-sample artifact that is easily detected in post-processing of the signal.

Data from the Programmer were uploaded to the Patient Data Management System (PDMS), as is done routinely during the normal clinical usage of the RNS System. Data were then delivered to the investigators upon request using a secure data transfer method (Box.com). ECoG data for the experiment are described by a catalog file containing a table of metadata (such as recording type, start time, etc.) and individual binary waveform files for each ECoG recording.

5.4. Synchronization of Real-Time ECoG with Task Data

During the free recall task described in section 5.5, we used the “Real-Time ECoG” feature of the RNS System to capture data. Using this mode of recording allows us to insert synchronization markers into ECoG data in order to more precisely assess the alignment of ECoG and task data.

The Wand Accessory was used to insert synchronization markers into ECoG data from the neurostimulator. As shown in Fig 2, the synchronization markers appear in-band, raising the possibility of misidentifying synchronization markers as ECoG data, or misidentifying high amplitude ECoG data as a synchronization marker. To reduce the possibility of marker detection errors, the markers used in this study consist of three peaks, each with a width of one sample. The peaks are spaced so that the first two have three samples of unmodified ECoG between them, with the third following seven samples later. A section of ECoG is considered to be a marker when this set of three artifacts is detected in at least two channels simultaneously.

Figure 2:

Figure 2:

Task events are aligned to synchronization markers in ECoG data using coherent point drift. Synchronization markers are inserted into the stream of ECoG data using the Wand Accessory (red). The task computer records when it issues commands to insert a synchronization marker (light blue). During data preprocessing, synchronization markers in the task data are automatically recognized (purple) by seeking out a characteristic pattern of three peaks at specific intervals in the ECoG data occurring in multiple channels simultaneously. High amplitude deflections that are not synchronization markers, such as transient telemetry dropouts (dark blue), are not detected as synchronization markers because they do not match this specific pattern in multiple channels simultaneously. A mapping is then computed from the task computers timeline to the ECoG timeline (green). Timestamps for task events are warped using this mapping to fit onto the ECoG timeline. The recording segment shown is approximately 93 seconds in duration, and was recorded using the Real-Time ECoG technique.

ECoG data was processed to recover timestamps of synchronization markers as they were recorded by the RNS System neurostimulator, forming a gold standard timeline for each trial. We also obtained the timestamps of synchronization markers for each trial as recorded by the task computer. The clock in the RNS System neurostimulator and the clock in the task computer were not running at the same rate. Furthermore, the difference between the rates of the two clocks appeared to vary. Contributors to this variability may include a <4ms delay for alignment with the 4ms ECoG data samples, a <8ms delay for alignment with 8ms wireless telemetry frames, or clock variability.

To properly align the clocks, we implemented the coherent point drift algorithm[11] for point set registration. This technique uses an iterative expectation-maximization method to compute a smooth transformation between two noisy sets of n-dimensional data, matching the points in one data set to their corresponding points in the second dataset. During each iteration, the algorithm uses a Gaussian mixed model to compute the most likely correspondence between the synchronization marker timestamps as recorded in the task computer and as detected in the ECoG data. It then computes the transformation required to warp the timestamps recorded by the task computer to the centroids for those markers in the Gaussian mixed model. These two steps are repeated 150 times, by which point the calculated transformation is stable. We used the final calculated transformation to transform the other trial events (stimulus onset, word recall, math problem answer entry) to the gold standard timeline (Fig. 2).

5.5. Free Recall Task

A task based on a free recall paradigm, validated in previous studies[12], was utilized (Fig. 3a). For each of 25 trials, subjects were shown a sequence of twelve words, with each word presented for 1.6 seconds with 1.35–1.85 seconds between words. The spacing between words allowed for the insertion of synchronization markers, with jitter, and one second of ECoG with no synchronization markers between each pair of words. After each word list, subjects solved simple math problems for thirty seconds to prevent them from mentally rehearsing the presented words. They then had thirty seconds to verbally recall any words they remembered from the list that was just presented. Stimuli were presented on a 15” Macbook pro (Apple, Inc., Cupertino, CA) positioned within reach of the subjects.

Figure 3:

Figure 3:

Overview of free recall and navigation tasks. In the free recall task (a), subjects were presented with lists of twelve words. Following a thirty second math distractor task, subjects were prompted to recall as many words as possible from the word list. In the navigation task, subjects navigated through a section of the Dartmouth Hitchcock Epilepsy Clinic (b). While navigating, subjects listened to auditory instructions to stand, walk, and swipe their magnet across their neurostimulator (c).

We collected this data using the “Real-Time ECoG” technique. We inserted pairs of synchronization markers after presentation of each word with random jitter between the markers in each pair so that the markers were separated by 350–850ms. The random jitter between markers was intended to make alignment of task events with ECoG data less ambiguous. Since the synchronization markers are in-band, they were placed in sections of ECoG that we did not intend to analyze. We also inserted markers every 4000ms during the recall section of the experiment. During analysis of data from this task, segments of data that contained synchronization marker artifacts were excluded. Immediately before the beginning of each trial we reset the “Real-Time ECoG” telemetry link using the Programmer Accessory to avoid gaps in ECoG data during the experimental trials.While the precise length of each trial varies slightly due to the timing of the subjects’ responses to the “Start Trial” prompt and the speed at which they complete the last presented math problem, the mean trial duration was 101±5.4 seconds.

5.6. Navigation Task

Subjects navigated through the hallways of the Dartmouth-Hitchcock Medical Center Epilepsy Clinic in a square shaped loop. Because the analyses that were planned for this experiment did not require highly accurate synchronization of the task timestamps and ECoG, it was not necessary to use the “Real-time ECoG” technique with synchronization markers. For this task, we used recordings triggered by swiping a magnet across the neurostimulator. A set of recorded audio instructions directed participants to start and stop walking in 15 second intervals for 90 seconds (Fig 3c). Subjects kept their eyes open for visual cues. At 60 seconds into the trial, the participants were instructed to swipe a magnet over the neurostimulator, triggering a 90 second recording encompassing the previous 60 seconds and the next 30 seconds. ECoG data were retrieved from the subjects’ neurostimulators after each trial, and the standing and navigating segments were isolated from the recordings based on the timing of when instructions were given to start and stop navigation. To account for variance in the subjects’ reaction times to instructions, 1.5 seconds was trimmed from the beginning and end of each ECoG segment. Subjects were observed during the testing, and any deviations or noticeably delayed reactions to instructions were recorded and used to remove invalid trials. As we used the magnet recording function to collect data for this task, there are no synchronization markers present in this data set.

5.7. Statistics and Data Analysis

5.7.1. Software Tools

Unless otherwise stated, data were analyzed using Python3 with Pandas, NumPy, and SciPy libraries. A software suite was created using Python and PostgreSQL to automatically manage task information and process data from the RNS System.

5.7.2. . Data Quality Preservation

During all analyses of data collected using the “Real-time ECoG” technique, we excluded data in which telemetry was lost by excluding epochs in which the value in all channels is −512, the minimum value reported by the RNS System.

We placed synchronization markers so that they would not be inserted in the sections of the task that we were primarily interested in analysing. Nonetheless, we used the marker detection technique described in section 5.3 to ensure that data that was being analysed did not contain extraneous synchronization markers. Trials in which the number of markers sent did not equal the number of markers detected were excluded from analysis.

Upon close inspection of the spectral characteristics of ECoG data from some RNS System neurostimulators, we found that two or more channels contain an offset of 32 units on every 64th sample. The samples on which this error occurs can be detected by separately splitting a long section of ECoG data from each channel into 64 sample segments and averaging the segments to look for an outlier at one index. Prior to data analysis, we programmatically examined data from each channel using this technique and corrected the 32 unit offset.

5.7.3. Power Spectra

ECoG recorded during the free recall and navigation tasks were used to generate power spectra. For power spectra generated using ECoG from the free recall task, 500ms segments of ECoG ending when the subjects entered a response to a math distractor were collected. These segments were screened to ensure that they do not contain synchronization markers or other artifacts. For power spectra generated using ECoG from the navigation task, ECoG data collected during the task were divided into nonoverlapping 4 second segments. As these data were collected using the magnet recording function, there are no synchronization markers or telemetry loss artifacts present in this data.

All of the data (correct and incorrect response, or standing and navigating) were then z-scored together on a per-channel level. We used this z-scored data to compute power spectra using multitaper spectral estimation with discrete prolate spheroidal sequence tapers as implemented in the Python Spectrum module[13].

Differences between power spectra were tested for statistical significance using Efron’s bias corrected accelerated non-parametric bootstrapping [14], as implemented in the Scikits-bootstrap library, on the difference between the spectra to generate a 99% confidence interval from 10,000 rounds of resampling for the difference between navigating and standing spectra at each frequency. Due to the 4Hz high pass filter built into the RNS neurostimulator, power spectra in this study were cropped at 4Hz.

5.7.4. Phase Amplitude Coupling

ECoG recorded during the navigation task were used to generate comodulograms. These data were collected using the magnet recording function, so there are no synchronization markers or telemetry loss artifacts present in this data. ECoG data were divided into non-overlapping 4 second long segments. The standing and navigating data were then z-scored together on a per-channel level. We used the pactools Python library to calculate phase amplitude coupling (PAC) using the driven auto-regressive model technique as described in Dupré la Tour et al. 2017 [15]. Statistical significance was tested by computing PAC 500 times with randomly shifted phases and marking areas as significant where the actual PAC maximum is in the 95th percentile of calculated PAC maxima.

5.8. Code Availability

Code used for data analysis and interfacing with the Research Accessories, as well as further information on the Research Accessories can be made available upon reasonable request to the authors.

6. Results

6.1. Coherent point drift successfully aligns ECoG and task events

ECoG recordings from the RNS System were processed to locate synchronization markers in the data. We found that the markers could be detected with high accuracy (Fig 4a). Trials in which there was a mismatch between the number of markers detected and the number of markers sent were excluded from analyses. The timing of synchronization markers within the ECoG data relative to commands transmitted by the task computer was characterized by aligning the first detected marker timestamp from the RNS System with the first record of a marker command from the task computer and comparing the differences in time between the subsequent marker events in the remainder of each trial. Up to 6ms/min variability was observed. Coherent point drift was implemented to warp the timestamps recorded by the task computer to better fit the RNS System synchronization markers.

Figure 4:

Figure 4:

(a): Synchronization markers were detected with high accuracy. During each trial, 31 markers were used for alignment. This plot shows the difference between the number of markers sent and the number of markers detected across all trials. (b): Distribution of average alignment error after coherent point drift. Most trials that are aligned within the 40ms bar have a mean error of <8ms. In practice, due to the 250Hz sampling rate of the RNS System, this means that the task event is aligned on or next to the sample on which it actually occurred.

To measure the effectiveness of our alignment technique, the mean differences between timestamps of synchronization markers as computed by coherent point drift and the same timestamps as recorded by detected synchronization markers in the ECoG data were computed (Fig. 4b). There were on average less than two samples (8ms) of mean error between the two sets of timestamps in trials that were successfully aligned (mean alignment error of <40ms). Furthermore, this mean alignment error metric provides a method of excluding trials that have unacceptably large alignment uncertainty for a given analytical technique.

6.2. Hippocampal ECoG changes during math tasks

During the free recall task, subjects were asked to answer math questions between the encoding and recall phases of the task. During this task we recorded ECoG using the synchronization marker technique (Section 5.5). Hippocampal ECoG had high amplitude deviations from baseline prior to the times when subjects entered an incorrect answer to a math problem compared to when they answered a correct answer to a math problem. Power spectral analysis revealed that subjects had significant changes in response to incorrect math answers (Fig. 5). However, these changes were not consistent between subjects. Subjects 2 and 3 had changes in low frequencies, while subjects 1 and 4 had changes in high frequencies.

Figure 5:

Figure 5:

Individual differences in power spectra when answering math questions correctly or incorrectly. The one second period centered on entering the answer to a math question was analysed for differences in spectral power. Areas highlighted in orange are significantly different with α < 0.01. Subject 6 data was not significance tested due to low sample size.

6.3. Hippocampal response to spatial navigation is variable

Studies in rodents have found that hippocampal theta rhythms are linked to spatial navigation and memory. In rodents, theta power is generally observed to increase when the animals are navigating through an environment[16]. Furthermore, theta waves related to navigation are phase locked to higher frequency oscillations in the neocortex, suggesting a coordinating role for hippocampal theta[17].

In human virtual environment experiments, studies have demonstrated that there is an increase in the 1–4Hz band during navigation which corresponds to the theta oscillations observed in rodents[18, 19]. However, the shift in the frequency range of these oscillations is not fully understood.

Of the six subjects tested, five had electrodes placed in the hippocampus and performed the navigation task. During this task we recorded ECoG using the magnet technique (Section 5.6). Using data from these subjects, each 90 second ECoG recording was split into 12 second epochs of standing and navigating. A mean power spectrum for each subject was then computed by subdividing each epoch into 4 second periods, computing the Fourier transform for the period, and averaging the resulting spectra across trials.

The hippocampal response to navigation was found to vary greatly greatly between these subjects (Fig. 6). One subject showed a bilateral decrease in hippocampal theta power during navigation compared to standing still. A second subject showed a unilateral decrease in theta during navigation, but an increase in theta on the opposite side. A third subject showed a bilateral increase in theta power during navigation, more consistent with existing animal studies.

Figure 6:

Figure 6:

Individual differences in navigation response. Rows represent individual subjects, with columns for left and right hippocampal power. Some subjects’ electrodes were placed outside of the hippocampus and were not analyzed for this task. Areas highlighted in orange are significantly different with α < 0.01.

6.4. Theta phase modulates gamma amplitude in the right hippocampus during standing

We computed phase-amplitude coupling using data from all subjects during navigation and when standing still (Fig. 7). During standing, there was significant (p<0.05) phase-amplitude coupling in the right hippocampus, with theta phase influencing gamma power at 40Hz, 70Hz, and 96Hz.

Figure 7:

Figure 7:

Theta phase is coupled to gamma amplitude in the right hippocampus while standing. Statistically significant (p<0.05) regions are enclosed in red contours.

7. Discussion

The RNS System is a viable platform for studies seeking to record intracranial EEG from ambulatory human subjects. The ECoG signal does not degrade due to subject movement, and data can be recovered from the neurostimulator at the end of each trial. This system provides high quality recordings that avoid many of the problems of traditional video EEG techniques in exchange for fewer electrodes and a lower sampling rate.

When running cognitive tasks using the RNS System, it is inevitably necessary to align synchronization markers in the ECoG recordings with synchronization commands sent by the task computer. In addition to having a fixed offset, these clocks may run at slightly different speeds and have different noise profiles. We have demonstrated a method to use synchronization markers inserted into the ECoG data (in a research setting) to transform task events into the timeline used by the neurostimulator. This method results in a smooth transformation that preserves the constant sampling rate of the neurostimulator for convenient analysis.

In this study we chose to assume that the neurostimulator clock as the authoritative time source during alignment. While a quantitative examination of the stability of this clock would be informative, we believe that the clock onboard the neurostimulator is likely more accurate than the clock onboard the Macbook Pro laptop used as the task computer in this study. Because the neurostimulator runs only a limited set of routines, there is less concern that a command to record the current time would be interrupted by the CPU scheduler than on a system with a fully-featured operating system. We suspect that the contribution to error from the hardware components of the clock are much smaller than the contributions from the design of the software for polling the system time.

We found that adding random jitter between the pairs of synchronization markers during the encoding epochs of the free recall task did not noticeably aid alignment. This is likely because the large differences in the pattern of synchronization markers used in different epochs of our task contributed more to correspondence determination than the relatively small amount of jitter between pairs of markers in the encoding epoch. Jitter would likely have been more useful if markers throughout the task were spaced relatively evenly and more sparsely.

Not all cognitive tasks will require the precise time synchronization afforded by the Research Accessories. The benefits of precise timing should be weighted against the cost of disruption of the ECoG signal by synchronization markers when choosing an alignment technique. Likewise, the exact pattern of synchronization markers to insert into a trial depends on this weighting. For studies investigating transient, short-lived, neural events, we recommend including frequent synchronization markers when collecting preliminary data for any study so that the behavior of each individual experimental system can be characterized prior to the beginning of the main experiment. After the timing properties of the system are understood, the frequency of synchronization markers can be scaled back as appropriate to the task.

We are aware of one existing study in which the RNS System is used in a task that requires precise alignment of task data with presented stimuli. In Rao et al.[20], one subject with electrodes placed on the temporal lobe over speech areas listened to a large corpus of sentences containing a complete set of English language speech sounds while ECoG was recorded. A second subject participated in a naming task while ECoG was recorded. This study used the “Real-Time ECoG” function of the RNS System but without synchronization markers. For synchronization with task data, the authors used two methods: alignment using a characteristic neural response to the task stimulus, and alignment using a video recording encompassing both the task computer and a live view of the ECoG. The authors indicate that alignment using the neural response generally aligns trials with a standard deviation of 30.5ms. The authors indicate that the video recording has a best-case upper bound on alignment error of approximately 60ms due to the framerate of the video recording. It is also likely that there is a slight lag between when the ECoG data is received by the Programmer and when the data is plotted on screen. However, we believe that our study is the first to use synchronization markers to improve alignment between ECoG data and task events. We summarized the differences between these alignment techniques in Table 2.

Table 2:

Comparison of techniques for synchronizing ECoG data and task events using the RNS System.

Sync Markers Magnet (Aghajan et al.) Video Sync (Rao et al.) Neural Response (Rao et al.)

Best-case alignment certainty 4 ms 125 ms 60 ms 30 ms
Mobility Tethered Free Tethered Free
In-band artifact Yes No No Yes

We investigated whether we could identify biomarkers of memory in the human hippocampus during a free recall task. Subjects performing the free recall task recalled very few words per list. This is consistent with subjective reports of memory deficits reported by these subjects. The subjects’ poor memory performance highlights that high numbers of trials are often necessary to obtain sufficient statistical power in studies of memory impairment. We saw that while the power spectra changed within individuals between correct and incorrect recall, the changes were not consistent between subjects. This may be due to differences in the precise electrode location in the hippocampus.

Varying hippocampal responses to navigation were observed. The left hippocampus, which was part of the dominant hemisphere in all subjects, is particularly variable. It is unclear whether this is an effect of variation in the subjects’ epilepsy or whether this indicates that the normal hippocampal response to navigation is variable in humans. Based on results of virtual navigation studies, it has been suggested that human navigation is associated with a lower frequency band than in rodent studies[19, 21]. Due to the neurostimulator’s 4Hz high pass filter, we could not confirm the presence of this lower frequency band in a real world environment.

There are two existing studies of which we are aware that investigated real-world ambulatory ECoG. In Bohbot et al.[4], five patients undergoing video EEG monitoring explored a room to find hidden areas of the room with pressure sensitive pads. The subjects also walked around in the room with no goal for several minutes. As in Bohbot et al., theta power increases during navigation were not observed in all hippocampal electrodes in our study. Furthermore we did not observe a group-level difference in theta power across all of our subjects. Unlike in Bohbot et al., we observed a significant decrease in theta power during navigation in some subjects.

In Aghajan et al.[22], four subjects participated in a navigation task in which they were asked to move in either straight or circular paths at either slow or fast speeds. They found an increase in theta band power (defined as 3–12Hz) in the medial temporal lobe during navigation, but occuring in short bursts. While we saw changes in theta power in some electrodes during navigation, we did not consistently see an increase in short theta bursts. We computed mean theta power over three second sections of ECoG, which may have limited our ability to detect short bursts of theta as described in Aghajan et al. Furthermore, Aghajan et al. used a range of 3–12Hz for analyses of the theta band. This range notably extends below the 4Hz high pass filter which is built into the neurostimulator. Our study considers only frequencies above 4Hz for analyses of the theta band. While we are unable to assess the subjects’ walking velocities with this experimental design, the analyses we present in this study are not thought to be dependent on the precise speed or direction of motion of the subject during the navigation condition.

We have also found that theta phase is coupled to gamma power in the right hippocampus during standing, but not during navigation. PAC in the hippocampus has been previously found in rodents[23]. There is evidence that hippocampal phase amplitude coupling may play a role in the pairing of items with their context in rodents[24].

After this study was completed, NeuroPace released the RNS-320 Neurostimulator, with approximately twice the battery life and memory as the RNS-300M, and a tablet-based Programmer that allows capture of hours-long ECoG Recordings. Although most patients with the RNS System currently have the RNS-300M, this new system should alleviate some of the challenges inherent to recording long continuous segments of ECoG in the coming years.

Studies using the RNS System can provide answers to important questions that cannot be adequately studied in the perioperative setting. This experience indicates that a direct-brain neurostimulator platform can be modified to support research to better understand human functional electrophysiology.

Supplementary Material

1

1. Highlights.

  • Programmatic control of the RNS System in a cognitive task is demonstrated

  • Acquisition of ambulatory electrocorticography in human subjects is demonstrated

  • The RNS System provides data of suitable quality for research studies

8. Acknowledgements

We would like to thank the participants in the studies that contributed data to this work. We would also like to thank the staff of the Dartmouth-Hitchcock Medical Center, without whom this study would not have been possible.

This work was supported by the National Institutes of Health (R01-NS074450) and by the National Science Foundation (EPSCoR-1632738).

NeuroPace, Inc. provided the Research Accessories used in this study, but no additional financial support.

Footnotes

Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final citable form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

References

  • [1].Guillory SA, Bujarski KA, Exploring Emotions Using Invasive Methods: Review of 60 Years of Human Intracranial Electrophysiology, Social Cognitive and Affective Neuroscience 9 (12) (2014) 1880–1889, ISSN 1749–5016, doi: 10.1093/scan/nsu002. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [2].Jacobs J, Kahana MJ, Direct Brain Recordings Fuel Advances in Cognitive Electrophysiology, Trends in Cognitive Sciences 14 (4) (2010) 162–171, ISSN 1364–6613, doi: 10.1016/j.tics.2010.01.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [3].Lachaux JP, Rudrauf D, Kahane P, Intracranial EEG and Human Brain Mapping, Journal of Physiology-Paris 97 (4) (2003) 613–628, ISSN 0928–4257, doi: 10.1016/j.jphysparis.2004.01.018. [DOI] [PubMed] [Google Scholar]
  • [4].Bohbot VD, Copara MS, Gotman J, Ekstrom AD, Low-Frequency Theta Oscillations in the Human Hippocampus during Real-World and Virtual Navigation, Nature Communications 8 (2017) 14415, ISSN 2041–1723, doi: 10.1038/ncomms14415. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [5].Sillay KA, Rutecki P, Cicora K, Worrell G, Drazkowski J, Shih JJ, Sharan AD, Morrell MJ, Williams J, Wingeier B, Long-Term Measurement of Impedance in Chronically Implanted Depth and Subdural Electrodes During Responsive Neurostimulation in Humans, Brain Stimulation 6 (5) (2013) 718–726, ISSN 1935–861X, doi: 10.1016/j.brs.2013.02.001. [DOI] [PubMed] [Google Scholar]
  • [6].Williams JC, Hippensteel JA, Dilgen J, Shain W, Kipke DR, Complex Impedance Spectroscopy for Monitoring Tissue Responses to Inserted Neural Implants, Journal of Neural Engineering 4 (4) (2007) 410, ISSN 1741–2552, doi: 10.1088/1741-2560/4/4/007. [DOI] [PubMed] [Google Scholar]
  • [7].Zaveri HP, Pincus SM, Goncharova II, Novotny EJ, Duckrow RB, Spencer DD, Blumenfeld H, Spencer SS, Background Intracranial EEG Spectral Changes with Anti-Epileptic Drug Taper, Clinical Neurophysiology 121 (3) (2010) 311– 317, ISSN 1388–2457, doi: 10.1016/j.clinph.2009.11.081. [DOI] [PubMed] [Google Scholar]
  • [8].Salinsky MC, Oken BS, Storzbach D, Dodrill CB, Assessment of CNS Effects of Antiepileptic Drugs by Using Quantitative 412 EEG Measures, Epilepsia 44 (8) (2003) 1042–1050, ISSN 1528–1167, doi: 10.1046/j.1528-1157.2003.60602.x. [DOI] [PubMed] [Google Scholar]
  • [9].Zaveri HP, Pincus SM, Goncharova II, Novotny EJ, Duckrow RB, Spencer DD, Spencer SS, A Decrease in EEG Energy Accompanies Anti-Epileptic Drug Taper during Intracranial Monitoring, Epilepsy Research 86 (2–3) (2009) 153–162, ISSN 0920–1211, doi: 10.1016/j.eplepsyres.2009.06.002. [DOI] [PubMed] [Google Scholar]
  • [10].Jobst BC, Kapur R, Barkley GL, Bazil CW, Berg MJ, Bergey GK, Boggs JG, Cash SS, Cole AJ, Duchowny MS, Duckrow RB, Edwards JC, Eisenschenk S, Fessler AJ, Fountain NB, Geller EB, Goldman AM, Goodman RR, Gross RE, Gwinn RP, Heck C, Herekar AA, Hirsch LJ, King-Stephens D, Labar DR, Marsh WR, Meador KJ, Miller I, Mizrahi EM, Murro AM, Nair DR, Noe KH, Olejniczak PW, Park YD, Rutecki P, Salanova V, Sheth RD, Skidmore C, Smith MC, Spencer DC, Srinivasan S, Tatum W, Van Ness P, Vossler DG, Wharen RE, Worrell GA, Yoshor D, Zimmerman RS, Skarpaas TL, Morrell MJ, Brain-Responsive Neurostimulation in Patients with 423 Medically Intractable Seizures Arising from Eloquent and Other Neocortical Areas, Epilepsia 58 (6) (2017) 1005–1014, ISSN 1528–1167, doi: 10.1111/epi.13739. [DOI] [PubMed] [Google Scholar]
  • [11].Myronenko A, Song X, Point-Set Registration: Coherent Point Drift, IEEE Transactions on Pattern Analysis and Machine Intelligence 32 (12) (2010) 2262–2275, ISSN 0162–8828, doi: 10.1109/TPAMI.2010.46. [DOI] [PubMed] [Google Scholar]
  • [12].Ezzyat Y, Kragel JE, Burke JF, Levy DF, Lyalenko A, Wanda P, O’Sullivan L, Hurley KB, Busygin S, Pedisich I, Sperling MR, Worrell GA, Kucewicz MT, Davis KA, Lucas TH, Inman CS, Lega BC, Jobst BC, Sheth SA, Zaghloul K, Jutras MJ, Stein JM, Das SR, Gorniak R, Rizzuto DS, Kahana MJ, Direct Brain Stimulation Modulates Encoding States and Memory Performance in Humans, Current Biology 27 (9) (2017) 1251–1258, ISSN 0960–9822, doi: 10.1016/j.cub.2017.03.028. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [13].Cokelaer T, Hasch J, ‘Spectrum’: Spectral Analysis in Python, The Journal of Open Source Software 2 (18) (2017) 348, ISSN 2475–9066, doi: 10.21105/joss.00348. [DOI] [Google Scholar]
  • [14].Efron B, Better Bootstrap Confidence Intervals, Journal of the American Statistical Association 82 (397) (1987) 171, ISSN 01621459, doi: 10.2307/2289144. [DOI] [Google Scholar]
  • [15].Dupré la Tour T, Tallot L, Grabot L, Doyère V, van Wassenhove V, Grenier Y, Gramfort A, Non-Linear Auto-Regressive Models for Cross-Frequency Coupling in Neural Time Series, PLOS Computational Biology 13 (12) (2017) e1005893, ISSN 1553–7358, doi: 10.1371/journal.pcbi.1005893. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [16].McFarland WL, Teitelbaum H, Hedges EK, Relationship between Hippocampal Theta Activity and Running Speed in the Rat, Journal of Comparative and Physiological Psychology 88 (1) (1975) 324–328, ISSN 0021–9940. [DOI] [PubMed] [Google Scholar]
  • [17].Sirota A, Montgomery S, Fujisawa S, Isomura Y, Zugaro M, Buzsáki G, Entrainment of Neocortical Neurons and Gamma Oscillations by the Hippocampal Theta Rhythm, Neuron 60 (4) (2008) 683–697, ISSN 0896–6273, doi: 10.1016/j.neuron.2008.09.014. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [18].Lega BC, Jacobs J, Kahana M, Human Hippocampal Theta Oscillations and the Formation of Episodic Memories, Hippocampus 22 (4) (2012) 748–761, ISSN 1098–1063, doi: 10.1002/hipo.20937. [DOI] [PubMed] [Google Scholar]
  • [19].Jacobs J, Hippocampal Theta Oscillations Are Slower in Humans than in Rodents: Implications for Models of Spatial Navigation and Memory, Philosophical Transactions of the Royal Society B: Biological Sciences 369 (1635) (2014) 20130304, ISSN 0962–8436, 1471–2970, doi: 10.1098/rstb.2013.0304. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [20].Rao VR, Leonard MK, Kleen JK, Lucas BA, Mirro EA, Chang EF, Chronic Ambulatory Electrocorticography from Human Speech Cortex, NeuroImage 153 (2017) 273–282, ISSN 1053–8119, doi: 10.1016/j.neuroimage.2017.04.008. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [21].Miller J, Watrous AJ, Tsitsiklis M, Lee SA, Sheth SA, Schevon CA, Smith EH, Sperling MR, Sharan A, Asadi-Pooya AA, Worrell GA, Meisenhelter S, Inman CS, Davis KA, Lega B, Wanda PA, Das SR, Stein JM, Gorniak R, Jacobs J, Lateralized Hippocampal Oscillations Underlie Distinct Aspects of Human Spatial Memory and Navigation, Nature Communications 9 (1) (2018) 2423, ISSN 2041–1723, doi: 10.1038/s41467-018-04847-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [22].Aghajan ZM, Schuette P, Fields TA, Tran ME, Siddiqui SM, Hasulak NR, Tcheng TK, Eliashiv D, Mankin EA, Stern J, Fried I, Suthana N, Theta Oscillations in the Human Medial Temporal Lobe during Real-World Ambulatory Movement, Current Biology 27 (24) (2017) 3743–3751.e3, ISSN 0960–9822, doi: 10.1016/j.cub.2017.10.062. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [23].Buzsáki G, Buhl DL, Harris KD, Csicsvari J, Czéh B, Morozov A, Hippocampal Network Patterns of Activity in the Mouse, Neuroscience 116 (1) (2003) 201–211, ISSN 0306–4522, doi: 10.1016/S0306-4522(02)00669-3. [DOI] [PubMed] [Google Scholar]
  • [24].Tort ABL, Komorowski RW, Manns JR, Kopell NJ, Eichenbaum H, Theta–Gamma Coupling Increases during the Learning of Item–Context Associations, Proceedings of the National Academy of Sciences 106 (49) (2009) 20942–20947, ISSN 0027–8424, 1091–6490, doi: 10.1073/pnas.0911331106. [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

1

RESOURCES