Fastgraph
Authors: John Mosher, Ken Taylor, Anand Joshi, Dileep Nair, Richard Leahy, Chinmay Chinara, Raymundo Cassani
THIS TUTORIAL IS CURRENTLY UNDER CONSTRUCTION
Contents
Introduction
Single-pulse electrical stimulation, or SPES, is used to study how stimulation at one brain site evokes activity across other implanted regions. In SEEG recordings, these stimulation-evoked responses are often measured from many contacts across multiple stimulation sites, making them difficult to review using conventional waveform displays. The Fastgraph, or Functional-Anatomical STacked area graph, provides a compact way to summarize these responses by displaying them as stacked area plots organized using anatomical information.
Each Fastgraph represents the response to stimulation of one contact pair. The recorded responses from other contacts are rectified, stacked, and displayed over time. Contacts can be separated by hemisphere, sorted according to response strength within a selected latency window, and colored by anatomical region or cortical label. Within Brainstorm, this process combines SPES recordings, SEEG contact locations, and anatomical labels to help users compare responses across stimulation sites, identify regions with prominent evoked activity, and review large stimulation protocols more efficiently.
Please note that this tutorial is intended for users already familiar with Brainstorm. It does not provide detailed explanations of the software's interface or theoretical foundations. For comprehensive introductory material, refer to the Brainstorm introduction tutorials.
License
This EEG, MRI, and CT data provided in this tutorial remain the property of the Cleveland Clinic, Ohio, USA. Use or distribution of this dataset outside the scope of the Brainstorm tutorials - including for research purposes - is strictly prohibited without prior written consent. For inquiries regarding permissions, please use the Brainstorm user forum.
Clinical description
The dataset featured in this tutorial was recorded at the Epilepsy Monitoring Unit (EMU) of the Cleveland Clinic, Ohio, USA using Nihon Kohden (NK). It pertains to a 39-year-old ambidextrous female with medically refractory seizures presents with seizures consisting of a loss of awareness. Scalp video-EEG monitoring showed interictal epileptiform discharges arising from both left and right anterior temporal regions. The typical clinical seizures showed ictal EEG changes that were classified as left frontotemporal, right frontotemporal, or non-localizable.
References
Further details for this study can be found below:
Kenneth N. Taylor, Anand A. Joshi, Jian Li, Jorge A. Gonzalez-Martinez, Xiaofeng Wang, Richard M. Leahy, Dileep R. Nair, John C. Mosher.
The FAST graph: A novel framework for the anatomically-guided visualization and analysis of cortico-cortical evoked potentials.
Epilepsy Research, Elsevier, 2020.
Download and installation
Prerequisites:
Brainstorm Installation: Ensure you have a working copy of Brainstorm installed on your computer.
Familiarity with Brainstorm: This tutorial assumes that you have completed all the Brainstorm introduction tutorials and are comfortable with its interface and basic functionalities.
Download the dataset:
Go to the Brainstorm Download page
Download the file: tutorial_fastgraph.zip (to be added).
- Unzip it into a folder that is not located in any Brainstorm directories (i.e., not in the Brainstorm program folder or database folder).
Brainstorm Setup:
- Start Brainstorm.
From the top menu, select: File > Create new protocol.
Name the new protocol: TutorialFastgraph
Set the following options:
"No, use individual anatomy",
"No, use one channel file per acquisition run".
Files in dataset
tutorial_fastgraph/
anatomy/: Anatomy data
pre_T1.nii.gz: Raw pre-implantation T1 MRI (in NIfTI-1 format),
cat12: Folder containing precomputed CAT12 head tissue surfaces segmented from the MRI volume above. More details about the files can be found in MRI segmentation using CAT12.
recordings/: SEEG recordings
Baseline.edf: Raw SEEG baseline recording (in EDF format),
Subject01_electrodes_mm.tsv: Position of electrode contacts identified with Brainstorm in world coordinates.
sEEG recordings
Link the recordings
- Switch to the "functional data" view (2nd button, on top of the database explorer).
Right-click on the subject folder > Review raw file:
Select the file format: EEG: EDF/EDF+
Select the recording: tutorial_fastgraph/recordings/Baseline.edf to add to the database (add image)
The new files Link to raw file lets you access the contents of the original SEEG files. The menu Review raw file does not actually copy any data to the database. More details.
Import the contacts positions
In order to generate the graphs, we need accurate 3D positions for the contacts of the depth electrodes. Placing the contacts requires a good understanding of the implantation scheme reported by the neurosurgeon and some skills in reading MRI scans.
The channel file EDF channels contains the name of the channels, but not their positions. We need to import or edit the positions of the SEEG contacts.
Right-click on the channel file > Add EEG positions > From other studies > Implantation. (add image)
- At the end, you get a report indicating how many channels from the SEEG recordings were attributed a new 3D position. The channels are matched by name: the position file you import must include the labels of the channels, and they must be named exactly in the same way as in your recordings.
Reviewing
Each stimulation block is defined by paired "Stim Start" and "Stim Stop" events.
- On analyzing the raw data, there is a "1 ms" delay between the stimulation trigger from the NK hardware and the actual stimulus presentation. For e.g. shown below is the trigger delay w.r.t. the channel "A". Steps to analyze:
Right click on Link to raw file > SEEG > Display time series. Set the montage to Subject01: A > Subject01: A (orig).
Right click on Link to raw file > POL > Display time series for the triggers.
Set the current time to "3392.428 s". Figure below shows the "1 ms" delay between the stimulation trigger and the actual stimulus.
Detect single-pulse triggers in SPES
This section deals with detecting the per-stimulation block triggers and adding them as events in the raw file, along with some customization options, which are explained in detail below.
Drag the Link to raw file to Process1 tab. Click Run > FAST graph > Detect single-pulse triggers in SPES.
Update stimulation start/stop event label: Gives the option to rename the "Stim Start" and "Stim Stop" event labels to something more custom. Leave the field blank if no renaming is required. In this case, we are shortening the labels to "SB" and "SE" respectively.
Stimulation trigger channel: The stimulation trigger channel in the recordings (here, "DC10")
Update stimulation trigger label: Gives the option to rename the stimulation trigger event label (here, "DC10") in the raw file. Here, we rename it to "STIM". Leave the field blank if no renaming is required.
Buffer time around stimulation block (in s): Required so that it contains the full stimulation segment plus some context before and after it (here, "2 s"). Used as a buffer for the time window for detecting the stimulation trigger.
Trigger time offset (in ms): Explained in the GUI image above (here, "-1 ms" after studying the raw data).
Add 'ODD' and 'EVEN' events: It creates alternating monophasic stimulations from the original stimulation event. This is sometimes useful in downstream analysis of the Fastgraph, as the odd and even pulses may produce different responses.
We will not use this option for this tutorial and leave it at the discretion of the user. To give some context, refer to this paper by Bower et. al. The key practical point from Bower et. al. is that this DBS polarity is not just a trivial sign flip. In their pathway modeling, anodic versus cathodic stimulation changes the relative recruitment of nearby axonal populations, so reversing polarity can shift the balance among therapeutic and side-effect pathways. That is exactly the kind of result that matters for interpreting invasive stimulation, because "same contact, same amplitude" does not mean "same neural population" when polarity is reversed.
Click Run and the raw data gets updated as under.
- "Stim Start" event label gets replaced by "SB" (short for Stim Begin).
- "Stim Stop" event label gets replaced by "SE" (short for Stim End).
- "DC10" triggers were detected, and the event was renamed as "STIM".
- "-1 ms" trigger offset is applied to the stimulation trigger events.
Import epochs of interest
Importing the stimulation start/begin blocks. Load Single-Pulse Electrical Stimulation (SPES) from raw data.
Remove SPES artifacts
Remove Single-Pulse Electrical Stimulation (SPES) artifacts and slow drifts:
- Detect stimulation events from a selected trigger channel
- Replaces the artifact window around each event using spline interpolation
- Apply Empirical Mode Decomposition (EMD) based filtering to remove low-frequency drift components
ODD EVEN events from cleaned data
- Import ODD EVEN events from cleaned data
- Average ODD and EVEN event groups ('By trial groups (folder average)' option)
- Average each of the above obtained ODD and EVEN per session per stimulation site so that we get a single averaged file.
Plot Fastgraphs
Plot Fastgraphs for the individual averaged file above.
