22563
Comment:
|
57511
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= EEG and Epilepsy = | ## page was renamed from Tutorials/Epilepsy = EEG and epilepsy = ''Authors: Francois Tadel, Elizabeth Bock, John C. Mosher, Marcel Heers.'' A newer version of this tutorial is available: https://neuroimage.usc.edu/brainstorm/Tutorials/Epilepsy |
Line 4: | Line 9: |
== License == This tutorial dataset (EEG and MRI data) remains proprietary of the Epilepsy Centre, University Hospital Freiburg, Germany. Its use and transfer outside the Brainstorm tutorial, e.g. for research purposes, is prohibited without written consent from the Epilepsy Center in Freiburg. For questions please contact A. Schulze-Bonhage, MD, PhD: andreas.schulze-bonhage@uniklinik-freiburg.de == Presentation of the clinical case == This tutorial dataset was acquired in a patient who suffered from focal epilepsy with focal sensory, dyscognitive and secondarily generalized seizures since the age of eight years. He does not have any typical risk factors for epilepsy. The high resolution 3T epilepsy MRI including postprocessing was found to be normal. FDG-PET of the brain did not show any pathological changes in the glucose metabolism. Non-invasive telemetry revealed left fronto-central sharp waves, polyspikes and bursts of beta band activity (max. amplitude FC1, Cz) especially during sleep. The tutorial dataset was acquired during one night of the non-invasive telemetry recording at the Epilepsy Center Freiburg, Germany. Afterwards the patient underwent invasive EEG to identify the epileptogenic area and to map functionally important cortex. Details about invasive EEG and source localization from invasive EEG in this patient are reported in Dümpelmann, et al. (2011). Subsequently a left frontal tailored resection was performed. The histological analysis revealed a focal cortical dysplasia type IIB according to the classification of Palmini, et al. (2004). The postsurgical outcome is Engel 1A with a follow-up of 5 years. The EEG data distributed here was recorded at 1024Hz, using a Neurofile NT digital video-EEG system with 128 channels and a 16-bit A/D converter. The signal was filtered in the recording system with a high-pass filter with a time constant of 1 second and a low-pass filter with a cutoff frequency of 344 Hz. The spikes were marked in the Deltamed Coherence Viewer. == Overview of the data processing == The proper identification of epileptiform discharges ("spikes") is a complicated topic beyond the scope of this tutorial. Neurology students train intensively on how to identify true interictal and ictal discharges, particularly as distinct from so-called "normal variants" that can be abundant. Sleep and drowsy states of the brain can generate "vertex waves," "K-complexes," "positive occipital sharp transients of sleep" (POSTS), and "wickets," to name a few variants, none of which are epileptic. A good overview of terminology and application can be found, for example, on the Medscape website, [[http://emedicine.medscape.com/article/1138880-overview|Epileptiform Discharges.]] |
Note that the operations used here are not detailed, the goal of this tutorial is not to introduce Brainstorm to new users. For in-depth explanations of the interface and theoretical foundations, please refer to the [[http://neuroimage.usc.edu/brainstorm/Tutorials#Get_started|introduction tutorials]]. __'''NOT FOR CLINICAL USE'''__:<<BR>>The performance characteristics of the methods and software implentation presented in this tutorial have not been certified as medical devices and should be used for research purposes only. <<TableOfContents(3,2)>> <<Include(DatasetEpilepsy, , from="\<\<HTML\(\<!-- START-PAGE --\>\)\>\>", to="\<\<HTML\(\<!-- STOP-SHORT --\>\)\>\>")>> === Overview of the data processing === The proper identification of epileptiform discharges ("spikes") is a complicated topic beyond the scope of this tutorial. Residents in Neurology train intensively on how to identify true interictal and ictal discharges, particularly as distinct from so-called "normal variants" that can be abundant. Sleep and drowsy states of the brain can generate "vertex waves," "K-complexes," "positive occipital sharp transients of sleep" (POSTS), and "wickets," to name a few variants, none of which are epileptic. A good overview of terminology and application can be found, for example, on the Medscape website, [[http://emedicine.medscape.com/article/1138880-overview|Epileptiform Discharges.]] |
Line 19: | Line 22: |
A classic montage is the "double banana" ([[http://www.google.com/search?q=eeg+double+banana|Google Search]]) which emphasizes local changes in the scalp EEG by forming sequential bipolar pairs, such as "Fp1-F3", "F3-C3." Because F3 is found twice in this montage and of opposite sign, then an epileptic spike centered under F3 will appear as a reversed polarity in these two channels, a visual cue the trained epileptologist seeks when rapidly scanning through hours of recordings. This montage is more formally known as "LB-18.3" or "Longitudinal Bipolar 3" in the nomenclature of the American Clinical Neurophysiology Society Guidelines (see References Below). ACNS guidelines suggest using both "longitudinal" and "transversal" bipolar montages to survey your data. For temporal epilepsy cases, you may also add a "temporal ring" montage. Brainstorm automatically provides several variations of these montages, and allows the users full flexibility in creating their own. Brainstorm allows multiple different montages to be run simultaneously in multiple windows, thus the user can step along through the data, look for abnormal brain activity, then use Brainstorm's event markers to tag suspect intervals. With the suspected events marked and saved, the user can return later to perform source analyses on these intervals. With this brief overview, we detail below an exercise with the sample epilepsy data. => AVERAGE REFERENCE ??? |
A classic montage is the "double banana" ([[http://www.google.com/search?q=eeg+double+banana|Google Search]]) which emphasizes local changes in the scalp EEG by forming sequential bipolar pairs, such as "Fp1-F3", "F3-C3." Because F3 is found twice in this montage and of opposite sign, then an epileptic spike centered under F3 will appear as a reversed polarity in these two channels, a visual cue the trained epileptologist seeks when rapidly scanning through hours of recordings. This montage is more formally known as "LB-18.3" or "Longitudinal Bipolar 3" in the nomenclature of the American Clinical Neurophysiology Society (ACNS) Guidelines (see References Below). ACNS guidelines suggest using both "longitudinal" and "transversal" bipolar montages to survey your data. For temporal epilepsy cases, you may also add a "temporal ring" montage. European neurologists often prefer to review the recordings using an average reference montage. Brainstorm provides several variations of all these montages, allows the users full flexibility in creating their own, and can run different montages simultaneously in multiple windows. The user has to step along through the data, look for abnormal brain activity, then use Brainstorm's event markers to tag suspect intervals. With the suspected events marked and saved, the user can return later to perform source analyses on these intervals. With this brief overview, we detail below an exercise with the sample epilepsy data. Note that the aim of this tutorial is not to train you on how to do spike recognition itself, but rather to illustrate how to manipulate the Brainstorm interface to build an environment adapted to this task. The formal data reviewing should be done by clinical neurophysiologists or other experienced personnel, with specialized training in separating true epileptic activity from other more normal variants of brain activity. |
Line 39: | Line 42: |
* Requirements: You have already followed all the introduction tutorials and you have a working copy of Brainstorm installed on your computer. * Go to the [[http://neuroimage.usc.edu/brainstorm3_register/download.php|Download]] page of this website, and download the file: '''sample_epilepsy.zip''' |
* '''Requirements''': You have already followed all the introduction tutorials and you have a working copy of Brainstorm installed on your computer. * Go to the [[http://neuroimage.usc.edu/bst/download.php|Download]] page of this website, and download the file: '''sample_epilepsy.zip''' |
Line 43: | Line 46: |
* Select the menu File > Create new protocol. Name it "'''!TutorialEpilepsy'''" and select the options: | * Select the menu File > Create new protocol. Name it "'''TutorialEpilepsy'''" and select the options: |
Line 48: | Line 51: |
* Right-click on the !TutorialEpilepsy folder > New subject > '''sepi01''' * Leave the default options you set for the protocol * Right-click on the subject node > Import anatomy folder: * Set the file format: "!FreeSurfer folder" |
* Switch to the "anatomy" view of the protocol. * Right-click on the TutorialEpilepsy folder > '''New subject''' > '''sepi01''' * Keep the default options you set for the protocol * Right-click on the subject node > '''Import anatomy folder''': * Set the file format: "FreeSurfer folder" |
Line 54: | Line 58: |
* Set the 6 required fiducial points (indicated in MRI coordinates): * NAS: x=135, y=222, z=75 * LPA: x=57, y=118, z=68 * RPA: x=204, y=119, z=76 * AC: x=131, y=145, z=110 * PC: x=130, y=119, z=111 * IH: x=128, y=134, z=170 (anywhere on the midsagittal plane) * At the end of the process, make sur the file "cortex_15000V" is selected (downsampled pial surface, that will use for the source estimation). If it is not, double-click on it to select it as the default cortex surface.<<BR>> {{attachment:anatomy.gif||height="257",width="442"}} |
* In the MRI Viewer, click on "[[http://neuroimage.usc.edu/brainstorm/Tutorials/ImportAnatomy#MNI_normalization|Click here to compute MNI transformation]]". It computes an affine transformation between the subject space and the MNI ICBM152 space, and sets default positions for all the anatomical landmarks. <<BR>> {{attachment:mni_transformation.gif}} * Click on [Save] to validate the modifications and continue with the importation of the anatomy. At the end, make sure the file "cortex_15000V" is selected (downsampled pial surface, that will be used for the source estimation). If it is not, double-click to select it as the default cortex surface.<<BR>><<BR>> {{attachment:anatomy.gif||width="442"}} |
Line 64: | Line 62: |
If you do not have access to an individual MR scan of the subject (or if its quality is too low to be processed with !FreeSurfer), but if you have digitized the head shape of the subject using a tracking system, you have an alternative: deform one of the Brainstorm templates (Colin27 or ICBM152) to match the shape of the subject's head.<<BR>>For more information, read the following tutorial: [[Tutorials/TutWarping|Warping default anatomy]] | If you do not have access to an individual MR scan of the subject (or if its quality is too low to be processed with FreeSurfer), but if you have digitized the head shape of the subject using a tracking system, you have an alternative: deform one of the Brainstorm templates (Colin27 or ICBM152) to match the shape of the subject's head.<<BR>>For more information, read the following tutorial: [[Tutorials/TutWarping|Warping default anatomy]] |
Line 67: | Line 65: |
==== Link the recordings ==== * Switch to the "functional data" view. * Right-click on the subject folder > Review raw file: * Select the file format: "EEG: Deltamed Neurofile-Coherence (*.bin)" * Select the file: '''sample_epilepsy/data/tutorial_EEG.bin''' * The new file "Link to raw file" lets you access directly the contents of the EEG recordings * The channel file "Deltamed channels" in the (Common files) folder contains the name of the channels, but not their positions. We need to overwrite this file and import manually the positions of the electrodes (either a standard cap or accurate positions digitized with a Polhemus device). ==== Prepare the channel file ==== * Right-click on the subject folder > Import channel file: |
=== 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: Deltamed Coherence-Neurofile(*.bin)" * Select the file: '''sample_epilepsy/data/tutorial_eeg.bin''' * The new files "Link to raw file" let you access directly the contents of the original SEEG files. The menu "Review raw file" does not actually copy any data to the database. [[http://neuroimage.usc.edu/brainstorm/Tutorials/ChannelFile#Review_vs_Import|More information]]. * The channel file "Deltamed channels" in the (Common files) folder contains the name of the channels, but not their positions. We need to import separately the positions of the electrodes (either a standard cap or accurate positions digitized with a Polhemus device or any other tracking system). === Prepare the channel file === * Import the positions of the electrodes: * Right-click the channel file in ''Common files'' > '''Add EEG positions''' > '''Import from file''': <<BR>> {{attachment:channel_positions.gif||width="357"}} |
Line 78: | Line 77: |
* Select the file: '''sample_epilepsy/data/tutorial.elc''' * Confirm that you want to overwrite the exising channel file. * This file contains the default electrodes positions from the ASA software (ANT) |
* Select the file: '''sample_epilepsy/data/tutorial_electrodes.elc''' * This file contains the default electrodes positions from the ASA software (ANT). * If you have digitized the position of the electrodes (eg. with a Polhemus device) you have to make sure it contains the position of the anatomical references NAS/LPA/RPA. This is the best way to make sure the electrode cap will be registered automatically with the MRI in Brainstorm. * The channels are matched by name: the position file you import must include the labels of the electrodes and they must be named exactly in the the same way as in your recordings. * In this example, you will get a question "'''Apply MRI transformation?'''". If you answer yes, it would apply the voxel=>world transformation initially available in the MRI volume. Whether you need to answer Yes or No depends on which coordinates system is closer to the one use in your position file. Try both and you'll see which one brings the electrodes closer to the head of the subject. Here, answering '''NO''' would give a better immediate result, but as we will run the automatic alignment electrodes/head surface later, the answer to this question doesn't matter much. |
Line 88: | Line 89: |
* DELR, DELL, QR, QL: Additional * The file format for the electrodes positions does not describe the type of the channels correctly, therefore all the signals saved in the files are classified as EEG. We need to redefine this manually to get correct groups of sensors, we want to have only real EEG electrodes in the "EEG" category and put everything that we are not going to use a "MISC" category. * Right-click on the channel file > Edit channel file: * Note that the EOG, EMG and ECG channels already have a different type * Select all the other non-EEG channels: SP1, SP2, RS, PHO, DELR, DELL, QR, QL * Right-click in the window > Set channel type: type '''MISC''' * Close the figure and accept to save the modifications {{attachment:channel_type.gif}} ==== Register electrodes with MRI ==== * The channel file we imported contains generic electrodes positions, hence it cannot be properly aligned properly with the head surface coming from the MRI. We need to register manually these electrodes positions with the subject anatomy. * Right-click on the channel file > MRI registration > Edit... * The default positions are already quite good, and the head shape is correct, there not much manual registration to do. You can click on the Label button in the toolbar to show the electrodes names. * Click on the button "Refine registration with the head points" to find a better registration between the head shape defined by the electrodes and the head surface coming from the MRI. * Click on the button "Project electrodes on the scalp surfaces", to ensure all the electrodes touch the skin surface. * Click on "OK" to save the modifications.<<BR>><<BR>> {{attachment:channel_align.gif|channel_type.gif}} == Review recordings to find the spikes == ==== Display the recordings in one or more montages ==== * For basic information on how to manipulate the montages in Brainstorm: [[http://%20neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings#Montages|read this tutorial]]. * Open a time series figure with the "'''Longitudinal 3'''" montage |
* DELR, DELL, QR, QL: Not used * Right-click on the channel file > '''Edit channel file''': * Note that the EOG, EMG and ECG channels have their type correctly detected. * All the other non-EEG channels were set to "EEG_NO_LOC" when we imported the channel locations: SP1, SP2, RS, PHO, DELR, DELL, QR, QL * It happens commonly that the file format for the electrodes positions does not describe the type of the channels correctly, typically all the signals saved in the files are classified as EEG. You can edit the names and types of the channels with this in interface: select one channel, click on the type and select something in the drop-down list. To edit multiple channels at once: right-click in the window > Set channel type. * For this particular study, we can use the channel file as it is configured now, just close the figure. Discard any modification you may have done. <<BR>><<BR>> {{attachment:channel_type.gif||width="383"}} === Register electrodes with MRI === * Right-click on the channel file > '''MRI registration''' > '''Edit.''' * Hover your mouse over the toolbar buttons for instructions. Click on the [Label] button in the toolbar to show the names''' '''of the electrodes. The default positions are already quite good, and the head shape is correct, only limited manual registration will be required in the next few steps. * Click on the button "'''Refine registration using head points'''" to find a better registration between the head shape defined by the electrodes and the head surface coming from the MRI. Note that this works only if have accurate head shapes and electrodes positions. If you don't, skip this step and edit the registration manually. * Click on the button "'''Project electrodes on scalp surface'''", to ensure all the electrodes touch the skin surface. Then click on "OK" and agree to save the modifications.<<BR>><<BR>> {{attachment:channel_align.gif|channel_type.gif|width="352"}} * If you want to see or edit the positions of the electrodes in the MRI Viewer: right-click on the channel file > '''Display sensors > EEG (MRI Viewer)'''. Select the menu "MIP: Functional" to see all the electrodes. To edit the channel file: right-click > Electrodes > Set electrode position. <<BR>><<BR>> {{attachment:channel_mri.gif||width="346",height="395"}} == Review EEG recordings == === Display the recordings === * Open a time series figure with the "'''Average reference'''" montage |
Line 117: | Line 112: |
* In the same toolbar, select the "Longitudinal 1" in the drop-down list. This menu allows you to set a predefined montages to linearly re-arranging the waveforms. * If you don't see the "Longitudinal 1" menu, it is because you ran Brainstorm for the first time before those predefined montages were made available in Brainstorm. To add them manually: * In the Record tab, select "Edit montages" in the drop-down menu * Click on the "Load montage" button * Go to the folder "brainstorm3/toolbox/sensors/private/", and select the first file * Note that a new entry (probably "Longitudinal 1") is added to the list of available montages * Repeat the operation with all the files in the folder "brainstorm3/toolbox/sensors/private/" * Click on "Save" to close the montage editor and now select "Longitudinal 1" * Open another view on the same data with the "'''Transversal 1'''" montage: |
* Select "Average reference" in the drop-down list. This menu allows you to set a predefined montages to linearly re-arranging the waveforms. Note the keyboard shortcuts in the menus. * Change the default duration that is reviewed to '''10s'''. <<BR>> {{attachment:review_avgref.gif||width="188"}} {{attachment:review_duration.gif||width="198"}} * In the figure, click on the '''[Flip +/-]''' button to have the negative values pointing up (convention used by most neurologists). <<BR>> {{attachment:review_flip.gif||width="360"}} * Open a '''2D Sensor cap''' map of the EEG sensor values: * Right-click on "Link to raw file" again > EEG > '''2D Sensor cap''' * In the Record tab, set the Montage to this view to "'''Average reference'''" * Open the '''ECG '''and '''EOG '''traces, to avoid confusing spikes with cardiac or ocular artifacts: * Right-click on the Link to raw file > ECG > Display time series * Right-click on the Link to raw file > EOG > Display time series * The ECG is almost mandatory. The EOG is optional: it can be helpful for beginners but an experienced reviewer will easily recognize the eye movements directly in the EEG data. * Re-arrange the figures in a convenient way, for example as illustrated below. Then disable the automatic positioning of the figures (layout menu at the top-right of the Brainstorm figure > None), so that your figure arrangement doesn't get lost when you open a new figure. * Having a lot of windows open may slow down significantly the display because each time you change the current time, all the figures have to be updated. A lot of space is also wasted on the screen due to window frames. The number of windows to open has to be balanced between the amount of information to display and the ease of use. <<BR>><<BR>> {{attachment:reviewall.gif||width="594"}} === Frequency filters === Go to the Filter tab to enable some display frequency filters. General recommendations are: * High-pass filter: '''0.5 Hz''' * Low-pass filter: '''80 Hz'''<<BR>><<BR>> {{attachment:filters.gif||width="196"}} * Note that if you have filters selected in this panel, the display of the EEG signals will be '''slower'''. Each time you will go to the next page of recordings, the filters will be applied on the fly to the recordings. The computation time is not very long at each page, but can become annoying when reviewing a lot of data. For a faster display of filtered signals, you may consider '''apply the filters to the file''' (with the process Pre-process > Band-pass filter) and then review the recordings without visualization filters. === Time and amplitude resolution === The resolutions of the time and amplitude axes have a lot of importance for the visual detection of epileptic spikes. The shapes we are looking for are altered by the horizontal and vertical scaling. The distance unit on a screen is the pixel, we can set how much time is represented by one pixel horizontally and how much amplitude is represented by one pixel vertically. In the Brainstorm interface, this resolution is usually set implicitly: you can set the size of the window, the duration or recordings reviewed at once (text box "duration" in tab Record) and the maximum amplitude to show in the figure (buttons [...] and [AS] on the right of the time series figure). From there, you can also zoom in time ([<], [>], mouse wheel) or amplitude (['''^'''], [v], Shift+mouse wheel). These parameters are convenient to explore the recordings interactively but don't allow us to have reproducible displays with constant time and amplitude resolutions. To set the figure resolution explicitly: right-click on the figure > '''Figure > Set axes resolution'''. Note that this interface does not store the input values, it just modifies the other parameters (figure size, time window, max amplitude) to fit the resolution objectives. If you modify these parameters (resize the figure, keep the button [AS] selected and scroll in time, etc) the resolution is lost, you have to set it again manually. In particular, make sure you '''disable the auto-scaling''' ([AS] button in the time series figure) if you want to preserve the aspect ratio while you scroll through the data. This operation typically has to be repeated everytime you open a new file. For a faster access to this option, use the keyboard shortcut '''Ctrl+O'''. The option window offers by default the last values that you entered, just press '''Enter '''to apply them again. Recommendations for this dataset are: * Time axis: '''170 pixels/sec''' (~55 mm/sec) * Amplitude: '''15 μV/pixels''' (~45 μV/mm)<<BR>><<BR>> {{attachment:resolution.gif}} === User setups === This preparation of the reviewing environment requires a large number of operations, and would become quickly annoying if you have to repeat it every time you open a file. You can use the menu "User setups" to save a window configuration and reload it in one click later. In the menu "Window layout", at the top-right of the Brainstorm window, select User setup > New setup. Enter a name of your choice for this particular window arrangement. This operation will also disable the automatic window arrangement (Window layout > None). To reload it later, open one figure on the dataset you want to review and then select your new entry in the User setup menu. . {{attachment:usersetup.gif||width="347"}} === Multiple montages === It may be interesting for some cases to display different groups of sensors in multiple windows (eg. with an MEG system with 300 sensors), or some complicated epilepsy cases where you would like to review at the same time multiple montages (eg. longitudinal and transversal bipolar montages). * Open your full reviewing environment as described before, where the EEG signals are displayed with the "'''Average reference'''" montage. * Open another view on the same data with the "'''Longitudinal 3'''" montage ("double-banana" LB-18.3) |
Line 128: | Line 160: |
* Set the montage for this new figure to "Transversal 1" (note the keyboard shortcuts in the menus) * Open a 2D map of the sensor values as well: * Right-click on "Link to raw file" again > EEG > 2D Sensor cap * In the Record tab, set the Montage to this view to "'''Average reference'''" * Re-arrange the figures in a convenient way, for example as illustrated below, and disable the automatic positioning of the figures you the figure arrangement doesn't get lost when you open a new figure (Window layout menu at the top-right of the Brainstorm figure > None) => 1. ECG/EOG ??? => 2. AVERAGE REFERENCE ??? Best for marking the spikes in this case? => 3. SCREEN CAPTURE ??? {{{ a) browsing the data becomes slow with the topography EEG, EOG and ECG open b) we waste some space on the screen with all the window frames. For the beginner it is very reasonable to also see the EOG. An experienced reviewer will easily recognize the eye movements in the EEG data }}} ==== Frequency filters ==== Go to the Filter tab to enable some display frequency filters. General recommendations are: * High-pass filter: '''0.5 Hz''' * Low-pass filter: '''70 Hz'''<<BR>><<BR>> {{attachment:filters.gif}} ==== Time and amplitude resolution ==== The resolutions of the time and amplitude axes has a lot of importance for the visual detection of epileptic spikes. The shapes we are looking for are altered by the horizontal and vertical scaling. The distance unit on a screen is the pixel, we can set how much time is represented by one pixel horizontally and how much amplitude is represented by one pixel vertically. In the Brainstorm interface, this resolution is usually set implicitly: you can set the size of the window, the duration or recordings reviewed at once (text box "duration" in tab Record) and the maximum amplitude to show in the figure (buttons [...] and [AS] on the right of the time series figure). From there, you can also zoom in time ([<], [>], mouse wheel) or amplitude (['''^'''], [v], Shift+mouse wheel). Those parameters are convenient to explore the recordings interactively but don't allow us to have reproducible displays with constant time and amplitude resolutions. To set the figure resolutions: right-click on the figure > Figure > Set axes resolution. Note that this interface does not store the input values, it just modifies the other parameters (figure size, time window, max amplitude) to fit the resolution objectives. Then if you modify those parameters (resize the figure, leave the button [AS] selected and scroll in time...) the resolution is lost, you have to set it again manually. Recommendations for this dataset are: * Time axis: 90 pixels/sec (~30 mm/sec) * Amplitude: 4 μV/pixels (~12 μV/mm) => 3. CHECK THE VALUES ??? => 4. SCREEN CAPTURE ??? ==== User setups ==== This preparation of the reviewing environment requires a large number of operations, and would become quickly annoying if you have to repeat it everytime you open a file. This is a good time to use the menu "User setups" to save this window configuration, to reload it in one click later. In the menu "Window layout", at the top-right of the Brainstorm window, select User setup > New setup. Enter a name of your choice for this particular window arrangement. This operation will also automatically disable the automatic window arrangement (Window layout > None). To reload it later, open one figure on the dataset you want to review and then select your new entry in the User setup menu. . {{attachment:usersetup.gif}} ==== Mark spikes ==== In the dataset, the spikes have already been identified by experts at the University Hospital of Freiburg. You can see that 177 SPIKE events are available in the Record tab. Click on a few of them a try to identify the shape of the spike. => 5. SCREEN CAPTURE ??? The procedure if you are marking the events by yourself is the following: * Open a continuous file viewer, the load your reviewing environment (menu User setups) * Start by creating a group of events (in the Record tab: Events > Add group), and select it in the list of events. |
* Then set the montage for this new figure to "Longitudinal 3". * Resize all the figures to make room for the new window. * Save this window configuration as a new "User setup". * If you don't see the "Longitudinal 3" menu, it is probably because you have been using Brainstorm before these predefined montages were made available in the distribution. To add them manually: * In the Record tab, select "Edit montages" in the drop-down menu * Click on the "Load montage" button. * Go to the folder "brainstorm3/toolbox/sensors/private/", and select the first file. * Note that a new entry (probably "Longitudinal 1") is added to the list of available montages. * Repeat the operation with all the files in the folder "brainstorm3/toolbox/sensors/private/". * Click on "Save" to close the montage editor and now select "Longitudinal 3". {{attachment:reviewall2.gif||width="678"}} * More information available in the tutorial [[Tutorials/MontageEditor|Montage editor]]. === Scalp current density === In the example below, see how the montage '''Scalp current density''' can enhance the visual detection of spikes. [[https://neuroimage.usc.edu/brainstorm/Tutorials/MontageEditor#Scalp_current_density|More information]]. . {{attachment:scd_off.gif||width="601",height="189"}} <<BR>><<BR>> {{attachment:scd_on.gif||width="601",height="189"}} == Mark spikes == === Detect heartbeats === When you have a clean ECG signal for your patient, you can automatically identify all the heartbeats in the recordings. Because heartbeats can cause sharp waves in some EEG traces, it helps the reviewing process to have all the cardiac events marked in the recordings. * Right-click on the "Link to raw file" > EEG > '''Display time series''' (or simply double-click on the file). * In the tab Record, menu Artifacts > Detect heartbeats: Channel='''ECG''', All file. <<BR>><<BR>> {{attachment:detect_ecg.gif||width="470",height="200"}} === Import the spike markers === Some spikes were marked by the epileptologists at the Epilepsy Center in Freiburg and saved in an external text file. We are going to import this file manually. * In the tab Record, menu File > '''Add events from files'''... * Select format '''Array of times''' (text file containing the timing of the markers) * Select file '''sample_epilepsy/data/''''''tutorial_spikes.txt''' * When prompted, enter the event name "'''SPIKE'''" * A new category SPIKE is visible in the events list, containing 58 markers. Click on a few of them and try to identify the shape of the spike (mostly visible on the channel FC1). Then close the viewer and save the modifications. <<BR>><<BR>> {{attachment:events_import.gif||width="530"}} * The two other types of events that were present initially in the file (REM/REM_Ende) indicated the beginning and the end of periods or REM sleep (the patient is sleeping during the entire session). === Manual marking === If you are marking the events by yourself, you could follow this procedure: * Close all the current figures ("Close all" button at the top-right corner of the Brainstorm window). * Double-click on the "Link to raw file" to open a continuous file viewer, and load your reviewing environment (menu User setups). * Start by creating a group of events (Events > Add group), and select it in the list of events. |
Line 184: | Line 202: |
* Scroll through the recordings using the [<<<] and [>>>] buttons or shortcuts such as F3 or F4 (complete list and descriptions available when you leave your mouse over those buttons). * You can adjust the gain of the electrodes to observe better an event with the buttons ['''^'''] and [v] or the shortcut [Shift+mouse wheel]. |
* Scroll through the recordings using the [<<<] and [>>>] buttons or shortcuts such as F3 or F4 (complete list and descriptions available when you hover your mouse over these buttons). * You can adjust the gain of the electrodes to observe better an event with the buttons ['''^'''] and [v], with the keyboard (+/-) or the mouse ([Shift+mouse wheel] or [Right-click+move up/down]). |
Line 188: | Line 206: |
* If you are marking multiple types of events, it is convenient to set up some additional keyboard shortcuts. Using the menu '''Events > Edit keyboard shortcuts''', you can associate custom events to the key 1 to 9 of the keyboard. Define the name of the event type to create for each key, and then simply press the corresponding key to add/delete a marker at the current time position. * More information on the data viewer, see tutorial: [[Tutorials/TutRawViewer|Review continuous recordings]]. => 6. CONFIRM THE PROCEDURE ??? |
* If you are marking multiple types of events, it is convenient to set up some additional keyboard shortcuts. Using the menu '''Events > Edit keyboard shortcuts''', you can associate custom events to the keys 1 to 9 of the keyboard. Define the name of the event type to create for each key, and then simply press the corresponding key to add/delete a marker at the current time position. * To jump to the next/previous event in the current category: use the keyboard shortcuts [Shift+arrow right] and [Shift+arrow left] * More information on the data viewer, see tutorial: [[Tutorials/ReviewRaw|Review continuous recordings]]. |
Line 194: | Line 211: |
* High-pass filter the recording at 0.5Hz => 7. APPLY 0.5 Hz FILTER TO THE CONTINUOUS RECORDINGS BEFORE IMPORTING ??? => (NOT POSSIBLE WITH THIS FILE FORMAT AND EPOCHS TOO SHORT TO FILTER AFTER) => REMOVE DC OFFSET INSTEAD? WITH LONGER EPOCHS BEFORE ZERO ? == Epoching and averaging == ==== Import recordings ==== * Right-click on the "Link to raw file" > Import in database * Select the option "Use events" and select the category '''SPIKE''', with 177 events. * Epoch time: '''[-100, +300]ms''' around the spike events * Uncheck "Remove DC offset": the DC offset has already been removed with the high-pass filter<<BR>><<BR>> {{attachment:import.gif}} * You should see a new folder "SPIKE" containing 177 epochs in your database.<<BR>><<BR>> {{attachment:import_after.gif}} ==== Average spike ==== * Drag and drop all the SPIKE files or the SPIKE folder into the Process1 tab * Run the process "Average > Average files", with the following options:<<BR>><<BR>> {{attachment:average1.gif}} * Double click on the new file "Avg: SPIKE" to review it * Open a "2D sensor cap" view on the same file, or simply press [Ctrl+T] from the time series figure.<<BR>><<BR>> => SCREEN CAPTURE ??? * To have all the figures re-arrange themselves automatically again, select "Weighted" or "Tiled" in the "Window layout" menu (top-right corner). * Explore this average in time with the left and right keyboard arrow. * To get a synthetic view at the sensor level of the evolution of the 2D map in time, right-click on the figure > Snapshot > "Time contact sheet: Figure" => SCREEN CAPTURES ??? == Source analysis == ==== Head model ==== * Right-click on the channel file (or any folder containing the channel file) > Compute head model<<BR>><<BR>> {{attachment:headmodel1.gif}} * Select the "cortex surface option" and the "OpenMEEG BEM" forward model<<BR>><<BR>> {{attachment:headmodel2.gif}} * Leave all the OpenMEEG options to their defaults, which should be:<<BR>><<BR>> {{attachment:headmodel3.gif}} ==== Noise covariance matrix ==== * For minimum norm inverse models, we need to estimate first the level of noise at the level of the sensors. Defining what can be considered as "noise" in the middle of continuous brain recordings is a difficult question, discussed in the [[Tutorials/TutNoiseCov|Noise covariance tutorial]]. * Here we chose what is described as option 1b in the section "Noise and epilepsy" in that tutorial: we are going to calculate the noise covariance matrix using 10 seconds from the raw file that are very "quiet", ie. that contain no apparent epileptic activity, no REM and no other special artifacts. We can use for this purpose the 10s segment between 110s and 120s. * Right-click on the "Link to raw file" > Noise covariance > Compute from recordings<<BR>><<BR>> * Select the time window [120s - 130s] and leave the other options to the default values<<BR>><<BR>> ==== Inverse model ==== * Source model: wMNE, constrained orientations * Compute z-score * Display: Go back to "Tiled" or "Weighted" window layout => 9. WHAT ARE THE INTERESTING DISPLAYS ??? => MOVIES ? CONTACT SHEETS ? WHAT ANGLES ? ==== Discussion ==== Discuss advantage of distributed source models in the evaluation of epilepsy data compared with ECD (Kobayashi K, Epilepsia 2005) => 10. DEVELOPMENT ??? == Moving dipoles == Illustrate John/Beth's tools for calculating and displaying dipoles. => 11. DOES THIS WORK ??? . {{attachment:SL_MNE_tutorial_patient.jpg||height="403",width="645"}} |
Two of the typical pre-processing steps consist in removing the power lines artifacts (50 Hz or 60Hz) and the frequencies we are not interested in (a low-pass filter to remove the high-frequency noise and a high-pass filter to remove the very slow components of the signals). Let's start with a spectral evaluation of this file. === Power spectrum === * In the Process1 box: Drag and drop the "Link to raw file". * Run process '''Frequency > Power spectrum density (Welch)''': All file, Length='''10s''', Overlap=50%.<<BR>> {{attachment:psd1.gif||width="510",height="305"}} * Double-click on the new PSD file to display it.<<BR>> {{attachment:psd2.gif||width="557",height="199"}} * This frequency spectrum does not show any particular peak at 50/60Hz, there is no notch filter to apply on these recordings. If we had to, we would run the process "Pre-processing > Notch filter" as explained in the tutorial [[Tutorials/ArtifactsFilter|Detect and remove artifacts]]. === Band-pass filter === The filters we selected for reviewing the recordings were for visualization only, they were not applied to the file. In order to apply these filters permanently to the recordings, we need to do the following: * Keep the "Link to raw file" selected in the Process1 list. * Run process '''Pre-process > Band-pass filter''': '''[0.5,80]Hz''', 60dB, no mirror, sensors='''EEG'''<<BR>><<BR>> {{attachment:bandpass.gif||width="400",height="321"}} * Note that this new continuous file is saved in your Brainstorm database, while the original file is saved in a separate folder (sample_epilepsy). If you delete the link to the original file with the database explorer, it would not delete the actual file. If you delete the link to the filtered file, it would delete the file itself. === Average reference === The average reference montage we used to review the recordings was for visualization only, it did not modify the file. To apply this transformation permanently, we need to run the re-referencing process. * Double-click on the filtered file "Raw | band(0.5-80Hz)" to open it. * In the Record tab, select the menu '''Artifacts > Re-reference EEG''': Enter '''AVERAGE'''. <<BR>><<BR>> {{attachment:avgref_process.gif||width="500",height="244"}} * The re-referencing is saved in the same way as the SSP and ICA projectors: a linear operator applied dynamically to the recordings. At the end of the process, the window "Select active projectors" is shown, so that you can control the list of projectors currently applied to the file. Close this figure and close the recordings. <<BR>><<BR>> {{attachment:avgref_projector.gif||width="327",height="140"}} === Average reference and bad channels === You should be careful with the average reference when adding or removing bad channels. Changing the number of channels modifies the way the average reference is computed. '''Montage''': When using the montage "Average reference" to change only the visulization, the average reference operator is computed dynamically, it always takes into account the bad channels at the moment you review the recordings. Therefore the average reference for display is always correct, you do not have to modify anything if you change the list of bad channels. '''Permanent re-referencing''': When using the process "Re-reference EEG" to alter permanently the recordings, the average reference operator is computed using the channels that are marked as bad at the moment of the computation, and saved in the file. If later you modify the list of bad channels, this operator will become incorrect, you will have to delete it and recompute it. To avoid any confusion, always compute the average reference after marking the bad channels. === Evaluate the modifications === * In Process1, select the filtered file "Raw | band(0.5-80Hz)". * Run again the process '''Frequency > Power spectrum density (Welch)''', with same options. * Double-click on the new PSD file to display the spectrum of the filtered file. You can observe the effects of the filter (drops on the two sides of the spectrum, zoom in to observe it better) and the average reference (all the signals have now a similar level of power). <<BR>><<BR>> {{attachment:psd3.gif||width="576",height="220"}} == Artifact cleaning with ICA == The standard cleaning pipeline presented in the introduction tutorials recommends to use the [[Tutorials/ArtifactsSsp|SSP approach]] to remove the cardiac and blink artifacts. This is valid in most MEG experiments. In EEG, there is usually not such a clear artifact caused by the heartbeats: cleaning for cardiac artifacts is not part of the standard processing pipeline. Eye movements typically cause huge artifacts on the frontal channels and need to be marked as bad or corrected. In the present case, the patient is sleeping, therefore there are no blinks, but we can observe a lot of fast eye movements during the periods of REM sleep, and other slower eye movements in the rest of the recordings. The SSP technique is not adapted for cleaning events for which we cannot set markers, and in general it is not suitable for low-density EEG. The topographies are a lot smoother in EEG than in MEG, it is more difficult to identify a spatial filter that targets one specific artifact with a simple spatial PCA decomposition, especially with a very low number of sensors. The ICA approach (Independent Component Analysis) is much more popular in the EEG community. It relies on the the same logic as the SSP: identifying spatial topographies that are specific from an artifact and then removing them from the recordings. But instead of simply identifying the most powerful spatial components with a PCA decomposition, it tries to identify components that are independent in time. Using the information from the time dimension makes it possible to work with a very low number of sensors, and to identify some components of the signal that are completely uncorrelated with the others. The ICA analysis can also be used to identify the signals from a few brain sources of interest: in this case, we select a few components and remove all the others. For more information on ICA, please refer to the documentation of the EEGLAB software. * We will illustrate now how to compute some projectors to remove the contaminations from the eye movements with the Infomax algorithm. To make it run fast on most computers, we will not process the full recordings but only a short segment which contains a lot of eye movements: [500,700]s. <<BR>><<BR>> {{attachment:ica_window.gif||width="417",height="127"}} * Double-click on the filtered file "Raw | band(0.5-80Hz)" to open it. * In the Record tab, select the menu '''Artifacts > ICA components'''. <<BR>><<BR>> {{attachment:ica_process.gif||width="503",height="360"}} * '''Time window''': Segment where the artifact is present (or all the recordings if you have time). * '''Event name''': Empty, we want to use all the recordings from the selected time window. * '''Event window''': Not applicable (because the previous option is empty). * '''Frequency band''': Ignore (0-0Hz), we want to perform the analysis on the broadband signal. * '''Number of ICA components''': If this value is higher than 0 and lower than the number of channels, it will first perform a spatial PCA decomposition, keep only the N principal components, and pass this subspace to the ICA algorithm. <<BR>>In the current example, the algorithm doesn't converge if we use all the components (25 EEG channels), we have to enter 24 to make it work. <<BR>>'''[TODO]''' This issue has to be investigated further. * '''Sensor types''': EEG * '''Sort components based on correlation with''': Sort ICA components based on their correlation with a selection of 'reference' channels (default: ECG & EOG). The sorting is based on the maximum correlation of a given ICA time-series with any of the reference channels. * '''Using existing SSP/ICA''': Yes. In this case, using or not the existing re-referencing projector should not make any difference, but it would change the results if you have other projectors already computed. * '''Save averaged artifact''': Not applicable (because we are not using events). * '''ICA method''': Infomax (calls directly the function runica.m from EEGLAB). * You can follow the convergence of the Infomax algorithm in the Matlab command window. When it is done, the window "Select active projectors" is shown. Select all the components, display their spatial topography and time series (read the tooltips to see which button does what). The first two components (IC1, IC2) look very correlated with the EOG signals, and their topographies are typical of eye movements. <<BR>><<BR>> {{attachment:ica_components.gif||width="638",height="264"}} * If the algorithm doesn't converge: try to run the ICA decomposition before the EEG referencing (either delete the "EEG reference" projector, or unselect the option "Use existing SSP/ICA"). * Select the first two components to remove them: observe the effect on the EEG signals. It removes very well the artifacts due to the eye movements without affecting the rest of the recordings. <<BR>><<BR>> {{attachment:ica_eeg.gif||width="637",height="186"}} * Go to around a SPIKE event, make sure that removing these two components doesn't affect the shape of the spike. We do not want them to alter our events of interest. <<BR>><<BR>> {{attachment:ica_spike.gif||width="635",height="195"}} * Select the first two components, click on [Save] to keep this selection. * To save the ICA time series in a new file in the database, follow the instructions in the SSP tutorial: [[https://neuroimage.usc.edu/brainstorm/Tutorials/ArtifactsSsp#Extract_the_time_series|Extract the time series]]. == Import the recordings == === Epoching === Now we want to extract all the spikes from this filtered file and import them in the database. * Right-click on the filtered file (Raw|band) > '''Import in database'''. <<BR>><<BR>> {{attachment:import_menu.gif||width="206",height="138"}} {{attachment:import.gif||width="447",height="270"}} * Select the option "Use events" and select the category '''SPIKE''', with 58 events. * Epoch time: '''[-300, +500]ms''' around the spike events. * Remove DC offset: Disabled, the DC offset has already been removed with the high-pass filter. * You should see a new folder "SPIKE" containing 58 epochs in your database.<<BR>><<BR>> {{attachment:import_after.gif||width="228"}} * We recommend you always review all the trials after importing them. To review the imported trials: double-click on the first trial, switch back to butterfly view (first button in Record tab), then navigate between trials with F3 / Shift+F3. Channels and trials can be marked as bad independently. You can overlay one or more electrodes from multiple files with the tab "[[Tutorials/ChannelClusters|Cluster]]": * Display the time series for one trial (you must have at least one file loaded to create a cluster). * In the Brainstorm window: Click on the [+] to add the '''Cluster tab'''. * In the Cluster tab: Click on [New Ind] and enter "FC1" (cluster with one electrode only). * In the Cluster tab: Double-click to rename the cluster into something more meaningful ("FC1"). * In the Cluster tab: Select the option "'''Overlay: Files'''" * In the database explorer: Right-click on the group of trials > '''Clusters time series'''. <<BR>><<BR>> {{attachment:fc1_cluster.gif||width="654",height="170"}} Alternatively, you can display all the trials as an image, for one sensor at a time: * In the database explorer: Right-click on the on the group of trials > '''Display as image > EEG'''. <<BR>><<BR>> {{attachment:fc1_erpimage.gif||width="632",height="174"}} === Averaging spikes === * Drag and drop all the SPIKE files or the SPIKE folder into the Process1 tab. * Run process '''Average > Average files''', By folder (subject average), Arithmetic average.<<BR>><<BR>> {{attachment:average1.gif||width="441",height="404"}} * Double click on the new file "Avg: SPIKE" to review it. Add a "2D sensor cap" view (popup or Ctrl+T). <<BR>><<BR>> {{attachment:average_view.gif||width="633",height="188"}} * Go to the Filter tab to __'''disable all the visualization filters'''__: these filters are not working well on short signals, the high-pass filter at 0.5Hz can introduce errors in the display of the average. * To have all the figures automatically re-arrange themselves again, select "Weighted" or "Tiled" in the "Window layout" menu (top-right corner). * Explore this average in time with the left and right keyboard arrow. You can add more views to your reviewing environment (see the tutorial [[Tutorials/ExploreRecordings|Visual exploration]]): <<BR>><<BR>> {{attachment:average3.gif||width="634",height="195"}} * Typically, the analysis could be limited to the ascending part of the peak (from '''-11ms to 0ms'''), as it gives a rather clear information on the primary epilepsy focus. For the rest of the tutorial, we will use a larger time window ('''-40ms to 100ms''') in order to illustrate the visualization tools. Just keep in mind that it can be hazardous to interpret waves that are far in time or in space from the primary focus. * To get a synthetic view at the sensor level of the evolution of the 2D map in time:<<BR>> Right-click on the figure > Snapshot > '''Time contact sheet: Figure''': [-40ms, 110ms], 16 images. <<BR>><<BR>> {{attachment:average2.gif||width="304",height="317"}} == Source analysis: Surface == === Head model === * We are going to use a realistic head model. This requires additional surfaces to model the skull properly. Go to the "Anatomy" view, right-click on the subject > '''Generate BEM surfaces'''. * Use '''1922 vertices '''for each layer (default). Three new surface files are created:<<BR>><<BR>> {{attachment:bem1.gif||width="196",height="273"}} {{attachment:bem2.gif||width="184",height="240"}} {{attachment:bem3.gif||width="157",height="272"}} * Go back to the "Functional data" view, right-click on the channel file > '''Compute head model'''. Select "'''cortex surface'''" and "'''OpenMEEG BEM'''". Leave all the OpenMEEG options to their defaults except for one: select the option "'''Use adjoint formulation'''". Depending on your computer, this may take between 10 and 60 minutes. <<BR>><<BR>> {{attachment:headmodel1.gif||width="632",height="301"}} * Open your resource monitor to check the memory usage: if it goes over 98%, your system doesn't have enough RAM to compute this model. You should kill the process "om_gain", kill Matlab and try again with a different configuration. * If the automatic download doesn't work, download and install OpenMEEG manually (menu Help).<<BR>>If the OpenMEEG calculation crashes, please refer to the [[Tutorials/TutBem|OpenMEEG tutorial]]. * An easy way to make this work a lot faster and with a limited amount of memory is to use less vertices for each layer, for example '''1082 vertices '''(scalp) and '''642 vertices '''(outer skull and inner skull). However, with less refined models you may run into other issues (intersecting meshes or numerical instabilities). * If you can compute the model but the source maps you get don't make any sense, it is probably because the BEM surfaces were poorly defined. When some cortex vertices are too close to the inner skull surface, the model can be unstable and you would typically see source maps containing zeros everywhere except for a few vertices. If this happens, delete the existing BEM surfaces and try computing new ones with a higher number of vertices for the inner and outer skull surfaces. * If you cannot get OpenMEEG to work, or if the results definitely do not make sense, try using a different forward model: "'''3-shell sphere'''". It's a spherical model, so it would perform better in the regions of the head that are close to the sphere. See the [[Tutorials/HeadModel|Head model tutorial]]. === Noise covariance matrix === * For minimum norm inverse models, we need to estimate the level of noise at the level of the sensors. Defining what can be considered as "noise" in the middle of continuous brain recordings is a difficult question, discussed in the [[Tutorials/NoiseCovariance|Noise covariance tutorial]]. * Here we choose what is described as [[http://neuroimage.usc.edu/brainstorm/Tutorials/NoiseCovariance#Epilepsy|option 1b]] in the section "Epilepsy" in that tutorial: we are going to calculate the noise covariance matrix using 50 seconds from the continuous file that are very "quiet", ie. that contain no apparent epileptic activity, no REM and no other special artifacts. We can use for this purpose the segment between 110s and 160s. * Right-click on the filtered file "Raw|band" > '''Noise covariance > Compute from recordings''': Baseline = '''[110,160]ms''', keep the other options to the default values. <<BR>><<BR>> {{attachment:noisecov1.gif||width="663",height="247"}} === Inverse model === * Right-click on the OpenMEEG head model > '''Compute sources [2016]''': '''sLORETA''', '''Unconstrained''' <<BR>> {{attachment:inverse1.gif||width="447",height="332"}} * It creates a shared inversion kernel in the folder (Common files) and a source link for each file in the subject. If you are not familiar with these concepts, please refer to the [[Tutorials/SourceEstimation|Source estimation tutorial]]. * Double-click on the source file for the average. Configure its display: [[http://neuroimage.usc.edu/brainstorm/Tutorials/ExploreAnatomy#Surfaces|surface smoothing]], [[http://neuroimage.usc.edu/brainstorm/Tutorials/SourceEstimation#Display:_Cortex_surface|amplitude threshold]], [[Tutorials/Colormaps|colormap]]. Make sure all the visualization filters are turned OFF. <<BR>><<BR>> {{attachment:inverse2.gif||width="646",height="176"}} * To display the same information re-interpolated in the volume, right-click on the source file > Cortical activation > '''Display on MRI'''. Right-click on the figure to set the smoothing level and other options. <<BR>><<BR>> {{attachment:inverse4.gif||width="347",height="202"}} * You can save movies or contact sheets of the source maps with the Snapshot popup menu<<BR>><<BR>> {{attachment:snapshot_menu.gif||width="279",height="157"}} {{attachment:spike_video.gif||width="169",height="186"}} {{attachment:spike_contact.gif||width="179",height="188"}} === Regions of interest === * From the displays we generated previously, there is no clear propagation of the spike. The scouts can be an interesting tool to explore further this spatial propagation. * Start by placing a small scout at the focus, then place a few other scouts of a similar size at other places around the spike location, where you could suspect a possible propagation. Plot the overlaid time series for these scouts. If you need help with this: see the [[Tutorials/Scouts|Scouts tutorial]].<<BR>><<BR>> {{attachment:scouts1.gif||width="355",height="156"}} == Source analysis: Volume == If the results you obtain are not satisfying with the surface-based source estimation, you can run again the same analysis with a different source space, sampling the entire head volume instead. More information about this method in the [[Tutorials/TutVolSource|Volume source estimation tutorial]]. We will use this new example to estimate the dipole scanning tools. === Head model === * Right-click on the channel file > '''Compute head model''', select '''MRI volume'''. To go faster this time, you can select a spherical head model: '''3-shell sphere'''. Use the default sphere. <<BR>><<BR>> {{attachment:headmodel_vol2.gif||width="389",height="219"}} * Then you have to define what source grid you want to use. Keep the default options. <<BR>><<BR>> {{attachment:headmodel_vol3.gif||width="458",height="295"}} === Dipole scanning === * Right-click on the new head model > '''Compute sources''': '''Dipole modeling'''.<<BR>><<BR>> {{attachment:inverse_vol2.gif||width="388",height="270"}} * Note that this is not a global inverse solution like the minimum norm. It represents the performance of each individual dipole, ie. its capacity to explain all the recordings at one time sample on its own. <<BR>><<BR>> {{attachment:dipoles1.gif||width="451",height="314"}} * In Process1, select the Dipoles link associated with the average spike. * Run process '''Sources > Dipole scanning''': '''[-40,100]ms''' <<BR>><<BR>> {{attachment:dipoles2.gif||width="448",height="312"}} * Double-click on the new dipoles file. In the Dipoles tab, set the threshold Goodness to 90% to show only the most meaningful dipoles. The color of the dipoles below represent the time at which each dipole was estimated. This representation seems to indicate there are two distinct brain regions: the activity at 40ms is deeper than at the peak of the spike (0ms). <<BR>><<BR>> {{attachment:dipoles3.gif||width="660",height="181"}} * More information about dipole scanning: [[Tutorials/TutDipScan|Dipoles: Scanning and displaying]]. === Dipole fitting === The dipole scanning approach presented in the previous section estimates the activity of a fixed grid of dipoles and selects the most significant one at each time. Another option to represent the source activity as a sequence of moving dipoles is to use the FieldTrip function ft_dipolefitting.m to run a non-linear dipole fit at each time point. This process requires that [[https://neuroimage.usc.edu/brainstorm/Tutorials/Statistics#FieldTrip_implementation|you install the FieldTrip toolbox on your computer]] and will only work with a spherical head model. * In Process1, select the EEG recordings for the average spike. * Run process '''Sources > FieldTrip: ft_dipolefitting''': Time window='''[-40,100]ms''', Sensors='''EEG'''. <<BR>><<BR>> {{attachment:dipoles5.gif||width="430",height="347"}} * Displaying the dipoles with a goodness of fit above 95% produces very similar figures. It is a good way to cross-validate the dipole results you obtain: if these two approaches lead to completely different interpretations, you should not trust either one. <<BR>><<BR>> {{attachment:dipoles6.gif||width="660",height="190"}} * More information about dipole fitting: [[http://neuroimage.usc.edu/brainstorm/Tutorials/DipoleFitting|FieldTrip dipole fitting]] == Source analysis: MEM inverse solution == The maximum of entropy on the mean (MEM) framework solution gathers several source localization techniques dedicated to estimate accurately the''' spatial extent of '''the EEG/MEG generators, a very important property in the context of localizing the generators of epileptic discharges, for which it is known that a relatively extended brain region should be involved (several cm^2^) in order to detect these discharges from the scalp. You can read more information on MEM in the Brain entropy in space and time (BEst) in the [[http://neuroimage.usc.edu/brainstorm/Tutorials/TutBEst|BEst tutorial]]. Here are the steps to perform MEM localization on epileptic spikes. * '''Head model''': Double-click on the head model computed on the cortical surface to select it. <<BR>>(MEM was not implemented for the volume head models) * '''Baseline''': MEM solution relies on a data-driven parcelization of the brain. To do so, it requires some baseline data that can be taken either from a segment of signal of interest or from another baseline section with no epileptic discharges extracted from the data (typically 2s). Here, we will use the 10s segment that was previously extracted to compute the noise covariance. * Copy the 10s segment raw data "'''Raw (120.00s,130.00s)'''" and paste it in folder "'''SPIKE'''". * Rename it "'''baseline'''". BEst toolbox will automatically detect it, and consider it as the baseline for the data-driven parcelization. * '''Inverse model''': Right-click on the average signal "'''Avg: SPIKE (58 files)'''" > '''Compute source'''. <<BR>>Click '''[Experimental] BrainEntropy MEM'''. If you don’t see it click on '''Expert mode '''first. <<BR>><<BR>> {{attachment:mem_bstpanel.png||width="207"}} {{attachment:mem_inversepanel.png||width="180"}} * The MEM option panel appears. You have the choice between 3 methods. ''cMEM'' is the standard MEM in the time domain. ''wMEM'' focuses in the oscillatory patterns by computing MEM in the wavelet domain. ''rMEM'' is dedicated in finding synchronous sources using continuous wavelets. Select '''cMEM''' for this tutorial. * To learn how to use the option parameters of cMEM, we encourage you to read the [[http://neuroimage.usc.edu/brainstorm/Tutorials/TutBEst|MEM tutorial]]. Here, we will use the default values. Press ok to start the source estimation; MEM is an iterative localization approach, so computation time will depend on the time window selected. <<BR>>Double click on the source file that was created to display the results <<BR>><<BR>> {{attachment:mem_panel.png||width="299"}} {{attachment:mem_screenshot.png||width="359",height="304"}} * Examples of display: [[http://neuroimage.usc.edu/brainstorm/Tutorials/Epilepsy?action=AttachFile&do=get&target=mem_video.avi|Video]] | [[http://neuroimage.usc.edu/brainstorm/Tutorials/Epilepsy?action=AttachFile&do=get&target=mem_contactsheet.png|Contact sheet]] == Time-frequency == We will illustrate two ways of computing time-frequency maps. Exploring the continuous recordings in time-frequency space can help with the detection of the epileptic activity, while computing the average of the time-frequency power of a few epochs can help understanding the dynamic of the event. === Continuous recordings === * Right-click on the filtered continuous file (Raw|band) > '''Import in database'''. Select a block of 10s between '''1890s '''and '''1900s''' (this segment contains a lot of spikes). Do '''not''' use events. <<BR>><<BR>> {{attachment:tf1.gif||width="595",height="257"}} * In Process1, select the new imported file: "Raw (1890.00s,1900.00s)" * Run process '''Frequency > Time-Frequency (Morlet wavelets)''': <<BR>>Sensors='''EEG''', '''1/f compensation''', Frequency='''Log 2:40:80''' <<BR>><<BR>> {{attachment:tf2.gif||width="635",height="372"}} * Display the new time-frequency file. In the Display tab, select channel '''FC1'''. You can notice that the vertical stripes in the time-frequency map match the spikes in this segment of file. The epileptic brain activity can be easier to detect in time-frequency space than in the original signals. <<BR>><<BR>> {{attachment:tf3.gif||width="631",height="264"}} === Spike average === * In Process1, select all the imported spike epochs. * Run process '''Frequency > Time-Frequency (Morlet wavelets)''': <<BR>>Sensors='''EEG''', Spectral flattening='''None''', Frequency='''Log 2:40:80''', '''Save average'''. <<BR>><<BR>> {{attachment:tf4.gif||width="592",height="390"}} * In Process1, select the new time-frequency average. * Run process '''Standardize > Baseline normalization''': Baseline='''[-200,-100]ms''', '''ESR/ERD'''. <<BR>><<BR>> {{attachment:tf5.gif||width="416",height="351"}} * Right-click on the average > All channels, then adjust the colormap. <<BR>><<BR>> {{attachment:tf6.gif||width="631",height="229"}} == Additional documentation == ==== Related tutorials ==== * [[Tutorials/Epileptogenicity|sEEG epileptogenicity maps]] * [[https://neuroimage.usc.edu/brainstorm/Tutorials/Epileptogenicity#Video-EEG|EEG-Video synchronization]] * [[https://neuroimage.usc.edu/brainstorm/Tutorials/ECoG|ECoG/sEEG tutorial]] ==== Forum posts ==== * EEG reference: [[http://neuroimage.usc.edu/forums/showthread.php?1525#post6718|Reference of the gain matrix]] * Registration: [[http://neuroimage.usc.edu/forums/showthread.php?2528|Match known EEG locations to the MRI image]] * Pre-processing: [[http://neuroimage.usc.edu/forums/showthread.php?2680|Bad channel replacement]] ==== Minimum number of electrodes for EEG source modeling ==== * Song J, Davey C, Poulsen C, Luu P, Turovets S, Anderson E, Li K, Tucker D<<BR>>[[https://www.sciencedirect.com/science/article/pii/S0165027015003064?via=ihub|EEG source localization: Sensor density and head surface coverage]]<<BR>>Journal of Neuroscience Methods, Dec 2015 * Michel CM, Brunet D<<BR>>[[https://www.frontiersin.org/articles/10.3389/fneur.2019.00325/full|EEG source imaging: A practical review of the analysis steps]]<<BR>>Frontiers in Neurology, Apr 2019 ==== Inverse models in epilepsy ==== * '''Distributed source models vs. ECD (equivalent current dipole)'''<<BR>>Kobayashi K, Yoshinaga H, Ohtsuka Y, Gotman J (2005)<<BR>>[[http://onlinelibrary.wiley.com/doi/10.1111/j.0013-9580.2005.31404.x/full|Dipole modeling of epileptic spikes can be accurate or misleading]]<<BR>> Epilepsia, 2005 Mar;46(3):397-408. * '''Distributed source models vs. BOLD'''<<BR>>Heers M, Hedrich T, An D, Dubeau F, Gotman J, Grova C, Kobayashi E (2014)<<BR>>[[http://onlinelibrary.wiley.com/doi/10.1002/hbm.22482/abstract|Spatial correlation of hemodynamic changes related to interictal epileptic discharges with electric and magnetic source imaging]]. Human Brain Mapping, published online 24 Feb 2014. * '''ECD vs. BOLD'''<<BR>>Benar CG, Grova C, Kobayashi E, Bagshaw AP, Aghakhani Y, Dubeau F, Gotman J (2006)<<BR>>[[http://www.ncbi.nlm.nih.gov/pubmed/16413798|EEG–fMRI of epileptic spikes: Concordance with EEG source localization and intracranial EEG]]<<BR>>NeuroImage, 30:1161-1170. ==== MEM in clinical epilepsy ==== Related methodological developments: * Amblard C, Lapalme E, Lina JM (2004)<<BR>>[[http://www.ncbi.nlm.nih.gov/pubmed/15000374|Biomagnetic source detection by maximum entropy and graphical models]], IEEE Trans Biomed Eng. * Lapalme E, Lina JM, Mattout J (2006)<<BR>>[[http://www.ncbi.nlm.nih.gov/pubmed/16426867|Data-driven parceling and entropic inference in MEG]], NeuroImage. Ability of MEM to recover the spatial extent of epileptic spikes: * Grova C, Daunizeau J, Lina JM, Benar CG, Benali H, Gotman J (2006)<<BR>>[[http://www.ncbi.nlm.nih.gov/pubmed/16271483|Evaluation of EEG localization methods using realistic simulations of interictal spikes]], NeuroImage. * Chowdhury RA, Lina JM, Kobayashi E, Grova C (2013)<<BR>>[[http://www.plosone.org/article/info:doi/10.1371/journal.pone.0055969|MEG Source Localization of spatially extended generators of epileptic activity: Comparing Entropic and Hierarchical Bayesian Approaches]], PloS ONE. Multimodal concordance on clinical cases: * Grova C, Daunizeau J, Kobayashi E, Bagshaw AP, Lina JM, Dubeau F, Gotman J (2008)<<BR>>[[http://www.ncbi.nlm.nih.gov/pubmed/17945511|Concordance between distributed EEG source localization and simultaneous EEG-fMRI studies of epileptic spikes]], NeuroImage. * Heers M, Hedrich T, An D, Dubeau F, Gotman J, Grova C, Kobayashi E (2014)<<BR>>[[http://www.ncbi.nlm.nih.gov/pubmed/24615912|Spatial correlation of hemodynamic changes related to interictal epileptic discharges with electric and magnetic source imaging]], Hum Brain Mapp. ==== Background readings: Epilepsy and EEG/MEG ==== * Ebersole JS, Husain AM, Nordli DR<<BR>>[[http://www.lww.com/Product/9781451131956|Current Practice of Clinical Electroencephalography]] * Laoprasert P<<BR>>[[http://neurology.mhmedical.com/book.aspx?bookID=1042|Atlas of Pediatric EEG]] * Anderson CT, Carlson CE, Li Z, Raghavan M<<BR>>[[http://www.ncbi.nlm.nih.gov/pubmed/24652454|Magnetoencephalography in the preoperative evaluation for epilepsy surgery]]<<BR>>Curr Neurol Neurosci, Rep. 2014 May;14(5):446. * Kharkar S, Knowlton R<<BR>>[[http://www.ncbi.nlm.nih.gov/pubmed/25555504|Magnetoencephalography in the presurgical evaluation of epilepsy]]<<BR>> Epilepsy Behav. 2015 May;46:19–26. == Scripting == The following script from the Brainstorm distribution reproduces the analysis presented in this tutorial page: [[https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/script/tutorial_epilepsy.m|brainstorm3/toolbox/script/tutorial_epilepsy.m]] <<HTML(<div style="border:1px solid black; background-color:#EEEEFF; width:720px; height:500px; overflow:scroll; padding:10px; font-family: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,sans-serif; font-size: 13px; white-space: pre;">)>><<EmbedContent("https://neuroimage.usc.edu/bst/viewcode.php?f=tutorial_epilepsy.m")>><<HTML(</div >)>> <<EmbedContent(https://neuroimage.usc.edu/bst/get_feedback.php?Tutorials/Epilepsy)>> |
EEG and epilepsy
Authors: Francois Tadel, Elizabeth Bock, John C. Mosher, Marcel Heers.
A newer version of this tutorial is available: https://neuroimage.usc.edu/brainstorm/Tutorials/Epilepsy
This tutorial introduces some concepts that are specific to the management of EEG recordings in the Brainstorm environment. It also describes a standard pipeline for analyzing epilepsy recordings. It is based on a clinical case from the Epilepsy Center at the University Hospital of Freiburg, Germany. The anonymized dataset can be downloaded directly from the Brainstorm download page.
Note that the operations used here are not detailed, the goal of this tutorial is not to introduce Brainstorm to new users. For in-depth explanations of the interface and theoretical foundations, please refer to the introduction tutorials.
NOT FOR CLINICAL USE:
The performance characteristics of the methods and software implentation presented in this tutorial have not been certified as medical devices and should be used for research purposes only.
Contents
- Dataset description
- Download and installation
- Import the anatomy
- Access the recordings
- Review EEG recordings
- Mark spikes
- Pre-process recordings
- Artifact cleaning with ICA
- Import the recordings
- Source analysis: Surface
- Source analysis: Volume
- Source analysis: MEM inverse solution
- Time-frequency
- Additional documentation
- Scripting
Dataset description
License
This tutorial dataset (EEG and MRI data) remains proprietary of the Epilepsy Centre, University Hospital Freiburg, Germany. Its use and transfer outside the Brainstorm tutorial, e.g. for research purposes, is prohibited without written consent from the Epilepsy Centre in Freiburg. For questions please contact A. Schulze-Bonhage, MD, PhD: andreas.schulze-bonhage@uniklinik-freiburg.de
Clinical description
This tutorial dataset was acquired in a patient who suffered from focal epilepsy with focal sensory, dyscognitive and secondarily generalized seizures since the age of eight years. He does not have any typical risk factors for epilepsy. The high resolution 3T epilepsy MRI including postprocessing was found to be normal. FDG-PET of the brain did not show any pathological changes in the glucose metabolism. Non-invasive telemetry revealed left fronto-central sharp waves, polyspikes and bursts of beta band activity (max. amplitude FC1, Cz) especially during sleep. The tutorial dataset was acquired during one night of the non-invasive telemetry recording at the Epilepsy Center Freiburg, Germany.
Afterwards the patient underwent invasive EEG to identify the epileptogenic area and to map functionally important cortex. Details about invasive EEG and source localization from invasive EEG in this patient are reported in Dümpelmann, et al. (2011). Subsequently a left frontal tailored resection was performed. The histological analysis revealed a focal cortical dysplasia type IIB according to the classification of Palmini, et al. (2004). The postsurgical outcome is Engel 1A with a follow-up of 5 years.
The EEG data distributed here was recorded at 256Hz, using a Neurofile NT digital video-EEG system with 128 channels and a 16-bit A/D converter. The signal was filtered in the recording system with a high-pass filter with a time constant of 1 second (cutoff frequency ~ 0.16Hz) and a low-pass filter with a cutoff frequency of 344 Hz. The spikes were marked with Brainstorm by the epileptologists at the Epilepsy Center in Freiburg.
Overview of the data processing
The proper identification of epileptiform discharges ("spikes") is a complicated topic beyond the scope of this tutorial. Residents in Neurology train intensively on how to identify true interictal and ictal discharges, particularly as distinct from so-called "normal variants" that can be abundant. Sleep and drowsy states of the brain can generate "vertex waves," "K-complexes," "positive occipital sharp transients of sleep" (POSTS), and "wickets," to name a few variants, none of which are epileptic. A good overview of terminology and application can be found, for example, on the Medscape website, Epileptiform Discharges.
With this caveat, we nonetheless give an overview of the processing approach. Although automation has been proposed for decades, "spike hunting" is often done by manual inspection of the recorded EEG waveforms (whether scalp, subdural, or depths). The classic scalp sensor arrangement is the International 10-20 System (Wikipedia Site, Bioelectromagnetism Book, Chapter 13.3) arranged at 10 percent and 20 percent distances about the circumference of the head. Each of these 21 electrodes is acquired with respect to some reference (as all potentials must be). In reviewing the recordings, however, several "montages" are traditionally recommended that digitally "re-reference" the original recordings into new linear combinations of electrodes.
A classic montage is the "double banana" (Google Search) which emphasizes local changes in the scalp EEG by forming sequential bipolar pairs, such as "Fp1-F3", "F3-C3." Because F3 is found twice in this montage and of opposite sign, then an epileptic spike centered under F3 will appear as a reversed polarity in these two channels, a visual cue the trained epileptologist seeks when rapidly scanning through hours of recordings. This montage is more formally known as "LB-18.3" or "Longitudinal Bipolar 3" in the nomenclature of the American Clinical Neurophysiology Society (ACNS) Guidelines (see References Below).
ACNS guidelines suggest using both "longitudinal" and "transversal" bipolar montages to survey your data. For temporal epilepsy cases, you may also add a "temporal ring" montage. European neurologists often prefer to review the recordings using an average reference montage. Brainstorm provides several variations of all these montages, allows the users full flexibility in creating their own, and can run different montages simultaneously in multiple windows.
The user has to step along through the data, look for abnormal brain activity, then use Brainstorm's event markers to tag suspect intervals. With the suspected events marked and saved, the user can return later to perform source analyses on these intervals. With this brief overview, we detail below an exercise with the sample epilepsy data.
Note that the aim of this tutorial is not to train you on how to do spike recognition itself, but rather to illustrate how to manipulate the Brainstorm interface to build an environment adapted to this task. The formal data reviewing should be done by clinical neurophysiologists or other experienced personnel, with specialized training in separating true epileptic activity from other more normal variants of brain activity.
References
Dümpelmann M, Ball T, Schulze-Bonhage A (2011)
sLORETA allows reliable distributed source reconstruction based on subdural strip and grid recordings. Human Brain Mapping.
Palmini A, Najm I, Avanzini G, Babb T, Guerrini R, Foldvary-Schaefer N, Jackson G, Luders HO, Prayson R, Spreafico R, Vinters HV (2004) Terminology and classification of the cortical dysplasias.
Neurology, 62:S2-8.
Standard montages recommended by the American Clinical Neurophysiology Society:
Download and installation
Requirements: You have already followed all the introduction tutorials and you have a working copy of Brainstorm installed on your computer.
Go to the Download page of this website, and download the file: sample_epilepsy.zip
Unzip it in a folder that is not in any of the Brainstorm folders (program folder or database folder)
- Start Brainstorm (Matlab scripts or stand-alone version)
Select the menu File > Create new protocol. Name it "TutorialEpilepsy" and select the options:
"No, use individual anatomy",
"Yes, use one channel file per subject".
Import the anatomy
- Switch to the "anatomy" view of the protocol.
Right-click on the TutorialEpilepsy folder > New subject > sepi01
- Keep the default options you set for the protocol
Right-click on the subject node > Import anatomy folder:
Set the file format: "FreeSurfer folder"
Select the folder: sample_epilepsy/anatomy
- Number of vertices of the cortex surface: 15000 (default value)
In the MRI Viewer, click on "Click here to compute MNI transformation". It computes an affine transformation between the subject space and the MNI ICBM152 space, and sets default positions for all the anatomical landmarks.
Click on [Save] to validate the modifications and continue with the importation of the anatomy. At the end, make sure the file "cortex_15000V" is selected (downsampled pial surface, that will be used for the source estimation). If it is not, double-click to select it as the default cortex surface.
Without the individual MRI
If you do not have access to an individual MR scan of the subject (or if its quality is too low to be processed with FreeSurfer), but if you have digitized the head shape of the subject using a tracking system, you have an alternative: deform one of the Brainstorm templates (Colin27 or ICBM152) to match the shape of the subject's head.
For more information, read the following tutorial: Warping default anatomy
Access the 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: Deltamed Coherence-Neurofile(*.bin)"
Select the file: sample_epilepsy/data/tutorial_eeg.bin
The new files "Link to raw file" let you access directly the contents of the original SEEG files. The menu "Review raw file" does not actually copy any data to the database. More information.
- The channel file "Deltamed channels" in the (Common files) folder contains the name of the channels, but not their positions. We need to import separately the positions of the electrodes (either a standard cap or accurate positions digitized with a Polhemus device or any other tracking system).
Prepare the channel file
- Import the positions of the electrodes:
Right-click the channel file in Common files > Add EEG positions > Import from file:
- Select the file format: "EEG: ANT Xensor (*.elc)"
Select the file: sample_epilepsy/data/tutorial_electrodes.elc
- This file contains the default electrodes positions from the ASA software (ANT).
- If you have digitized the position of the electrodes (eg. with a Polhemus device) you have to make sure it contains the position of the anatomical references NAS/LPA/RPA. This is the best way to make sure the electrode cap will be registered automatically with the MRI in Brainstorm.
- The channels are matched by name: the position file you import must include the labels of the electrodes and they must be named exactly in the the same way as in your recordings.
In this example, you will get a question "Apply MRI transformation?". If you answer yes, it would apply the voxel=>world transformation initially available in the MRI volume. Whether you need to answer Yes or No depends on which coordinates system is closer to the one use in your position file. Try both and you'll see which one brings the electrodes closer to the head of the subject. Here, answering NO would give a better immediate result, but as we will run the automatic alignment electrodes/head surface later, the answer to this question doesn't matter much.
- The recordings contain signals coming from different types of electrodes:
- 29 EEG electrodes
- EOG1, EOG2: Electrooculograms
- EMG, ECG: Electromyogram and electrocardiogram
- SP1, SP2: Sphenoidal electrodes
- RS: Electrode on the right shoulder
- PHO: Photo stimulation channel
- DELR, DELL, QR, QL: Not used
Right-click on the channel file > Edit channel file:
- Note that the EOG, EMG and ECG channels have their type correctly detected.
- All the other non-EEG channels were set to "EEG_NO_LOC" when we imported the channel locations: SP1, SP2, RS, PHO, DELR, DELL, QR, QL
It happens commonly that the file format for the electrodes positions does not describe the type of the channels correctly, typically all the signals saved in the files are classified as EEG. You can edit the names and types of the channels with this in interface: select one channel, click on the type and select something in the drop-down list. To edit multiple channels at once: right-click in the window > Set channel type.
For this particular study, we can use the channel file as it is configured now, just close the figure. Discard any modification you may have done.
Register electrodes with MRI
Right-click on the channel file > MRI registration > Edit.
Hover your mouse over the toolbar buttons for instructions. Click on the [Label] button in the toolbar to show the names of the electrodes. The default positions are already quite good, and the head shape is correct, only limited manual registration will be required in the next few steps.
Click on the button "Refine registration using head points" to find a better registration between the head shape defined by the electrodes and the head surface coming from the MRI. Note that this works only if have accurate head shapes and electrodes positions. If you don't, skip this step and edit the registration manually.
Click on the button "Project electrodes on scalp surface", to ensure all the electrodes touch the skin surface. Then click on "OK" and agree to save the modifications.
If you want to see or edit the positions of the electrodes in the MRI Viewer: right-click on the channel file > Display sensors > EEG (MRI Viewer). Select the menu "MIP: Functional" to see all the electrodes. To edit the channel file: right-click > Electrodes > Set electrode position.
Review EEG recordings
Display the recordings
Open a time series figure with the "Average reference" montage
Right-click on the "Link to raw file" > EEG > Display time series.
- In the Record tab, select the first button in the toolbar (Display mode for time series) to view the signals in columns.
- Select "Average reference" in the drop-down list. This menu allows you to set a predefined montages to linearly re-arranging the waveforms. Note the keyboard shortcuts in the menus.
Change the default duration that is reviewed to 10s.
In the figure, click on the [Flip +/-] button to have the negative values pointing up (convention used by most neurologists).
Open a 2D Sensor cap map of the EEG sensor values:
Right-click on "Link to raw file" again > EEG > 2D Sensor cap
In the Record tab, set the Montage to this view to "Average reference"
Open the ECG and EOG traces, to avoid confusing spikes with cardiac or ocular artifacts:
Right-click on the Link to raw file > ECG > Display time series
Right-click on the Link to raw file > EOG > Display time series
- The ECG is almost mandatory. The EOG is optional: it can be helpful for beginners but an experienced reviewer will easily recognize the eye movements directly in the EEG data.
Re-arrange the figures in a convenient way, for example as illustrated below. Then disable the automatic positioning of the figures (layout menu at the top-right of the Brainstorm figure > None), so that your figure arrangement doesn't get lost when you open a new figure.
Having a lot of windows open may slow down significantly the display because each time you change the current time, all the figures have to be updated. A lot of space is also wasted on the screen due to window frames. The number of windows to open has to be balanced between the amount of information to display and the ease of use.
Frequency filters
Go to the Filter tab to enable some display frequency filters. General recommendations are:
High-pass filter: 0.5 Hz
Low-pass filter: 80 Hz
Note that if you have filters selected in this panel, the display of the EEG signals will be slower. Each time you will go to the next page of recordings, the filters will be applied on the fly to the recordings. The computation time is not very long at each page, but can become annoying when reviewing a lot of data. For a faster display of filtered signals, you may consider apply the filters to the file (with the process Pre-process > Band-pass filter) and then review the recordings without visualization filters.
Time and amplitude resolution
The resolutions of the time and amplitude axes have a lot of importance for the visual detection of epileptic spikes. The shapes we are looking for are altered by the horizontal and vertical scaling. The distance unit on a screen is the pixel, we can set how much time is represented by one pixel horizontally and how much amplitude is represented by one pixel vertically.
In the Brainstorm interface, this resolution is usually set implicitly: you can set the size of the window, the duration or recordings reviewed at once (text box "duration" in tab Record) and the maximum amplitude to show in the figure (buttons [...] and [AS] on the right of the time series figure). From there, you can also zoom in time ([<], [>], mouse wheel) or amplitude ([^], [v], Shift+mouse wheel). These parameters are convenient to explore the recordings interactively but don't allow us to have reproducible displays with constant time and amplitude resolutions.
To set the figure resolution explicitly: right-click on the figure > Figure > Set axes resolution. Note that this interface does not store the input values, it just modifies the other parameters (figure size, time window, max amplitude) to fit the resolution objectives. If you modify these parameters (resize the figure, keep the button [AS] selected and scroll in time, etc) the resolution is lost, you have to set it again manually. In particular, make sure you disable the auto-scaling ([AS] button in the time series figure) if you want to preserve the aspect ratio while you scroll through the data.
This operation typically has to be repeated everytime you open a new file. For a faster access to this option, use the keyboard shortcut Ctrl+O. The option window offers by default the last values that you entered, just press Enter to apply them again.
Recommendations for this dataset are:
Time axis: 170 pixels/sec (~55 mm/sec)
Amplitude: 15 μV/pixels (~45 μV/mm)
User setups
This preparation of the reviewing environment requires a large number of operations, and would become quickly annoying if you have to repeat it every time you open a file. You can use the menu "User setups" to save a window configuration and reload it in one click later. In the menu "Window layout", at the top-right of the Brainstorm window, select User setup > New setup. Enter a name of your choice for this particular window arrangement.
This operation will also disable the automatic window arrangement (Window layout > None). To reload it later, open one figure on the dataset you want to review and then select your new entry in the User setup menu.
Multiple montages
It may be interesting for some cases to display different groups of sensors in multiple windows (eg. with an MEG system with 300 sensors), or some complicated epilepsy cases where you would like to review at the same time multiple montages (eg. longitudinal and transversal bipolar montages).
Open your full reviewing environment as described before, where the EEG signals are displayed with the "Average reference" montage.
Open another view on the same data with the "Longitudinal 3" montage ("double-banana" LB-18.3)
Right-click on the "Link to raw file" again > EEG > Display time series
Alternatively, you can right-click on the existing figure > Figure > Clone figure.
- Then set the montage for this new figure to "Longitudinal 3".
- Resize all the figures to make room for the new window.
- Save this window configuration as a new "User setup".
- If you don't see the "Longitudinal 3" menu, it is probably because you have been using Brainstorm before these predefined montages were made available in the distribution. To add them manually:
- In the Record tab, select "Edit montages" in the drop-down menu
- Click on the "Load montage" button.
- Go to the folder "brainstorm3/toolbox/sensors/private/", and select the first file.
- Note that a new entry (probably "Longitudinal 1") is added to the list of available montages.
- Repeat the operation with all the files in the folder "brainstorm3/toolbox/sensors/private/".
- Click on "Save" to close the montage editor and now select "Longitudinal 3".
More information available in the tutorial Montage editor.
Scalp current density
In the example below, see how the montage Scalp current density can enhance the visual detection of spikes. More information.
Mark spikes
Detect heartbeats
When you have a clean ECG signal for your patient, you can automatically identify all the heartbeats in the recordings. Because heartbeats can cause sharp waves in some EEG traces, it helps the reviewing process to have all the cardiac events marked in the recordings.
Right-click on the "Link to raw file" > EEG > Display time series (or simply double-click on the file).
In the tab Record, menu Artifacts > Detect heartbeats: Channel=ECG, All file.
Import the spike markers
Some spikes were marked by the epileptologists at the Epilepsy Center in Freiburg and saved in an external text file. We are going to import this file manually.
In the tab Record, menu File > Add events from files...
Select format Array of times (text file containing the timing of the markers)
Select file sample_epilepsy/data/tutorial_spikes.txt
When prompted, enter the event name "SPIKE"
A new category SPIKE is visible in the events list, containing 58 markers. Click on a few of them and try to identify the shape of the spike (mostly visible on the channel FC1). Then close the viewer and save the modifications.
- The two other types of events that were present initially in the file (REM/REM_Ende) indicated the beginning and the end of periods or REM sleep (the patient is sleeping during the entire session).
Manual marking
If you are marking the events by yourself, you could follow this procedure:
- Close all the current figures ("Close all" button at the top-right corner of the Brainstorm window).
- Double-click on the "Link to raw file" to open a continuous file viewer, and load your reviewing environment (menu User setups).
Start by creating a group of events (Events > Add group), and select it in the list of events.
Make sure that the time and amplitude resolutions are what you are used to
(right-click on the figure > Figure > Set axes resolution)Scroll through the recordings using the [<<<] and [>>>] buttons or shortcuts such as F3 or F4 (complete list and descriptions available when you hover your mouse over these buttons).
You can adjust the gain of the electrodes to observe better an event with the buttons [^] and [v], with the keyboard (+/-) or the mouse ([Shift+mouse wheel] or [Right-click+move up/down]).
- When you identify a spike, click in a white area of the figure in order to place the time cursor at the peak of the spike. If you click on the signal itself, it selects the corresponding channel, but you can use the shortcut Shift+Click to prevent this behavior and force the time cursor to be moved instead.
- Press Ctrl+E to add a marker where the time cursor is.
If you are marking multiple types of events, it is convenient to set up some additional keyboard shortcuts. Using the menu Events > Edit keyboard shortcuts, you can associate custom events to the keys 1 to 9 of the keyboard. Define the name of the event type to create for each key, and then simply press the corresponding key to add/delete a marker at the current time position.
- To jump to the next/previous event in the current category: use the keyboard shortcuts [Shift+arrow right] and [Shift+arrow left]
More information on the data viewer, see tutorial: Review continuous recordings.
Pre-process recordings
Two of the typical pre-processing steps consist in removing the power lines artifacts (50 Hz or 60Hz) and the frequencies we are not interested in (a low-pass filter to remove the high-frequency noise and a high-pass filter to remove the very slow components of the signals). Let's start with a spectral evaluation of this file.
Power spectrum
- In the Process1 box: Drag and drop the "Link to raw file".
Run process Frequency > Power spectrum density (Welch): All file, Length=10s, Overlap=50%.
Double-click on the new PSD file to display it.
This frequency spectrum does not show any particular peak at 50/60Hz, there is no notch filter to apply on these recordings. If we had to, we would run the process "Pre-processing > Notch filter" as explained in the tutorial Detect and remove artifacts.
Band-pass filter
The filters we selected for reviewing the recordings were for visualization only, they were not applied to the file. In order to apply these filters permanently to the recordings, we need to do the following:
- Keep the "Link to raw file" selected in the Process1 list.
Run process Pre-process > Band-pass filter: [0.5,80]Hz, 60dB, no mirror, sensors=EEG
- Note that this new continuous file is saved in your Brainstorm database, while the original file is saved in a separate folder (sample_epilepsy). If you delete the link to the original file with the database explorer, it would not delete the actual file. If you delete the link to the filtered file, it would delete the file itself.
Average reference
The average reference montage we used to review the recordings was for visualization only, it did not modify the file. To apply this transformation permanently, we need to run the re-referencing process.
- Double-click on the filtered file "Raw | band(0.5-80Hz)" to open it.
In the Record tab, select the menu Artifacts > Re-reference EEG: Enter AVERAGE.
The re-referencing is saved in the same way as the SSP and ICA projectors: a linear operator applied dynamically to the recordings. At the end of the process, the window "Select active projectors" is shown, so that you can control the list of projectors currently applied to the file. Close this figure and close the recordings.
Average reference and bad channels
You should be careful with the average reference when adding or removing bad channels. Changing the number of channels modifies the way the average reference is computed.
Montage: When using the montage "Average reference" to change only the visulization, the average reference operator is computed dynamically, it always takes into account the bad channels at the moment you review the recordings. Therefore the average reference for display is always correct, you do not have to modify anything if you change the list of bad channels.
Permanent re-referencing: When using the process "Re-reference EEG" to alter permanently the recordings, the average reference operator is computed using the channels that are marked as bad at the moment of the computation, and saved in the file. If later you modify the list of bad channels, this operator will become incorrect, you will have to delete it and recompute it. To avoid any confusion, always compute the average reference after marking the bad channels.
Evaluate the modifications
- In Process1, select the filtered file "Raw | band(0.5-80Hz)".
Run again the process Frequency > Power spectrum density (Welch), with same options.
Double-click on the new PSD file to display the spectrum of the filtered file. You can observe the effects of the filter (drops on the two sides of the spectrum, zoom in to observe it better) and the average reference (all the signals have now a similar level of power).
Artifact cleaning with ICA
The standard cleaning pipeline presented in the introduction tutorials recommends to use the SSP approach to remove the cardiac and blink artifacts. This is valid in most MEG experiments.
In EEG, there is usually not such a clear artifact caused by the heartbeats: cleaning for cardiac artifacts is not part of the standard processing pipeline. Eye movements typically cause huge artifacts on the frontal channels and need to be marked as bad or corrected. In the present case, the patient is sleeping, therefore there are no blinks, but we can observe a lot of fast eye movements during the periods of REM sleep, and other slower eye movements in the rest of the recordings.
The SSP technique is not adapted for cleaning events for which we cannot set markers, and in general it is not suitable for low-density EEG. The topographies are a lot smoother in EEG than in MEG, it is more difficult to identify a spatial filter that targets one specific artifact with a simple spatial PCA decomposition, especially with a very low number of sensors.
The ICA approach (Independent Component Analysis) is much more popular in the EEG community. It relies on the the same logic as the SSP: identifying spatial topographies that are specific from an artifact and then removing them from the recordings. But instead of simply identifying the most powerful spatial components with a PCA decomposition, it tries to identify components that are independent in time. Using the information from the time dimension makes it possible to work with a very low number of sensors, and to identify some components of the signal that are completely uncorrelated with the others.
The ICA analysis can also be used to identify the signals from a few brain sources of interest: in this case, we select a few components and remove all the others. For more information on ICA, please refer to the documentation of the EEGLAB software.
We will illustrate now how to compute some projectors to remove the contaminations from the eye movements with the Infomax algorithm. To make it run fast on most computers, we will not process the full recordings but only a short segment which contains a lot of eye movements: [500,700]s.
- Double-click on the filtered file "Raw | band(0.5-80Hz)" to open it.
In the Record tab, select the menu Artifacts > ICA components.
Time window: Segment where the artifact is present (or all the recordings if you have time).
Event name: Empty, we want to use all the recordings from the selected time window.
Event window: Not applicable (because the previous option is empty).
Frequency band: Ignore (0-0Hz), we want to perform the analysis on the broadband signal.
Number of ICA components: If this value is higher than 0 and lower than the number of channels, it will first perform a spatial PCA decomposition, keep only the N principal components, and pass this subspace to the ICA algorithm.
In the current example, the algorithm doesn't converge if we use all the components (25 EEG channels), we have to enter 24 to make it work.
[TODO] This issue has to be investigated further.Sensor types: EEG
Sort components based on correlation with: Sort ICA components based on their correlation with a selection of 'reference' channels (default: ECG & EOG). The sorting is based on the maximum correlation of a given ICA time-series with any of the reference channels.
Using existing SSP/ICA: Yes. In this case, using or not the existing re-referencing projector should not make any difference, but it would change the results if you have other projectors already computed.
Save averaged artifact: Not applicable (because we are not using events).
ICA method: Infomax (calls directly the function runica.m from EEGLAB).
You can follow the convergence of the Infomax algorithm in the Matlab command window. When it is done, the window "Select active projectors" is shown. Select all the components, display their spatial topography and time series (read the tooltips to see which button does what). The first two components (IC1, IC2) look very correlated with the EOG signals, and their topographies are typical of eye movements.
- If the algorithm doesn't converge: try to run the ICA decomposition before the EEG referencing (either delete the "EEG reference" projector, or unselect the option "Use existing SSP/ICA").
Select the first two components to remove them: observe the effect on the EEG signals. It removes very well the artifacts due to the eye movements without affecting the rest of the recordings.
Go to around a SPIKE event, make sure that removing these two components doesn't affect the shape of the spike. We do not want them to alter our events of interest.
- Select the first two components, click on [Save] to keep this selection.
To save the ICA time series in a new file in the database, follow the instructions in the SSP tutorial: Extract the time series.
Import the recordings
Epoching
Now we want to extract all the spikes from this filtered file and import them in the database.
Right-click on the filtered file (Raw|band) > Import in database.
Select the option "Use events" and select the category SPIKE, with 58 events.
Epoch time: [-300, +500]ms around the spike events.
- Remove DC offset: Disabled, the DC offset has already been removed with the high-pass filter.
You should see a new folder "SPIKE" containing 58 epochs in your database.
- We recommend you always review all the trials after importing them. To review the imported trials: double-click on the first trial, switch back to butterfly view (first button in Record tab), then navigate between trials with F3 / Shift+F3. Channels and trials can be marked as bad independently.
You can overlay one or more electrodes from multiple files with the tab "Cluster":
- Display the time series for one trial (you must have at least one file loaded to create a cluster).
In the Brainstorm window: Click on the [+] to add the Cluster tab.
- In the Cluster tab: Click on [New Ind] and enter "FC1" (cluster with one electrode only).
- In the Cluster tab: Double-click to rename the cluster into something more meaningful ("FC1").
In the Cluster tab: Select the option "Overlay: Files"
In the database explorer: Right-click on the group of trials > Clusters time series.
Alternatively, you can display all the trials as an image, for one sensor at a time:
In the database explorer: Right-click on the on the group of trials > Display as image > EEG.
Averaging spikes
- Drag and drop all the SPIKE files or the SPIKE folder into the Process1 tab.
Run process Average > Average files, By folder (subject average), Arithmetic average.
Double click on the new file "Avg: SPIKE" to review it. Add a "2D sensor cap" view (popup or Ctrl+T).
Go to the Filter tab to disable all the visualization filters: these filters are not working well on short signals, the high-pass filter at 0.5Hz can introduce errors in the display of the average.
- To have all the figures automatically re-arrange themselves again, select "Weighted" or "Tiled" in the "Window layout" menu (top-right corner).
Explore this average in time with the left and right keyboard arrow. You can add more views to your reviewing environment (see the tutorial Visual exploration):
Typically, the analysis could be limited to the ascending part of the peak (from -11ms to 0ms), as it gives a rather clear information on the primary epilepsy focus. For the rest of the tutorial, we will use a larger time window (-40ms to 100ms) in order to illustrate the visualization tools. Just keep in mind that it can be hazardous to interpret waves that are far in time or in space from the primary focus.
To get a synthetic view at the sensor level of the evolution of the 2D map in time:
Right-click on the figure > Snapshot > Time contact sheet: Figure: [-40ms, 110ms], 16 images.
Source analysis: Surface
Head model
We are going to use a realistic head model. This requires additional surfaces to model the skull properly. Go to the "Anatomy" view, right-click on the subject > Generate BEM surfaces.
Use 1922 vertices for each layer (default). Three new surface files are created:
Go back to the "Functional data" view, right-click on the channel file > Compute head model. Select "cortex surface" and "OpenMEEG BEM". Leave all the OpenMEEG options to their defaults except for one: select the option "Use adjoint formulation". Depending on your computer, this may take between 10 and 60 minutes.
- Open your resource monitor to check the memory usage: if it goes over 98%, your system doesn't have enough RAM to compute this model. You should kill the process "om_gain", kill Matlab and try again with a different configuration.
If the automatic download doesn't work, download and install OpenMEEG manually (menu Help).
If the OpenMEEG calculation crashes, please refer to the OpenMEEG tutorial.An easy way to make this work a lot faster and with a limited amount of memory is to use less vertices for each layer, for example 1082 vertices (scalp) and 642 vertices (outer skull and inner skull). However, with less refined models you may run into other issues (intersecting meshes or numerical instabilities).
- If you can compute the model but the source maps you get don't make any sense, it is probably because the BEM surfaces were poorly defined. When some cortex vertices are too close to the inner skull surface, the model can be unstable and you would typically see source maps containing zeros everywhere except for a few vertices. If this happens, delete the existing BEM surfaces and try computing new ones with a higher number of vertices for the inner and outer skull surfaces.
If you cannot get OpenMEEG to work, or if the results definitely do not make sense, try using a different forward model: "3-shell sphere". It's a spherical model, so it would perform better in the regions of the head that are close to the sphere. See the Head model tutorial.
Noise covariance matrix
For minimum norm inverse models, we need to estimate the level of noise at the level of the sensors. Defining what can be considered as "noise" in the middle of continuous brain recordings is a difficult question, discussed in the Noise covariance tutorial.
Here we choose what is described as option 1b in the section "Epilepsy" in that tutorial: we are going to calculate the noise covariance matrix using 50 seconds from the continuous file that are very "quiet", ie. that contain no apparent epileptic activity, no REM and no other special artifacts. We can use for this purpose the segment between 110s and 160s.
Right-click on the filtered file "Raw|band" > Noise covariance > Compute from recordings: Baseline = [110,160]ms, keep the other options to the default values.
Inverse model
Right-click on the OpenMEEG head model > Compute sources [2016]: sLORETA, Unconstrained
It creates a shared inversion kernel in the folder (Common files) and a source link for each file in the subject. If you are not familiar with these concepts, please refer to the Source estimation tutorial.
Double-click on the source file for the average. Configure its display: surface smoothing, amplitude threshold, colormap. Make sure all the visualization filters are turned OFF.
To display the same information re-interpolated in the volume, right-click on the source file > Cortical activation > Display on MRI. Right-click on the figure to set the smoothing level and other options.
You can save movies or contact sheets of the source maps with the Snapshot popup menu
Regions of interest
- From the displays we generated previously, there is no clear propagation of the spike. The scouts can be an interesting tool to explore further this spatial propagation.
Start by placing a small scout at the focus, then place a few other scouts of a similar size at other places around the spike location, where you could suspect a possible propagation. Plot the overlaid time series for these scouts. If you need help with this: see the Scouts tutorial.
Source analysis: Volume
If the results you obtain are not satisfying with the surface-based source estimation, you can run again the same analysis with a different source space, sampling the entire head volume instead. More information about this method in the Volume source estimation tutorial. We will use this new example to estimate the dipole scanning tools.
Head model
Right-click on the channel file > Compute head model, select MRI volume. To go faster this time, you can select a spherical head model: 3-shell sphere. Use the default sphere.
Then you have to define what source grid you want to use. Keep the default options.
Dipole scanning
Right-click on the new head model > Compute sources: Dipole modeling.
Note that this is not a global inverse solution like the minimum norm. It represents the performance of each individual dipole, ie. its capacity to explain all the recordings at one time sample on its own.
- In Process1, select the Dipoles link associated with the average spike.
Run process Sources > Dipole scanning: [-40,100]ms
Double-click on the new dipoles file. In the Dipoles tab, set the threshold Goodness to 90% to show only the most meaningful dipoles. The color of the dipoles below represent the time at which each dipole was estimated. This representation seems to indicate there are two distinct brain regions: the activity at 40ms is deeper than at the peak of the spike (0ms).
More information about dipole scanning: Dipoles: Scanning and displaying.
Dipole fitting
The dipole scanning approach presented in the previous section estimates the activity of a fixed grid of dipoles and selects the most significant one at each time. Another option to represent the source activity as a sequence of moving dipoles is to use the FieldTrip function ft_dipolefitting.m to run a non-linear dipole fit at each time point. This process requires that you install the FieldTrip toolbox on your computer and will only work with a spherical head model.
- In Process1, select the EEG recordings for the average spike.
Run process Sources > FieldTrip: ft_dipolefitting: Time window=[-40,100]ms, Sensors=EEG.
Displaying the dipoles with a goodness of fit above 95% produces very similar figures. It is a good way to cross-validate the dipole results you obtain: if these two approaches lead to completely different interpretations, you should not trust either one.
More information about dipole fitting: FieldTrip dipole fitting
Source analysis: MEM inverse solution
The maximum of entropy on the mean (MEM) framework solution gathers several source localization techniques dedicated to estimate accurately the spatial extent of the EEG/MEG generators, a very important property in the context of localizing the generators of epileptic discharges, for which it is known that a relatively extended brain region should be involved (several cm2) in order to detect these discharges from the scalp. You can read more information on MEM in the Brain entropy in space and time (BEst) in the BEst tutorial.
Here are the steps to perform MEM localization on epileptic spikes.
Head model: Double-click on the head model computed on the cortical surface to select it.
(MEM was not implemented for the volume head models)Baseline: MEM solution relies on a data-driven parcelization of the brain. To do so, it requires some baseline data that can be taken either from a segment of signal of interest or from another baseline section with no epileptic discharges extracted from the data (typically 2s). Here, we will use the 10s segment that was previously extracted to compute the noise covariance.
Copy the 10s segment raw data "Raw (120.00s,130.00s)" and paste it in folder "SPIKE".
Rename it "baseline". BEst toolbox will automatically detect it, and consider it as the baseline for the data-driven parcelization.
Inverse model: Right-click on the average signal "Avg: SPIKE (58 files)" > Compute source.
Click [Experimental] BrainEntropy MEM. If you don’t see it click on Expert mode first.
The MEM option panel appears. You have the choice between 3 methods. cMEM is the standard MEM in the time domain. wMEM focuses in the oscillatory patterns by computing MEM in the wavelet domain. rMEM is dedicated in finding synchronous sources using continuous wavelets. Select cMEM for this tutorial.
To learn how to use the option parameters of cMEM, we encourage you to read the MEM tutorial. Here, we will use the default values. Press ok to start the source estimation; MEM is an iterative localization approach, so computation time will depend on the time window selected.
Double click on the source file that was created to display the results
Examples of display: Video | Contact sheet
Time-frequency
We will illustrate two ways of computing time-frequency maps. Exploring the continuous recordings in time-frequency space can help with the detection of the epileptic activity, while computing the average of the time-frequency power of a few epochs can help understanding the dynamic of the event.
Continuous recordings
Right-click on the filtered continuous file (Raw|band) > Import in database. Select a block of 10s between 1890s and 1900s (this segment contains a lot of spikes). Do not use events.
- In Process1, select the new imported file: "Raw (1890.00s,1900.00s)"
Run process Frequency > Time-Frequency (Morlet wavelets):
Sensors=EEG, 1/f compensation, Frequency=Log 2:40:80
Display the new time-frequency file. In the Display tab, select channel FC1. You can notice that the vertical stripes in the time-frequency map match the spikes in this segment of file. The epileptic brain activity can be easier to detect in time-frequency space than in the original signals.
Spike average
- In Process1, select all the imported spike epochs.
Run process Frequency > Time-Frequency (Morlet wavelets):
Sensors=EEG, Spectral flattening=None, Frequency=Log 2:40:80, Save average.
- In Process1, select the new time-frequency average.
Run process Standardize > Baseline normalization: Baseline=[-200,-100]ms, ESR/ERD.
Right-click on the average > All channels, then adjust the colormap.
Additional documentation
Related tutorials
Forum posts
EEG reference: Reference of the gain matrix
Registration: Match known EEG locations to the MRI image
Pre-processing: Bad channel replacement
Minimum number of electrodes for EEG source modeling
Song J, Davey C, Poulsen C, Luu P, Turovets S, Anderson E, Li K, Tucker D
EEG source localization: Sensor density and head surface coverage
Journal of Neuroscience Methods, Dec 2015Michel CM, Brunet D
EEG source imaging: A practical review of the analysis steps
Frontiers in Neurology, Apr 2019
Inverse models in epilepsy
Distributed source models vs. ECD (equivalent current dipole)
Kobayashi K, Yoshinaga H, Ohtsuka Y, Gotman J (2005)
Dipole modeling of epileptic spikes can be accurate or misleading
Epilepsia, 2005 Mar;46(3):397-408.Distributed source models vs. BOLD
Heers M, Hedrich T, An D, Dubeau F, Gotman J, Grova C, Kobayashi E (2014)
Spatial correlation of hemodynamic changes related to interictal epileptic discharges with electric and magnetic source imaging. Human Brain Mapping, published online 24 Feb 2014.ECD vs. BOLD
Benar CG, Grova C, Kobayashi E, Bagshaw AP, Aghakhani Y, Dubeau F, Gotman J (2006)
EEG–fMRI of epileptic spikes: Concordance with EEG source localization and intracranial EEG
NeuroImage, 30:1161-1170.
MEM in clinical epilepsy
Related methodological developments:
Amblard C, Lapalme E, Lina JM (2004)
Biomagnetic source detection by maximum entropy and graphical models, IEEE Trans Biomed Eng.Lapalme E, Lina JM, Mattout J (2006)
Data-driven parceling and entropic inference in MEG, NeuroImage.
Ability of MEM to recover the spatial extent of epileptic spikes:
Grova C, Daunizeau J, Lina JM, Benar CG, Benali H, Gotman J (2006)
Evaluation of EEG localization methods using realistic simulations of interictal spikes, NeuroImage.Chowdhury RA, Lina JM, Kobayashi E, Grova C (2013)
MEG Source Localization of spatially extended generators of epileptic activity: Comparing Entropic and Hierarchical Bayesian Approaches, PloS ONE.
Multimodal concordance on clinical cases:
Grova C, Daunizeau J, Kobayashi E, Bagshaw AP, Lina JM, Dubeau F, Gotman J (2008)
Concordance between distributed EEG source localization and simultaneous EEG-fMRI studies of epileptic spikes, NeuroImage.Heers M, Hedrich T, An D, Dubeau F, Gotman J, Grova C, Kobayashi E (2014)
Spatial correlation of hemodynamic changes related to interictal epileptic discharges with electric and magnetic source imaging, Hum Brain Mapp.
Background readings: Epilepsy and EEG/MEG
Ebersole JS, Husain AM, Nordli DR
Current Practice of Clinical ElectroencephalographyLaoprasert P
Atlas of Pediatric EEGAnderson CT, Carlson CE, Li Z, Raghavan M
Magnetoencephalography in the preoperative evaluation for epilepsy surgery
Curr Neurol Neurosci, Rep. 2014 May;14(5):446.Kharkar S, Knowlton R
Magnetoencephalography in the presurgical evaluation of epilepsy
Epilepsy Behav. 2015 May;46:19–26.
Scripting
The following script from the Brainstorm distribution reproduces the analysis presented in this tutorial page: brainstorm3/toolbox/script/tutorial_epilepsy.m