5139
Comment:
|
24025
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
[[https://neuroimage.usc.edu/brainstorm/Tutorials/Connectivity#Coherence|Coherence]] is a classic method to measure the linear relationship between two signals in the frequency domain. Previous studies ([[https://dx.doi.org/10.1113/jphysiol.1995.sp021104|Conway et al., 1995]], [[https://doi.org/10.1523/JNEUROSCI.20-23-08838.2000|Kilner et al., 2000]]) have used coherence to study the relationship between MEG signals from M1 and muscles, and they have shown synchronized activity in the 15–30 Hz range during maintained voluntary contractions. | [[Tutorials/Connectivity#Coherence|Coherence]] is a classic method to measure the linear relationship between two signals in the frequency domain. Previous studies ([[https://dx.doi.org/10.1113/jphysiol.1995.sp021104|Conway et al., 1995]], [[https://doi.org/10.1523/JNEUROSCI.20-23-08838.2000|Kilner et al., 2000]]) have used coherence to study the relationship between MEG signals from M1 and muscles, and they have shown synchronized activity in the 15–30 Hz range during maintained voluntary contractions. |
Line 16: | Line 16: |
The dataset is comprised of MEG and EMG recordings recorded from one subject in a experiment in which the subject to lift her hand and exert a constant force against a lever. The force was monitored by strain gauges on the lever. The subject performed two blocks of 20 trials in which either the left or the right wrist was extended for about 10 seconds. We will calculate the coherence between the MEG and the EMG when the subject extended her LEFT wrist, while keeping the right forearm muscle relaxed. The first step is to read the data. In this section we will apply automatic artifact rejection. Preprocessing requires the original MEG dataset, which is available from ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/SubjectCMC.zip. |
The dataset is comprised of MEG (151-channel CTF MEG system) and bipolar EMG (from left and right extensor carpi radialis longus muscles) recordings from one subject during an experiment in which the subject had to lift her hand and exert a constant force against a lever. The force was monitored by strain gauges on the lever. The subject performed two blocks of 25 trials in which either the left or the right wrist was extended for about 10 seconds. Only data for the left wrist will be analyzed in this tutorial. |
Line 25: | Line 19: |
* '''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''' * 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'''", * "'''No, use one channel file per acquisition run'''". === Download and installation === ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/SubjectCMC.zip The next sections will describe how to link import the subject's anatomy, reviewing raw data, managing event markers, pre-processing, epoching, source estimation and computation of coherence in the sensor and sources domain. Only data for the lifting with the left hand is analyzed. |
* '''Requirements''': You should have already followed all the introduction tutorials and you have a working copy of Brainstorm installed on your computer. * '''Download the dataset''': * Download the `SubjectCMC.zip` file from FieldTrip FTP server: ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/SubjectCMC.zip * Unzip it in a folder that is not in any of the Brainstorm folders (program folder or database folder). * '''Brainstorm''': * Start Brainstorm (Matlab scripts or stand-alone version). * Select the menu '''''File > Create new protocol'''''. Name it '''TutorialCMC''' and select the options: '''No, use individual anatomy''', <<BR>> '''No, use one channel file per acquisition run'''. The next sections will describe how to link import the subject's anatomy, reviewing raw data, managing event markers, pre-processing, epoching, source estimation and computation of coherence in the sensor and sources domain. |
Line 42: | Line 30: |
1. Create protocol 1. | * Right-click on the '''''TutorialCMC''''' node then '''''New subject > Subject01'''''.<<BR>>Keep the default options you defined for the protocol. * Switch to the '''Anatomy''' view of the protocol. * Right-click on the '''''Subject01''''' node then '''''Import MRI''''': * Set the file format: '''All MRI file (subject space)''' * Select the file: `SubjectCMC/SubjectCMC.mri` * Compute MNI normalization, in the '''MRI viewer''' click on '''Click here to compute MNI normalization''', use the '''maff8''' method. When the normalization is complete, verify the correct location of the fiducials and click on '''Save'''. IMAGE after_mni_norm * Once the MRI has been imported and normalized, we will segment the head and brain tissues to obtain the surfaces that are needed for a realistic [[Tutorials/TutBem|BEM forward model]]. * Right-click on the '''''SubjectCMC''''' MRI node, then '''''MRI segmentation > FieldTrip: Tissues, BEM surfaces'''''. * Select all the tissues ('''scalp''', '''skull''', '''csf''', '''gray''' and '''white'''). * Click '''OK'''. * For the option '''Generate surface meshes''' select '''No'''. * After the segmentation is complete, a '''''tissues''''' node will be shown in the tree. * Rick-click on the '''''tissues''''' node and select '''Generate triangular meshes''' * Select the 5 layers to mesh * Use the default parameters: '''number of vertices''': 10,000; '''erode factor''': 0; and '''fill holes factor''' 2. As output, we get a set of (head and brain) surface files that will be used for BEM computation. IMAGE result_tree By displaying the surfaces, we can note that the '''cortex''', which is related to the gray matter (shown in red) overlaps heavily with the '''innerskull''' surface (shown in gray), so it cannot be used it for [[Tutorials/TutBem|BEM computation using OpenMEEG]]. However, as we are dealing with MEG signals, we can still compute the BEM with the [[Tutorials/HeadModel#Forward_model|overleaping-spheres method]], and obtain similar results. We can also notice that the '''cortex''' and '''white''' surfaces obtained with the method above do not register accurately the cortical surface, they can be used for [[Tutorials/TutVolSource|volume-based source estimation]], which is based on a volume grid of source points; but they do not be used for surface-based source estimation. Better surface surfaces can be obtained by doing MRI segmentation with [[Tutorials/SegCAT12|CAT12]] or [[Tutorials/LabelFreeSurfer|FreeSurfer]]. IMAGE overlap cortex and innerskul |
Line 45: | Line 60: |
1. How to link the MEG recordings | * Switch to the '''Functional data''' view (X button). * Right-click on the '''''Subject01''''' node then '''''Review raw file''''': * Select the file format: '''MEG/EEG: CTF(*.ds; *.meg4; *.res4)''' * Select the file: `SubjectCMC.ds` * A a new folder and its content is now visible in the database explorer: * The '''''SubjectCMC''''' folder represents the MEG dataset linked to the database. Note the tag "raw" in the icon of the folder, this means that the files are considered as new continuous files. * The '''''CTF channels (191)''''' node is the '''channel file''' and defines the types and names of channels that were recorded, the position of the sensors, the head shape and other various details. This information has been read from the MEG datasets and saved as a new file in the database. The total number of data channels recorded in the file is indicated between parenthesis (191). * The '''''Link to raw file''''' node is a '''link to the original file''' that you imported. All the relevant meta-data was read from the MEG dataset and copied inside the link itself (sampling rate, number of samples, event markers and other details about the acquisition session). As it is a link, no MEG recordings were copied to the database. When we open this file, the values are read directly from the original files in the .ds folder. [[Tutorials/ChannelFile#Review_vs_Import|More information]]. IMAGE functional result_tree * Right-click on the '''''CTF channels (191)''''' node, then '''''Display sensors > CTF helmet''''' and '''''Display sensors > MEG ''''' to show a surface that represents the inner surface the helmet, and the MEG sensors respectively. Try [[Tutorials/ChannelFile#Display_the_sensors|additional display menus]]. IMAGE helmet and sensors == Reviewing continuous recordings == * Right-click on the '''''Link to raw file''''' node, then '''''Switch epoched/continuous''''' to convert the file to '''continuous'''. * Right-click on the '''''Link to raw file''''' node, then '''''MEG > Display time series''''' (or double-click on the node). This will open a new time series figure and enable the '''Time panel''' and the '''Record''' tab in the main Brainstorm window. Controls in these two panels are used to [[Tutorials/ReviewRaw|explore the time series]]. * In addition we can display the EMG signals, right-click on the '''''Link to raw file''''' node, then '''''EMG > Display time series'''''. IMAGE both MEG up, MEG down The colored dots on top of the recordings in the time series figures represent the [[Tutorials/EventMarkers|event markers]] (or triggers) saved in this dataset. In addition to these events, the start of the either left or right trials is saved in the auxiliary channel named '''Stim'''. To add these markers: * With the time series figure open, in the '''Record''' tab go to '''''File > Read events from channel'''''. Now, in the options for the '''Read from channel''' process, set '''Event channels''': to `Stim`, select '''Value''', anc click '''Run'''. * New events will appear, from these, we are only interested in the events from '''U1''' to '''U25''' that correspond to the 25 left trials. * Delete all the other events: select the events to delete with '''Ctrl+click''', when done go the menu '''''Events > Delete group''''' and confirm. Alternatively, you can do '''Ctrl+A''' to select all the events and deselect the U1 to U25 events. Read the information saved during the acquisition in a digital auxiliary channel (eg. a stimulus channel) and generate events. Due to the nature of this experiment, we need to * 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, select the display option "'''Flip Y Axis'''" to have the negative values pointing up (convention used by many neurologists). <<BR>><<BR>> {{attachment:review_flip.gif}} * 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}} * 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) * 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". {{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 it). * 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}} * 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<<BR>>(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: [[Tutorials/ReviewRaw|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%.<<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}} * 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. |
Line 68: | Line 234: |
* Liu J, Sheng Y, Liu H. <<BR>> https://doi.org/10.3389/fnhum.2019.00100Corticomuscular%20Coherence%20and%20Its%20Applications:%20A%20Review. Front Hum Neurosci. 2019 Mar 20;13:100. |
* Liu J, Sheng Y, Liu H. <<BR>> [[https://doi.org/10.3389/fnhum.2019.00100Corticomuscular%20Coherence%20and%20Its%20Applications:%20A%20Review|https://doi.org/10.3389/fnhum.2019.00100Corticomuscular%20Coherence%20and%20Its%20Applications:%20A%20Review]]. Front Hum Neurosci. 2019 Mar 20;13:100. {{{#!wiki comment * Schoffelen J-M, Poort J, Oostenveld R, Fries P. <<BR>> [[https://doi.org/10.1523/JNEUROSCI.4882-10.2011|Selective Movement Preparation Is Subserved by Selective Increases in Corticomuscular Gamma-Band Coherence]]. Journal of Neuroscience. 2011 May 4;31(18):6750–8. }}} |
MEG corticomuscular coherence
Authors: Raymundo Cassani
Corticomuscular coherence relates to the synchrony between electrophisiological signals (MEG, EEG or ECoG) recorded from the contralateral motor cortex, and EMG signal from a muscle during voluntary movement. This synchrony has its origin mainly in the descending communication in corticospinal pathways between primary motor cortex (M1) and muscles. This tutorial replicates the processing pipeline and analysis presented in the Analysis of corticomuscular coherence FieldTrip tutorial.
Contents
Background
Coherence is a classic method to measure the linear relationship between two signals in the frequency domain. Previous studies (Conway et al., 1995, Kilner et al., 2000) have used coherence to study the relationship between MEG signals from M1 and muscles, and they have shown synchronized activity in the 15–30 Hz range during maintained voluntary contractions.
IMAGE OF EXPERIMENT, SIGNALS and COHERENCE
Dataset description
The dataset is comprised of MEG (151-channel CTF MEG system) and bipolar EMG (from left and right extensor carpi radialis longus muscles) recordings from one subject during an experiment in which the subject had to lift her hand and exert a constant force against a lever. The force was monitored by strain gauges on the lever. The subject performed two blocks of 25 trials in which either the left or the right wrist was extended for about 10 seconds. Only data for the left wrist will be analyzed in this tutorial.
Download and installation
Requirements: You should have already followed all the introduction tutorials and you have a working copy of Brainstorm installed on your computer.
Download the dataset:
Download the SubjectCMC.zip file from FieldTrip FTP server: ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/SubjectCMC.zip
- Unzip it in a folder that is not in any of the Brainstorm folders (program folder or database folder).
Brainstorm:
- Start Brainstorm (Matlab scripts or stand-alone version).
Select the menu File > Create new protocol. Name it TutorialCMC and select the options: No, use individual anatomy,
No, use one channel file per acquisition run.
The next sections will describe how to link import the subject's anatomy, reviewing raw data, managing event markers, pre-processing, epoching, source estimation and computation of coherence in the sensor and sources domain.
Importing anatomy data
Right-click on the TutorialCMC node then New subject > Subject01.
Keep the default options you defined for the protocol.Switch to the Anatomy view of the protocol.
Right-click on the Subject01 node then Import MRI:
Set the file format: All MRI file (subject space)
Select the file: SubjectCMC/SubjectCMC.mri
Compute MNI normalization, in the MRI viewer click on Click here to compute MNI normalization, use the maff8 method. When the normalization is complete, verify the correct location of the fiducials and click on Save.
IMAGE after_mni_norm
Once the MRI has been imported and normalized, we will segment the head and brain tissues to obtain the surfaces that are needed for a realistic BEM forward model.
Right-click on the SubjectCMC MRI node, then MRI segmentation > FieldTrip: Tissues, BEM surfaces.
Select all the tissues (scalp, skull, csf, gray and white).
Click OK.
For the option Generate surface meshes select No.
After the segmentation is complete, a tissues node will be shown in the tree.
Rick-click on the tissues node and select Generate triangular meshes
- Select the 5 layers to mesh
Use the default parameters: number of vertices: 10,000; erode factor: 0; and fill holes factor 2.
As output, we get a set of (head and brain) surface files that will be used for BEM computation.
IMAGE result_tree
By displaying the surfaces, we can note that the cortex, which is related to the gray matter (shown in red) overlaps heavily with the innerskull surface (shown in gray), so it cannot be used it for BEM computation using OpenMEEG. However, as we are dealing with MEG signals, we can still compute the BEM with the overleaping-spheres method, and obtain similar results. We can also notice that the cortex and white surfaces obtained with the method above do not register accurately the cortical surface, they can be used for volume-based source estimation, which is based on a volume grid of source points; but they do not be used for surface-based source estimation. Better surface surfaces can be obtained by doing MRI segmentation with CAT12 or FreeSurfer.
IMAGE overlap cortex and innerskul
Access the recordings
Switch to the Functional data view (X button).
Right-click on the Subject01 node then Review raw file:
Select the file format: MEG/EEG: CTF(*.ds; *.meg4; *.res4)
Select the file: SubjectCMC.ds
- A a new folder and its content is now visible in the database explorer:
The SubjectCMC folder represents the MEG dataset linked to the database. Note the tag "raw" in the icon of the folder, this means that the files are considered as new continuous files.
The CTF channels (191) node is the channel file and defines the types and names of channels that were recorded, the position of the sensors, the head shape and other various details. This information has been read from the MEG datasets and saved as a new file in the database. The total number of data channels recorded in the file is indicated between parenthesis (191).
The Link to raw file node is a link to the original file that you imported. All the relevant meta-data was read from the MEG dataset and copied inside the link itself (sampling rate, number of samples, event markers and other details about the acquisition session). As it is a link, no MEG recordings were copied to the database. When we open this file, the values are read directly from the original files in the .ds folder. More information.
IMAGE functional result_tree
Right-click on the CTF channels (191) node, then Display sensors > CTF helmet and Display sensors > MEG to show a surface that represents the inner surface the helmet, and the MEG sensors respectively. Try additional display menus.
IMAGE helmet and sensors
Reviewing continuous recordings
Right-click on the Link to raw file node, then Switch epoched/continuous to convert the file to continuous.
Right-click on the Link to raw file node, then MEG > Display time series (or double-click on the node). This will open a new time series figure and enable the Time panel and the Record tab in the main Brainstorm window. Controls in these two panels are used to explore the time series.
In addition we can display the EMG signals, right-click on the Link to raw file node, then EMG > Display time series.
IMAGE both MEG up, MEG down
The colored dots on top of the recordings in the time series figures represent the event markers (or triggers) saved in this dataset. In addition to these events, the start of the either left or right trials is saved in the auxiliary channel named Stim. To add these markers:
With the time series figure open, in the Record tab go to File > Read events from channel. Now, in the options for the Read from channel process, set Event channels: to Stim, select Value, anc click Run.
New events will appear, from these, we are only interested in the events from U1 to U25 that correspond to the 25 left trials.
Delete all the other events: select the events to delete with Ctrl+click, when done go the menu Events > Delete group and confirm. Alternatively, you can do Ctrl+A to select all the events and deselect the U1 to U25 events.
Read the information saved during the acquisition in a digital auxiliary channel (eg. a stimulus channel) and generate events.
Due to the nature of this experiment, we need to
In the figure, select the display option "Flip Y Axis" to have the negative values pointing up (convention used by many 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
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:
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 it).
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%.
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.
Handle events
Fusion all the left events
Pre-process recordings
Removing artifacts
Importing the recordings
Epoching
Source analysis
Coherence
Sensor level
Source level
Script
This should be label as advanced.
Additional documentation
Articles
Conway BA, Halliday DM, Farmer SF, Shahani U, Maas P, Weir AI, et al.
Synchronization between motor cortex and spinal motoneuronal pool during the performance of a maintained motor task in man.
The Journal of Physiology. 1995 Dec 15;489(3):917–24.Kilner JM, Baker SN, Salenius S, Hari R, Lemon RN.
Human Cortical Muscle Coherence Is Directly Related to Specific Motor Parameters.
J Neurosci. 2000 Dec 1;20(23):8838–45.Liu J, Sheng Y, Liu H.
https://doi.org/10.3389/fnhum.2019.00100Corticomuscular%20Coherence%20and%20Its%20Applications:%20A%20Review. Front Hum Neurosci. 2019 Mar 20;13:100.
Tutorials
Tutorial: Volume source estimation
Forum discussions
Forum: Minimum norm units (pA.m): http://neuroimage.usc.edu/forums/showthread.php?1246