24025
Comment:
|
54604
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
<<HTML(<style>.backtick {font-size: 16px;}</style>)>><<HTML(<style>abbr {font-weight: bold;}</style>)>> <<HTML(<style>em strong {font-weight: normal; font-style: normal; padding: 2px; border-radius: 5px; background-color: #EEE; color: #111;}</style>)>> = MEG corticomuscular coherence = ''Authors: Raymundo Cassani '' [[https://en.wikipedia.org/wiki/Corticomuscular_coherence|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 [[https://www.fieldtriptoolbox.org/tutorial/coherence/|Analysis of corticomuscular coherence]] FieldTrip tutorial. <<TableOfContents(3,2)>> |
<<HTML(<style>tt {font-size: 16px;}</style>)>><<HTML(<style>abbr {font-weight: bold;}</style>)>> <<HTML(<style>em strong {font-weight: normal; font-style: normal; padding: 2px; border-radius: 5px; background-color: #EEE; color: #111;}</style>)>> = Corticomuscular coherence (CTF MEG) = '''[TUTORIAL UNDER DEVELOPMENT: NOT READY FOR PUBLIC USE] ''' ''Authors: Raymundo Cassani, Francois Tadel & Sylvain Baillet.'' [[https://en.wikipedia.org/wiki/Corticomuscular_coherence|Corticomuscular coherence]] measures the degree of similarity between electrophysiological signals (MEG, EEG, ECoG sensor traces or source time series, especially over the contralateral motor cortex) and the EMG signal recorded from muscle activity during voluntary movement. This signal similarity is due mainly to the descending communication along corticospinal pathways between primary motor cortex (M1) and muscles. For consistency and reproducibility purposes across major software toolkits, the present tutorial replicates the processing pipeline "[[https://www.fieldtriptoolbox.org/tutorial/coherence/|Analysis of corticomuscular coherence]]" by FieldTrip. <<TableOfContents(2,2)>> |
Line 11: | Line 13: |
[[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]] measures 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 reported corticomuscular coherence effects in the 15–30 Hz range during maintained voluntary contractions. |
Line 16: | Line 18: |
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. | The dataset comprises MEG recordings (151-channel CTF MEG system) and bipolar EMG recordings (from left and right extensor carpi radialis longus muscles) from one participant who was tasked to lift their hand and exert a constant force against a lever for about 10 seconds. The force was monitored by strain gauges on the lever. The participant performed two blocks of 25 trials using either the left or right wrist. EOG signals were also recorded, which will be useful for detection and attenuation of ocular artifacts. We will analyze the data from the left-wrist trials in the present tutorial. Replicating the pipeline with right-wrist data is a good exercise to do next! |
Line 19: | Line 21: |
* '''Requirements''': You should have already followed all the introduction tutorials and you have a working copy of Brainstorm installed on your computer. | * '''Requirements''': * Please make sure you have completed the [[Tutorials|get-started tutorials]] and that you have a working copy of Brainstorm installed on your computer. * In addition, you need to [[Tutorials/SegCAT12#Install_CAT12|install the plugin CAT12]], used for MRI segmentation. |
Line 21: | Line 25: |
* 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). |
* Download `SubjectCMC.zip` from FieldTrip FTP server:<<BR>> ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/SubjectCMC.zip * Unzip it in a folder not located in any of Brainstorm folders (the app or its database). |
Line 24: | Line 28: |
* 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. |
* Launch Brainstorm (via Matlab command line or the Matlab-free stand-alone version). * Select the menu '''File > Create new protocol'''. Name it `TutorialCMC` and select the options:<<BR>> No, use individual anatomy, <<BR>> No, use one channel file per acquisition run. |
Line 30: | Line 32: |
* 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)''' |
* Right-click on the newly created TutorialCMC node > '''New subject > Subject01'''.<<BR>>Keep the default options defined for the study (aka "protocol" in Brainstorm jargon). * Switch to the Anatomy view of the protocol (<<Icon(iconSubjectDB.gif)>>). * Right-click on the Subject01 > '''Import MRI''': * Select the file format: '''All MRI files (subject space)''' |
Line 37: | Line 39: |
* 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 == Access the recordings == * Switch to the '''Functional data''' view (X button). * Right-click on the '''''Subject01''''' node then '''''Review raw file''''': |
* This will open the MRI viewer showing the coronal, sagittal and axial views of the MRI. In addition, [[CoordinateSystems|three anatomical fiducials]]: left and right pre-auricular points (LPA and RPA), and nasion (NAS) are automatically identified. These fiducials are located near the left/right ears and just above the nose respectively. Click on '''Save'''. <<BR>><<BR>> {{attachment:mri_viewer.gif||width="344",height="295"}} * In a typical Brainstorm workflow, as illustrated in all the other tutorials, we would recommend running the full segmentation of the MRI at this stage, in order to have the anatomy of the subject fully prepared before importing the functional data. In the case of this tutorial, we will proceed differently, in order to follow better the original FieldTrip pipeline and to obtain sensor-level coherence results much faster. We will run the segmentation of the anatomy just before moving to the source-level analysis. * For validating the registration between the MRI and the MEG, we will now limit the anatomy processing to the reconstruction of the head surface from the MRI. * Right-click on the MRI (<<Icon(iconMri.gif)>>) > MRI segmentation > '''Generate head surface'''. <<BR>><<BR>> {{attachment:head_process.gif}} * At the end, you would get one new head surface. Double-click on it to display it.<<BR>><<BR>> {{attachment:head_display.gif}} == MEG and EMG recordings == === Link the recordings to Brainstorm database === * Switch now to the '''Functional data '''view (<<Icon(iconStudyDBSubj.gif)>>). * Right-click on the Subject01 > '''Review raw file''': |
Line 64: | Line 52: |
* 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. == 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. |
* A new folder '''SubjectCMC '''is created in the Brainstorm database explorer. Note the "RAW" tag over the icon of the folder (<<Icon(iconRawFolderClose.gif)>>), indicating the files contain unprocessed, continuous data. It contains: * '''CTF channels (191)''': Channel file with all channel types, names, locations, etc. The number of channels available (MEG, EMG, EOG etc.) is indicated between parentheses. * '''Link to raw file''': Provides access to the original data file. All the relevant metadata was read from the dataset and copied inside the node itself (e.g., sampling rate, number of time samples, event markers). Note that Brainstorm logic is not to import/duplicate the raw unprocessed data directly into the database. Instead, Brainstorm provides a link to that raw file for further review and data extraction ([[Tutorials/ChannelFile#Review_vs_Import|more information]]). . {{attachment:review_raw.png}} <<BR>> === MEG-MRI coregistration === * This step, sometimes simply named ''registration'', refers to the alignment of the sensors on the anatomy of the subject ([[https://neuroimage.usc.edu/brainstorm/Tutorials/ChannelFile#Automatic_registration|more info]]). For this tutorial, data registration is carried out using only three anatomical landmarks present in the MRI and MEG data. According to the description of the data in the [[https://www.fieldtriptoolbox.org/tutorial/coherence/|FieldTrip tutorial]]:<<BR>>''"To measure the head position with respect to the sensors, three coils were placed at anatomical landmarks of the head (nasion, left and right ear canal). [...] During the MRI scan, ear molds containing small containers filled with vitamin E marked the same landmarks. This allows us, together with the anatomical landmarks, to align source estimates of the MEG with the MRI." '' * To verify the registration, right-click on the '''CTF channels''' node > '''MRI registration > Check'''. This opens a 3D figure showing the inner surface of the MEG helmet, the head surface, and the fiducials and axes that comprise the [[CoordinateSystems#Subject_Coordinate_System_.28SCS_.2F_CTF.29|subject coordinate system (SCS)]].<<BR>><<BR>> {{attachment:fig_registration.gif||width="209",height="204"}} === Reviewing continuous recordings === * Right-click on Link to raw file > '''Switch epoched/continuous''' to convert the file to continuous, a technical detail proper to CTF file formatting. * Right-click on Link to raw file > '''MEG > Display time series''' (or double-click). This will open a new visualization window to explore data time series, also enabling the Time panel and the Record tab in the main Brainstorm window (see how to best use all controls in this panel and tab to [[Tutorials/ReviewRaw|explore data time series]]). * Right-click on Link to raw file > '''EMG > Display time series'''. . [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=timeseries_meg_emg.png|{{attachment:timeseries_meg_emg.png|https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=timeseries_meg_emg.png}}]] === Event markers === The colored dots above the data time series indicate [[Tutorials/EventMarkers|event markers]] (or triggers) saved with this dataset. The trial onset information of the left-wrist and right-wrist trials is saved in an auxiliary channel of the raw data named ''Stim''. To add these markers, these events need to be decoded as follows: * While the time series figure is open, go to the Record tab and '''File > Read events from channel'''. Event channels = `Stim`, select Value, and click '''Run'''. . {{attachment:read_evnt_ch.png}} * This creates new event markers now shown in the Events section of the tab, along with previous event categories. In this tutorial, we will only use events '''U1''' through '''U25''', which correspond to the beginning of each of the 25 trials of 10 seconds with left-wrist movements. To make sure we reproduce FieldTrip tutorial, we need to reject trial #7, event '''U7'''. * Delete unused events: Select all the events '''except''' '''U1-U6''' and '''U8-25''' (Ctrl+click / Shift+click), then menu '''Events > Delete group''' (or press the Delete key). * Merge events: Select all the event groups, then menu '''Events > ''' Merge group > '''"Left"'''. This new event category references 24 trials of the left-wrist condition, i.e. 10-second blocks of left-wrist movements.<<BR>><<BR>> {{attachment:left_24.gif}} == Pre-process == {{{#!wiki note In this tutorial, we will analyze only the '''Left''' trials (left-wrist extensions). In the following sections, we will process only the first '''330 s''' of the recordings, where the left-wrist trials were performed. }}} === Removal of power line artifacts === * In the Process1 box: Drag and drop the '''Link to raw file'''. * Run process '''Frequency > Power spectrum density (Welch)''':<<BR>> * '''Time window''': `0-330 s` * '''Window length''':''' '''`10 s` * '''Overlap''': `50%` * '''Sensor types''': `MEG, EMG` . {{attachment:pro_psd.png||width="60%"}} * Double-click on the new PSD file to visualize the power spectrum density of the data.<<BR>> . {{attachment:psd_before_notch.png||width="70%"}} * The PSD plot shows two groups of sensors: EMG (highlighted in red above) and the MEG spectra below. Peaks at 50Hz and its harmonics (100, 150, 200Hz and above) correspond to the European power line and are clearly visible. We will use notch filters to attenuate power line contaminants at 50, 100 and 150 Hz. * In the Process1 box: Drag and drop the '''Raw | clean''' node. * Run the process '''Pre-processing > Notch filter''' with: <<BR>> * Check '''Process the entire file at once''' * '''Sensor types''': `MEG, EMG` * '''Frequencies to remove (Hz)''': `50, 100, 150` . {{attachment:pro_notch.png||width="60%"}} * Troubleshooting in case of memory error:<<BR>>These MEG recordings have been saved before applying the CTF 3rd-order gradient compensation. The compensation weights are applied on the fly when Brainstorm reads data from the file, however this requires reading all the channels at once. By default, the frequency filter are optimized to process the channels sequentially, which is incompatible with applying the CTF compensation on the fly. This setting can be overridden with the option '''Process the entire file at once''', but this solution has the effect of loading the entire file in memory at once, which can crash on computers with limited memory (RAM < 8Gb). If this happens to you: run the process '''Artifacts > Apply SSP & CTF compensation''' on the file first, then the notch filter without the option "Process the entire file at once" ([[https://neuroimage.usc.edu/brainstorm/Tutorials/TutMindNeuromag#Existing_SSP_and_pre-processing|more information]]). * A new folder named '''SubjectCMC_clean_notch''' is created. Estimate the PSD of these signals to appreciate the effect of the notch filters applied. As above, please remember to indicate a '''Time window''' restricted from 0 to 330 s in the options of the PSD process.<<BR>><<BR>> . {{attachment:psd_after_notch.png||width="70%"}} === EMG pre-processing === Two typical pre-processing steps for EMG consist in high-pass filtering and rectifying. * In the Process1 box: drag and drop the '''Raw | notch(50Hz 100Hz 150Hz)''' node. * Add the process '''Pre-process > Band-pass filter''' * '''Sensor types''' = `EMG` * '''Lower cutoff frequency''' = `10 Hz` * '''Upper cutoff frequency''' = `0 Hz` * Add the process '''Pre-process > Absolute values''' * '''Sensor types''' = `EMG` * Run the pipeline . {{attachment:emg_processing.png||width="100%"}} * Delete intermediate files that won't be needed anymore: Select folders '''SubjectCMC_notch''' and '''SubjectCMC_notch_high''',''' '''then press the Delete key (or right-click > File > Delete).<<BR>><<BR>>{{attachment:db_filters.gif}} === MEG pre-processing === ==== Detection and removal of artifacts with SSP ==== Stereotypical artifacts such eye blinks and heartbeats can be identified from their respective characteristic spatial distributions. Their contamination of MEG signals can then be attenuated specifically using Signal-Space Projections (SSPs). For more details, consult the dedicated tutorials about the [[Tutorials/ArtifactsDetect|detection]] and [[Tutorials/ArtifactsSsp|removal of artifacts with SSP]]. The present tutorial dataset features an EOG channel but no ECG. We will perform only the removal of eye blinks. * Right-click on the pre-processed file, ie '''Raw | notch(50Hz 100Hz 150Hz) | high(10Hz) | abs''', then select '''MEG > Display time series''' and '''EOG > Display time series'''. * In the '''Events''' section of the '''Record''' tab, select '''Artifacts > Detect eye blinks''', and use the parameters: * '''Channel name'''= `EOG` * '''Time window''' = `0 - 330 s` * '''Event name''' = `blink` . {{attachment:detect_blink_process.png||width="60%"}} * Three categories of blink events are created. Review the traces of EOG channels around a few of these events to ascertain they are related to eye blinks. In the present case, we note that the '''blink''' group contains genuine eye blinks, and that groups blink2 and blink3 capture saccade events. . {{attachment:blinks.png||width="70%"}} * To [[Tutorials/ArtifactsSsp|remove blink artifacts with SSP]] go to '''Artifacts > SSP: Eye blinks''', and use the parameters: * '''Event name'''=`blink` * '''Sensors'''=`MEG` * Check '''Compute using existing SSP/ICA projectors''' . {{attachment:ssp_blink_process.png||width="60%"}} * Display the time series and topographies of the first two (dominant) SSP components identified. In the present case, only the first SSP component can be clearly related to blinks. Select only component #1 for removal. . {{attachment:ssp_blink.png||width="100%"}} * Follow the same procedure for the other blink events ('''blink2''' and '''blink3'''). As mentioned above, none of the first two SSP components seem to be related to ocular artifacts. The figure below shows the visualization of the first two components for the '''blink2''' group. . {{attachment:ssp_blink2.png||width="100%"}} . We therefore recommend unselecting the '''blink2''' and '''blink3''' groups from the '''Select Active Projectors''' panel (see below) rather than removing spatial components which nature remains ambiguous. . {{attachment:ssp_active_projections.png||width="60%"}} * Click on the large '''×''' at the top right of the main Brainstorm window to close all visualization windows. ==== Detection of "bad" data segments: ==== Here we will use the [[Tutorials/BadSegments#Automatic_detection|automatic detection of artifacts]] to identify data segments contaminated by e.g., large eye and head movements and muscle contractions. * Display the MEG and EOG time series. In the '''Record''' tab, select '''Artifacts > Detect other artifacts''' and enter the following parameters: * '''Time window''' = `0 - 330 s` * '''Sensor types'''=`MEG` * '''Sensitivity'''=`3` * Check both frequency bands '''1-7 Hz''' and '''40-240 Hz''' . {{attachment:detect_other.png||width="60%"}} We encourage users to review and validate the segments marked using this procedure. In the present case, the segments detected as bad clearly point at contaminated MEG data segments. We will now label these as "bad". * Select the '''1-7Hz''' and '''40-240Hz''' event groups and select '''Events > Mark group as bad''' from the contextual menu. Alternatively, you can also rename the events created above and append the '''bad_''' prefix to their name: Brainstorm will automatically discard these data segments from further processing. . {{attachment:bad_other.png||width="50%"}} * Close all visualization windows and reply "Yes" to the save the modifications query. == Importing data epochs == At this point we are finished with the pre-processing of the EMG and MEG recordings. We will now extract and import specific data segments of interest into the Brainstorm database for further derivations. We refer to these segments as '''epochs''' or '''trials'''. As mentioned previously, we will focus on the '''Left''' (wrist) category of events. To follow the same pipeline as the [[https://www.fieldtriptoolbox.org/tutorial/coherence/|FieldTrip tutorial]], only the first 8 1-s epochs for each trial are imported. In addition DC offset is removed only for MEG signals. * Drag-and-drop the pre-processed file, ie '''Raw | notch(50Hz 100Hz 150Hz) | high(10Hz) | abs''', to the '''Process1''' box. * Add the process '''Import > Import recordings > Import MEG/EEG: Events''' and set its parameters: * '''Subject name''' = `Subject01` should be set * '''Folder name''' = empty * '''Event names''' = `Left` * '''Time window''' = `0 - 330 s` * '''Epoch time''' = `0 - 8000 ms` * '''Split recordings in time blocks''' = `1 s` * Uncheck '''Create a separate folder for each event type''' * Check '''Ignore shorter epochs''' * Check '''Use CTF compensation''' * Check '''Use SSP/ICA projectors''' * Add the process '''Pre-process > Remove DC offset''' and set its parameters: * '''Baseline''' = `All file` * '''Sensor types''' = `MEG` * Run the pipeline || {{attachment:pro_import.png}} || || {{attachment:pro_remove_dc.png}} || {{{#!wiki comment OLD VERSION OF IMPORTING * Right-click on the pre-processed continuous file '''Raw | notch(...''' (in the '''SubjectCMC_notch_high_abs''' condition), then '''Import in database'''. . {{attachment:import_menu.png||width="40%"}} * Enter the following parameter values: * '''Time window''' = `0 - 330 s` * Check '''Split in time blocks of:''' and set `1.0 s` * Check '''Use events''' and highlight the '''Left(x192)''' event group * '''Epoch time''' = `0 - 8000 ms` * Check '''Apply SSP/ICA projectors''' * Uncheck '''Remove DC offset''' and select '''All recordings''' * Uncheck '''Resample recordings''' * Uncheck '''Create a separate folder for each event type''' . {{attachment:import_options.png||width="80%"}} }}} A new folder '''SubjectCMC_notch_high_abs''' without the 'raw' indication is created for '''Subject01'''. The new folder contains a copy of the '''channel file''' from the original raw file, and 192 (24 trials, 8 epochs each) individual trials tagged as '''Left''' in a new trial group (<<Icon(iconEegList.gif)>>). Expand the trial group and note there are trials marked with an exclamation mark in a red circle (<<Icon(iconModifBad.gif)>>). This indicates trials that contain segments of signal occurred in the '''bad''' segments we [[#Detection_of_.22bad.22_data_segments:|previously identified]]. All the bad trials will be automatically ignored for further processing, whenever dropped into the '''Process1''' and '''Process2''' tabs. . {{attachment:trials.png||width="40%"}} To have a glance of the signals after the pre-processing, plot the MEG signal for one sensor over the left motor-cortex (MRC21) and the EMG signals, for trial 1 (left image). Note that these traces are similar to the ones obtained in the [[https://www.fieldtriptoolbox.org/tutorial/coherence/|FieldTrip tutorial]] (right image). <<BR>> {{attachment:bst_ft_trial1.png||width="100%"}} == Coherence 1xN (sensor level) == We will now compute the '''magnitude square coherence (MSC)''' between the '''left EMG''' signal and each of the MEG sensor data. * In the '''Process1''' box, drag and drop the '''Left (192 files)''' trial group. . {{attachment:dragdrop_trialgroup.png||width="40%"}} Open the '''Pipeline editor''': * Add the process '''Connectivity > Coherence 1xN [2021]''' with the following parameters: * '''Time window''' = `0 - 1000 ms` or check '''All file''' * '''Source channel''' = `EMGlft` * Do not check '''Include bad channels''' nor '''Remove evoke response''' * '''Magnitude squared coherence''' * '''Window length for PSD estimation''' = `0.5 s` * '''Overlap for PSD estimation''' = `50%` * '''Highest frequency of interest''' = `80 Hz` * '''Average cross-spectra of input files (one output file)''' * More details on the '''Coherence''' process can be found in the [[Tutorials/Connectivity#Coherence|connectivity tutorial]]. * Add the process '''File > Add tag''' with the following parameters: * '''Tag to add''' = `MEG sensors` * Select '''Add to file name''' * Run the pipeline || {{attachment:coh_meg_emgleft.png}} || || {{attachment:coh_meg_emgleft2.png}} || * Double-click on the resulting node '''mscohere(0.6Hz,555win): EMGlft | MEG sensors''' to display the MSC spectra. Click on the maximum peak in the 15 to 20 Hz range, and press `Enter` to plot it in a new figure. This spectrum corresponds to channel '''MRC21''', and shows a large peak at 17.58 Hz. You can also use the frequency slider (under the '''Time''' panel) to explore the MSC output more precisely across frequencies. * Right-click on the spectrum and select '''2D Sensor cap''' for a topographical representation of the magnitude of the coherence results across the sensor array. You may also use the shortcut `Ctrl-T`. The sensor locations can be displayed with a right-click and by selecting '''Channels > Display sensors''' from the contextual menu (shortcut `Ctrl-E)`. . {{attachment:res_coh_meg_emgleft.png||width="80%"}} We can now average magnitude of the MSC across a frequency band of interest (15-20 Hz): * In the '''Process1''' box, drag-and-drop the '''mscohere(0.6Hz,555win): EMGlft | MEG sensors''' node, and add the process '''Frequency > Group in time or frequency bands''' with the parameters: * Select '''Group by frequency''' * Type `cmc_band / 15, 20 / mean` in the text box. . {{attachment:pro_group_freq.png||width="60%"}} The resulting file '''mscohere(0.6Hz,555win): EMGlft | MEG sensors | tfbands''' has only one MSC value for each sensor (the MSC average in the 15-20 Hz band). You may visualize the topography of this MSC statistics via 3 possible representations: '''2D Sensor cap''', '''2D Sensor cap''' and '''2D Disk''', which are all accessible via a right-click over the MSC node. We clicked on sensor '''MRC21''' below; it is shown in red. . {{attachment:res_coh_meg_emgleft1520.png||width="100%"}} We can observe higher MSC values between the EMG signal and MEG sensor signals over the contralateral set of central sensors in the beta band. Unfortunately, [[Tutorials/Connectivity#Sensor-level|sensor-level connectivity presents the disadvantages]] of not being interpretable, and being subject to spurious results due to volume conduction. In the next section we will compute coherence in the source level. To do this, we first need to estimate the sources time series from the sensor data. == MRI segmentation == We then need to segment the head tissues to obtain the surfaces required to derive a realistic MEG [[Tutorials/HeadModel|head models (aka "forward models")]]. Here, we will perform [[Tutorials/SegCAT12|MRI segmentation with CAT12]], this process takes between 30 to 60 minutes. * Right-click on the '''SubjectCMC''' MRI node (<<Icon(iconMri.gif)>>), then select '''MRI segmentation > CAT12: Cortex, atlases, tissues'''. This will prompt a series of windows to set the parameters for the MRI segmentation, use the following parameters: * '''Number of vertices on the cortex surface''' use `15000` * '''Compute anatomical parcellations?''' select `Yes` * '''Compute cortical maps''' select {{{No}}} . {{attachment:cat12.png||width="100%"}} CAT12 computes the '''scalp''' surface (<<Icon(iconScalp.gif)>>), and the '''cortex''' surfaces (<<Icon(iconCortexCut.gif)>>) for white matter, pial envelope and the midpoint between them. The default surface of each type is indicated in green. Moreover, as part of the MRI segmentation with CAT12, the anatomy data is normalized in the MNI space, and several anatomical parcellations (<<Icon(iconMriAtlas.gif)>>) are computed. For further information on the anatomy files see the [[Tutorials/ExploreAnatomy|Display the anatomy tutorial]]. . {{attachment:import_result.png||width="40%"}} * Double-click on the '''head mask''' and then on the '''central_15002''' surface to display them. * In addition, the registration between the MRI and the surfaces can be checked with context menu '''MRI registration > Check MRI/surface registration...''' . {{attachment:fig_anat_srf.png||width="60%"}} == MEG source modelling == We will perform source modelling using a [[Tutorials/HeadModel#Dipole_fitting_vs_distributed_models|distributed model]] approach for two possible source spaces: the '''cortex surface''' and the entire '''MRI volume'''. In the '''surface space''', a source grid is made with the source located on the cortical surface obtained from the participant's MRI. For the '''volume space''', the source grid consists of elementary sources uniformly distributed across the entire brain volume. Before estimating the brain sources, we need to derive the sensor '''noise covariance matrix''', and the '''head model'''. === Noise covariance === The [[Tutorials/NoiseCovariance#The_case_of_MEG|recommendation for MEG]], is to extract basic noise statistics from empty-room recordings. However, when recommended empty-room recordings are not available, as with this tutorial data, resting-state data can be used as proxies for MEG noise covariance. See the [[Tutorials/NoiseCovariance|noise covariance tutorial]] for more details. * In the raw '''SubjectCMC_clean_notch_high_abs '''node, right-click over '''Raw | clean | notch(...'''and select '''Noise covariance > Compute from recordings'''. Please enter the following parameters: * '''Baseline:''' from `18 to 29 s` * Select the '''Block by block''' option. . {{attachment:pro_noise_cov.png||width="60%"}} * Copy the '''Noise covariance''' (<<Icon(iconNoiseCov.gif)>>) node to the '''SubjectCMC_preprocessed''' folder. This can be done using the shortcuts `Ctrl-C` and `Ctrl-V`. . {{attachment:tre_covmat.png||width="50%"}} === Head model === The [[Tutorials/HeadModel|head model]], aka forward model, accounts for how neural electrical currents (in a source space) produce magnetic fields captured by sensors outside the head, considering head tissues electromagnetic properties and geometry, independently of actual empirical measurements. As the head model depends on the source space, a distinct head model is required for the surface and volume source spaces. Please refer to the [[Tutorials/HeadModel|head model tutorial]] for more in-depth explanations. ==== Surface ==== * Go to the '''Anatomy''' view of the database and verify that the '''pial_15002V''' surface is the default (green characters) cortex surface. Otherwise, right-click on it and select '''Set as default cortex''' in the contextual menu. * Go back '''Functional data''' view of the database, and inside the '''SubjectCMC_preprocessed''' folder, right-click over '''CTF channels (191)''' and select '''Compute head model '''from the contextual menu. Run the process with the options as indicated below: * '''Comment''' = `Overlapping spheres (surface)` * '''Source space''' = `Cortex surface` * '''Forward model''' = `MEG Overlapping spheres`. The cortical head model will be derived from each of the 15,000 sources (surface vertices) as defined in the default cortex. . {{attachment:pro_head_model_srf.png||width="40%"}} The '''Overlapping spheres (surface)''' head model (<<Icon(iconHeadModel.gif)>>) now appears in the database explorer. ==== Volume ==== * In the '''SubjectCMC_preprocessed''' folder, right-click over the '''CTF channels (191)''' node and select '''Compute head model'''. Set the option values to: * '''Comment''' = `Overlapping spheres (volume)` * '''Source space''' = `MRI volume` * '''Forward model''' = `Overlapping spheres`. . {{attachment:pro_head_model_vol.png||width="40%"}} * In the '''Volume source grid''' window, specify the following parameters that will produce around '''11,500''' source grid points across the brain volume. * Select '''Regular grid''' and '''Brain''' * '''Grid resolution''' = `5 mm` . {{attachment:pro_grid_vol.png||width="60%"}} The '''Overlapping spheres (volume)''' head model is now added to the database explorer. The green color indicates this is the default head model for the current folder (this can be changed by simply double clicking over the head model nodes.) . {{attachment:tre_head_models.png||width="50%"}} == Source estimation == Now that the '''noise covariance''' and '''head model(s)''' are available, we will perform [[Tutorials/SourceEstimation|source estimation]], to find the sources that gave origin to the signals registered in the sensors. From the diverse [[Tutorials/SourceEstimation#Method|source estimation methods available in Brainstorm]], in this tutorial the '''minimum-norm imaging''' method is used. The minimum-norm method estimates the linear combination of the current at each point in the source grid that explains the recorded sensor signals favouring minimum energy (L2-norm) solutions. As result, a large matrix called the '''imaging kernel''' is obtained. By multiplying the imaging kernel with the sensor data, it is possible to obtain the estimates of brain sources time series. A different imaging kernel is derived for each of the head models we have produced above: '''surface''' and '''volume'''. See the [[Tutorials/SourceEstimation|source estimation tutorial]] for more details. {{{#!wiki note '''Each dipole in the source grid may point arbitrarily in any direction in a 3D space.''' <<BR>><<BR>> '''Only for surface grids''', the dipole orientation can be fixed to be normal to the cortical surface, this approach is based on anatomical observations of the brain cortex. The result is then in a smaller model that is faster to compute and display. <<BR>> A discussion on '''constrained''' vs '''unconstrained''' sources is presented [[Tutorials/SourceEstimation#Why_does_it_look_so_noisy.3F|here]]. }}} === Surface === Here we will estimate the sources in the surface space for '''constrained''' (normal to the cortex) and '''unconstrained''' dipole orientations. * Right-click on the '''Overlapping spheres (surface)''' head model and select '''Compute sources [2018]. '''Enter the following parameters: * '''Minimum norm imaging''' * '''Current density map''' * '''Constrained: Normal to the cortex''' * '''Comment''' = `MN: MEG (surface)` * Repeat the previous step, but this time select '''Unconstrained''' in the Dipole orientations field. || {{attachment:pro_sources_srfc.png}} || || {{attachment:pro_sources_srfu.png}} || The inversion kernels (<<Icon(iconResultKernel.gif)>>) '''MN: MEG (surface)(Constr) 2018''' and '''MN: MEG (surface)(Unconstr) 2018''' are now available in the database explorer. . {{attachment:tre_sources_srf.png||width="40%"}} ==== Volume ==== To compute the imaging kernel for the volume source space: * Right-click on the '''Overlapping spheres (volume)''' head model and select '''Compute sources [2018], '''with the following parameters: * '''Minimum norm imaging''' * '''Current density map''' * '''Unconstrained''' * '''Comment''' = `MN: MEG (volume)` . {{attachment:pro_sources_vol.png||width="40%"}} At this point the imaging kernel (<<Icon(iconResultKernel.gif)>>) '''MN: MEG (volume)(Unconstr) 2018''' is now also available in the database explorer. . {{attachment:tre_sources_vol.png||width="40%"}} ----- Note that each trial is associated with '''three''' source link (<<Icon(iconResultLink.gif)>>) nodes, that correspond to each of the imaging kernels obtained above. . {{attachment:gui_inverse_kernel.png||width="60%"}} {{{#!wiki tip The '''source link''' nodes are not files containing the sources time series, instead, the links indicate Brainstorm to: load the corresponding MEG recordings, load the respective inverse kernel, and multiply the two on the fly to generate the sources time series. This approach saves space on the hard drive. }}} == Coherence 1xN (source level) == Once we have computed the time series for the sources, it is time to compute coherence between the EMG signal and brain sources obtained with each of the imaging kernels. Let's start with sources from the '''MN: MEG (surface)(Constr)''' kernel: * To select the source maps we want to include in the coherence estimation, click on the [[Tutorials/PipelineEditor#Search_Database|Search Database]] button (<<Icon(iconZoom.gif)>>), and select '''New search'''. * Set the search parameters as shown below, and click on '''Search'''. . {{attachment:gui_search_srf.png||width="70%"}} This will create a new tab in the database explorer. This new tab contains '''only''' the files that match the search criteria. . {{attachment:tre_search_srf.png||width="40%"}} * Click the '''Process2''' tab at the bottom of the main Brainstorm window and drag-and-drop the '''Left (192 files)''' trial group into the '''Files A''' box and repeat for the '''Files B''' box. Select '''Process recordings''' (<<Icon(iconEegList.gif)>>) for Files A, and '''Process sources''' (<<Icon(iconResultList.gif)>>) for Files B. The logic is that we will extract from the same files the EMG signal (Files A side) and the sources time series (Files B side), and then compute coherence between these two sets. Note that blue labels over the '''Files A''' and the '''Files B''' boxes indicate that there are 185 "good trial" files per box. . {{attachment:process2.png||width="80%"}} Open the '''Pipeline editor''': * Add the process '''Connectivity > Coherence AxB [2021]''' with the following parameters: * '''Time window''' = `0 - 1000 ms` or check '''All file''' * '''Source channel (A)''' = `EMGlft` * Uncheck '''Use scouts (B)''' * Do not '''Remove evoked responses from each trial''' * '''Magnitude squared coherence''', '''Window length''' = `0.5 s` * '''Overlap''' = `50%` * '''Highest frequency''' = `80 Hz` * '''Average cross-spectra'''. * Add the process '''File > Add tag''' with the following parameters: * '''Tag to add''' = `(surface)(Constr)` * Select '''Add to file name''' * Run the pipeline || {{attachment:pro_coh_srf.png}} || || {{attachment:pro_coh_srf2.png}} || * Once the processing is finish. Go to the '''Database''' tab of the database explorer and refresh it (with '''[F5]''') to show the resulting 1xN connectivity file (<<Icon(iconConnect1.gif)>>) '''mscohere(0.6Hz,555win): EMGlft | (surface)(Constr)'''. * Repeat the steps above to compute the EMG-sources coherence for the sources from the kernels '''MN: MEG (surface)(Unconstr)''' and '''MN: MEG (volume)(Unconstr)'''. Do not forget to update the '''search criteria''' and the '''tag''' to be added to the result. === Results (Surface) === Double-click the 1xN connectivity files for the '''(surface)''' source space to show the results on the cortex. If you are not familiar with the options in the cortex figures, check [[Tutorials/SourceEstimation#Display:_Cortex_surface|Display: Cortex surface]] Find the location and frequency with the highest coherence value. * To compare the results, set manually the [[Tutorials/Colormaps|colormap]] range to `[0 - 0.07]` * In the '''Surface''' tab * Set the '''Smooth''' slider to `30%` * Adjust the '''amplitude threshold''' to `95%` * Explore with coherence spectra with '''frequency slider''' The highest coherence value is located on the '''right primary motor cortex''' (precentral gyrus) around 14.65 Hz for the analysis using constrained and unconstrained sources. Set the '''amplitude threshold''' to '''0%''' to see the extension of the high coherence values. || {{attachment:res_coh_srfc.png}} || || {{attachment:res_coh_srfu.png}} || ||<style="text-align:center">MSC @ 14.65Hz (surface)(Constr) || ||<style="text-align:center">MSC @ 14.65Hz (surface)(Unconstr) || We observe that results obtained with constrained and unconstrained sources agree in the location and frequency of the peak coherence. The main difference between these results is that coherence values obtained with unconstrained sources appear smoother, this caused by the maximum aggregation performed across directions, explained at detail in the next section. Finally, right-click on any of the cortex figures and select '''Get coordinates'''. Then click on the right motor cortex with the crosshair cursor that appears. The [[CoordinateSystems|SCS]] coordinates will be useful in the next section. <<BR>> SCS coordinates '''X:39.2''', '''Y:-22.3''' and '''Z: 113.0''' {{attachment:res_get_coordinates.png||width="80%"}} === Results (Volume) === Double-click the 1xN connectivity file for the '''(volume)''' source space. Note that this time the results are shown in the '''MRI viewer''' rather than the cortical surface. * Set '''frequency slider''' to 14.65 Hz * Set the SCS coordinates to '''X:39.2''', '''Y:-22.3''' and '''Z: 113.0''' * Set the '''Transparency''' of the coherence values (Data) in the '''Surface''' tab to '''20%''' ||<style="text-align:center"> {{attachment:res_coh_vol.png}} || ||<style="text-align:center">MSC @ 14.65Hz (volume)(Unconstr) || We note that all the results obtained with constrained (surface) and unconstrained (surface and volume) sources agree with each other, and in the location and frequency of the peak coherence. Moreover, they agree with our hypothesis, previous results in the literature [REFS], and the results presented in the [[https://www.fieldtriptoolbox.org/tutorial/coherence/|FieldTrip tutorial]]. === Coherence with constrained and unconstrained sources === For '''constrained''' sources, each vertex in the source grid is associated with '''ONE''' time series, as such, when coherence is computed with the EMG signal (also one time series), the result is '''ONE''' coherence spectrum per vertex. In other words, for each frequency bin, there is coherence brain map. [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_constr.png|{{attachment:diagram_1xn_coh_constr.png|https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_constr.png|width="100%"}}]] In the case of '''unconstrained''' sources, each vertex in the grid is associated with '''THREE''' time series, each one corresponding to the X, Y and Z directions. Thus, when coherence is computed with the EMG signal (one time series), there are '''THREE''' coherence spectra. This complicates its representation in the brain, thus; these '''THREE''' coherence spectra need to be '''flattened''' into one, resulting in one coherence spectrum per vertex, the maximum across directions is found for each frequency bin for each vertex. [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_unconstr.png|{{attachment:diagram_1xn_coh_unconstr.png|https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_unconstr.png|width="100%"}}]] {{{#!wiki caution An alternative approach in the literature, to address the 3-dimensional nature of the unconstrained sources, consists in flattening the vertex X, Y and Z time series before the coherence computation; resulting in a similar case as the constrained sources (REF). Common methods for this flattening include: '''PCA''' (only first component is kept), and [[https://en.wikipedia.org/wiki/Norm_(mathematics)|(Euclidean) norm]]. This flattening of the time series can be performed in Brainstorm with the process: Sources > '''Unconstrained to flat map'''. [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_flattened.png|{{attachment:diagram_1xn_coh_flattened.png||width="100%"}}]] * Flattened sources are saved as full rather than recordings+kernel. * We have tested this flattening approach with simulations and the real data (from this tutorial) and we have found decrimental effects on the expected results. }}} == Coherence 1xN (scout level) == So far, we have computed coherence at the source level, thus, a coherence spectrum is computed for each of the 15002 source points. This large dimension hinders later analysis of the results. Therefore, the strategy is to reduce the dimensionality of the source space by using a [[Tutorials/Scouts#Scout_toolbar_and_menus|surface-]] or [[Tutorials/DefaultAnatomy#MNI_parcellations|volume-]]parcellation scheme, in Brainstorm jargon this is an '''atlas''' that is made of '''scouts'''. See the [[Tutorials/Scouts|scout tutorial]] for detail information on atlases and scouts in Brainstorm. Under this approach, instead of providing one result (coherence spectrum) per source vertex, one result is computed for each scout. When computing coherence (or other connectivity metrics) in the scout level, it is necessary to provide two parameters that define how the data is aggregated per scout: * The '''scout function''' (mean is often used), and * When the within-scout aggregation takes place. Either '''before''' or '''after''' the coherence computation. * '''Before''': The scout function is applied for each direction on the vertices' source time series that make up a scout; resulting in one time series per direction per scout. Then, the scout time series are used to compute coherence with the reference signal (EMG in this tutorial), and the coherence spectra for each scout are aggregated across dimensions, [[#Coherence_with_constrained_and_unconstrained_sources|as shown previously]], to obtain one coherence spectrum per scout. [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_sct_bef.png|{{attachment:diagram_1xn_coh_sct_bef.png|https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_sct_bef.png|width="100%"}}]] * '''After''': Coherence is computed between the reference signal and each direction of the vertices' source time series, [[#Coherence_1xN_.28source_level.29|as in the previous section]]. Then, the scout function is applied on the coherence spectra for each direction of the vertices within a scout, finally these spectra are aggregated across dimensions to obtain a coherence spectrum per scout. [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_sct_aft.png|{{attachment:diagram_1xn_coh_sct_aft.png|https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_1xn_coh_sct_aft.png|width="100%"}}]] {{{#!wiki tip As it can be seen, the '''After''' option takes longer and used more resources as it computes the coherence spectrum for each vertex in the scouts, and then, the coherence spectra are aggregated. }}} <<BR>> Let's here compute the coherence using scouts, using '''mean''' as scout function alongside with the '''Before''' option. We will use the [[https://www.biorxiv.org/content/biorxiv/early/2017/07/16/135632.full.pdf|Schaefer 100 parcellation]] atlas on the results from constrained sources. * Use Search Database (<<Icon(iconZoom.gif)>>) to select the '''Left''' trials with their respective '''(surface)(Constr)''' source maps, as shown in the [[#Coherence_1xN_.28source_level.29|previous section]]. * On the '''Process2''' tab drag-and-drop the '''Left (192 files)''' trial group into the '''Files A''' and '''Files B''' boxes. Select '''Process recordings''' (<<Icon(iconEegList.gif)>>) for Files A, and '''Process sources''' (<<Icon(iconResultList.gif)>>) for Files B. There should be '''185''' files in each side. . {{attachment:process2.png||width="80%"}} Open the '''Pipeline editor''': * Add the process '''Connectivity > Coherence AxB [2021]''' with the following parameters: * '''Time window''' = `0 - 1000 ms` or check '''All file''' * '''Source channel (A)''' = `EMGlft` * Check '''Use scouts (B)''' * From the menu at the right, select '''Schaefer_100_17net''' * Select all the scouts * '''Scout function''': `Mean` * '''When to apply the scout function''': `Before` * Do not '''Remove evoked responses from each trial''' * '''Magnitude squared coherence''', '''Window length''' = `0.5 s` * '''Overlap''' = `50%` * '''Highest frequency''' = `80 Hz` * '''Average cross-spectra'''. * Add the process '''File > Add tag''' with the following parameters: * '''Tag to add''' = `(surface)(Constr)` * Select '''Add to file name''' * Run the pipeline || {{attachment:pro_coh_srfc_bef_sct.png}} || || {{attachment:pro_coh_srfc_bef_sct2.png}} || Open the file: '''mscohere(0.6Hz,555win): EMGlft x 102 scouts, mean before | (surface)(Constr)''' by double-clicking on it. This time the coherence spectra are not displayed on the cortex, but they are plotted for each scout. Moreover, 1xN connectivity file can be shown as image. || {{attachment:res_coh_srfc_bef_sct.png}} || || {{attachment:res_coh_srfc_bef_sct2.png}} || Note that for 14.65 Hz, the highest two peaks correspond to the '''SomMotA_4 R''' and '''SomMotA_2 R''' scouts, both located over the right primary motor cortex. {{{#!wiki caution The choice of the optimal parcellation scheme for the source space is not easy. <<BR>> The optimal choice is to choose a parcellation based on anatomy, for example the Brodmann parcellation. <<BR>> In Brainstorm these atlases are imported in Brainstorm as scouts (cortical regions of interest), and saved directly in the surface files as explained in this tutorial here. }}} {{{#!wiki caution BRAINSTORM TEAM <<BR>> Due to the current implementation of the bst_connectivity, the full source map for each trial (185) are loaded in memory, thus replicate the After, only for the (surface)(Constr) option ~30GB of RAM are needed! (Unconstrained take 3 times that). }}} == Coherence NxN (scout level) == In previous sections, we have computed coherence between a reference signal (EMG) and sources (or scouts). However, depending on the experimental setup and hypotheses, we may want to study the brain as network, this is to say, to compute the NxN connectivity. Due to the large number of sources (often several thousands) while in theory it is possible to compute NxN connectivity, it is not practical, as such a common approach is to use of scouts to reflect the functional connections among its cell assemblies, resulting in a connectome. {{{#!wiki note Diverse studies have shown some overlap between connectomes derived from electrophysiological signals (MEG/EEG) and the ones derived from fMRI, which is reasonably expected as both are the result of the undergoing biological system. However, due to its nature, the '''electrophysiological connectomes provide unique insights on how functional communication is implemented in the brain''' ([[https://doi.org/10.1016/j.neuroimage.2021.118788|Sadaghiani et al., 2022]]). }}} Similar to the [[#Coherence_1xN_.28scout_level.29|coherence 1xN with scouts]], we need to define the '''scout function''' and '''when''' it is going to be applied. Note that computing coherence between two unconstrained leads to 9 (3x3) coherence spectra. Scout function '''before''': [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_nxn_coh_sct_bef.png|{{attachment:diagram_nxn_coh_sct_bef.png|https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_nxn_coh_sct_bef.png|width="100%"}}]] Scout function '''after''': [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_nxn_coh_sct_aft.png|{{attachment:diagram_nxn_coh_sct_aft.png|https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=diagram_nxn_coh_sct_aft.png|width="100%"}}]] {{{#!wiki tip As in the [[#Coherence_1xN_.28scout_level.29|coherence 1xN with scouts]] case, the '''After''' option takes longer and uses way more resources as it computes the coherence spectrum for each vertex in all the scouts, leading to arrays as big as '''[sources, sources, frequency bins]'''! }}} <<BR>> The result is a NxN connectivity file (<<Icon(iconConnectN.gif)>>), It contains (Scouts x Scouts) coherence spectra. {{attachment:diagram_nxn_coh_sct_end.png||width="70%"}} Such a visualization is not practical, thus the connectivity graph or the adjacent matrix are displayed for each frequency bin in the coherence spectra. For more details, see the [[Tutorials/ConnectivityGraph|connectivity graph tutorial]]. A coherence NxN example can be found in the main [[Tutorials/Connectivity|connectivituy tutorial]]. {{{#!wiki comment TO BE REMOVED Let's here compute the NxN coherence, using '''mean''' as scout function alongside with the '''Before''' option, and the '''Schaefer 100''' parcellation atlas. All of this for the constrained sources results. * Use Search Database (<<Icon(iconZoom.gif)>>) to select all the '''(surface)(Constr)''' source maps . {{attachment:gui_search_srf_n.png||width="70%"}} * On the '''Process1''' tab drag-and-drop the '''Left (192 files)''' trial group into '''Files to process''', and select the '''Process sources''' (<<Icon(iconResultList.gif)>>). There should be '''185''' files. . {{attachment:process1_n.png||width="80%"}} Open the '''Pipeline editor''': * Add the process '''Connectivity > Coherence NxN [2021]''' with the following parameters: * '''Time window''' = `0 - 1000 ms` or check '''All file''' * Check '''Use scouts (B)''' * From the menu at the right, select '''Schaefer_100_17net''' * Select all the scouts * '''Scout function''': `Mean` * '''When to apply the scout function''': `Before` * Do not '''Remove evoked responses from each trial''' * '''Magnitude squared coherence''', '''Window length''' = `0.5 s` * '''Overlap''' = `50%` * '''Highest frequency''' = `80 Hz` * '''Average cross-spectra'''. * Run the pipeline {{attachment:pro_coh_n_srfc_bef_sct.png||width="60%"}} The result is a NxN connectivity file (<<Icon(iconConnectN.gif)>>), It contains 10404 (102x102) coherence spectra. Such a visualization is not practical, thus the connectivity graph or the adjacent matrix are displayed for each frequency bin in the coherence spectra. For more details, see the [[Tutorials/ConnectivityGraph|connectivity graph tutorial]]. * Right-click on the NxN connectivity file to see its display options. * Select both, the connectivity '''graph''', and the '''image''' (adjacency matrix). * Set the frequency slider to 14.65 Hz. {{attachment:res_coh_n_srfc_bef_sct.png}} {{attachment:res_coh_n_srfc_bef_sct2.png}} }}} <<TAG(Advanced)>> == Scripting == |
Line 234: | Line 652: |
* 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. }}} |
* Liu J, Sheng Y, Liu H. <<BR>> [[https://doi.org/10.3389/fnhum.2019.00100|Corticomuscular Coherence and Its Applications: A Review]]. <<BR>> Front Hum Neurosci. 2019 Mar 20;13:100. * Sadaghiani S, Brookes MJ, Baillet S. <<BR>> [[https://doi.org/10.1016/j.neuroimage.2021.118788|Connectomics of human electrophysiology]]. <<BR>> NeuroImage. 2022 Feb;247:118788. |
Line 242: | Line 657: |
* Tutorial: [[Tutorials/Connectivity|Functional connectivity]] * Tutorial: [[Tutorials/SourceEstimation|Source estimation]] |
|
Line 243: | Line 660: |
* Tutorial: [[Tutorials/Scouts|Scouts]] * Tutorial: [[Tutorials/ConnectivityGraph|Connectivity graphs]] |
|
Line 245: | Line 664: |
* Forum: Minimum norm units (pA.m): [[http://neuroimage.usc.edu/forums/showthread.php?1246-Doubt-about-current-density-units-pA.m-or-pA-m2|http://neuroimage.usc.edu/forums/showthread.php?1246]] |
{{{#!wiki important [TODO] Find relevant Forum posts. }}} |
Corticomuscular coherence (CTF MEG)
[TUTORIAL UNDER DEVELOPMENT: NOT READY FOR PUBLIC USE]
Authors: Raymundo Cassani, Francois Tadel & Sylvain Baillet.
Corticomuscular coherence measures the degree of similarity between electrophysiological signals (MEG, EEG, ECoG sensor traces or source time series, especially over the contralateral motor cortex) and the EMG signal recorded from muscle activity during voluntary movement. This signal similarity is due mainly to the descending communication along corticospinal pathways between primary motor cortex (M1) and muscles. For consistency and reproducibility purposes across major software toolkits, the present tutorial replicates the processing pipeline "Analysis of corticomuscular coherence" by FieldTrip.
Contents
- Background
- Dataset description
- Download and installation
- Importing anatomy data
- MEG and EMG recordings
- Pre-process
- Importing data epochs
- Coherence 1xN (sensor level)
- MRI segmentation
- MEG source modelling
- Source estimation
- Coherence 1xN (source level)
- Coherence 1xN (scout level)
- Coherence NxN (scout level)
- Scripting
- Additional documentation
Background
Coherence measures the linear relationship between two signals in the frequency domain. Previous studies (Conway et al., 1995, Kilner et al., 2000) have reported corticomuscular coherence effects in the 15–30 Hz range during maintained voluntary contractions.
IMAGE OF EXPERIMENT, SIGNALS and COHERENCE
Dataset description
The dataset comprises MEG recordings (151-channel CTF MEG system) and bipolar EMG recordings (from left and right extensor carpi radialis longus muscles) from one participant who was tasked to lift their hand and exert a constant force against a lever for about 10 seconds. The force was monitored by strain gauges on the lever. The participant performed two blocks of 25 trials using either the left or right wrist. EOG signals were also recorded, which will be useful for detection and attenuation of ocular artifacts. We will analyze the data from the left-wrist trials in the present tutorial. Replicating the pipeline with right-wrist data is a good exercise to do next!
Download and installation
Requirements:
Please make sure you have completed the get-started tutorials and that you have a working copy of Brainstorm installed on your computer.
In addition, you need to install the plugin CAT12, used for MRI segmentation.
Download the dataset:
Download SubjectCMC.zip from FieldTrip FTP server:
ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/SubjectCMC.zip- Unzip it in a folder not located in any of Brainstorm folders (the app or its database).
Brainstorm:
- Launch Brainstorm (via Matlab command line or the Matlab-free 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.
Importing anatomy data
Right-click on the newly created TutorialCMC node > New subject > Subject01.
Keep the default options defined for the study (aka "protocol" in Brainstorm jargon).Switch to the Anatomy view of the protocol ().
Right-click on the Subject01 > Import MRI:
Select the file format: All MRI files (subject space)
Select the file: SubjectCMC/SubjectCMC.mri
This will open the MRI viewer showing the coronal, sagittal and axial views of the MRI. In addition, three anatomical fiducials: left and right pre-auricular points (LPA and RPA), and nasion (NAS) are automatically identified. These fiducials are located near the left/right ears and just above the nose respectively. Click on Save.
In a typical Brainstorm workflow, as illustrated in all the other tutorials, we would recommend running the full segmentation of the MRI at this stage, in order to have the anatomy of the subject fully prepared before importing the functional data. In the case of this tutorial, we will proceed differently, in order to follow better the original FieldTrip pipeline and to obtain sensor-level coherence results much faster. We will run the segmentation of the anatomy just before moving to the source-level analysis.
- For validating the registration between the MRI and the MEG, we will now limit the anatomy processing to the reconstruction of the head surface from the MRI.
Right-click on the MRI () > MRI segmentation > Generate head surface.
At the end, you would get one new head surface. Double-click on it to display it.
MEG and EMG recordings
Link the recordings to Brainstorm database
Switch now to the Functional data view ().
Right-click on the Subject01 > Review raw file:
Select the file format: MEG/EEG: CTF(*.ds; *.meg4; *.res4)
Select the file: SubjectCMC.ds
A new folder SubjectCMC is created in the Brainstorm database explorer. Note the "RAW" tag over the icon of the folder (), indicating the files contain unprocessed, continuous data. It contains:
CTF channels (191): Channel file with all channel types, names, locations, etc. The number of channels available (MEG, EMG, EOG etc.) is indicated between parentheses.
Link to raw file: Provides access to the original data file. All the relevant metadata was read from the dataset and copied inside the node itself (e.g., sampling rate, number of time samples, event markers). Note that Brainstorm logic is not to import/duplicate the raw unprocessed data directly into the database. Instead, Brainstorm provides a link to that raw file for further review and data extraction (more information).
MEG-MRI coregistration
This step, sometimes simply named registration, refers to the alignment of the sensors on the anatomy of the subject (more info). For this tutorial, data registration is carried out using only three anatomical landmarks present in the MRI and MEG data. According to the description of the data in the FieldTrip tutorial:
"To measure the head position with respect to the sensors, three coils were placed at anatomical landmarks of the head (nasion, left and right ear canal). [...] During the MRI scan, ear molds containing small containers filled with vitamin E marked the same landmarks. This allows us, together with the anatomical landmarks, to align source estimates of the MEG with the MRI."To verify the registration, right-click on the CTF channels node > MRI registration > Check. This opens a 3D figure showing the inner surface of the MEG helmet, the head surface, and the fiducials and axes that comprise the subject coordinate system (SCS).
Reviewing continuous recordings
Right-click on Link to raw file > Switch epoched/continuous to convert the file to continuous, a technical detail proper to CTF file formatting.
Right-click on Link to raw file > MEG > Display time series (or double-click). This will open a new visualization window to explore data time series, also enabling the Time panel and the Record tab in the main Brainstorm window (see how to best use all controls in this panel and tab to explore data time series).
Right-click on Link to raw file > EMG > Display time series.
Event markers
The colored dots above the data time series indicate event markers (or triggers) saved with this dataset. The trial onset information of the left-wrist and right-wrist trials is saved in an auxiliary channel of the raw data named Stim. To add these markers, these events need to be decoded as follows:
While the time series figure is open, go to the Record tab and File > Read events from channel. Event channels = Stim, select Value, and click Run.
This creates new event markers now shown in the Events section of the tab, along with previous event categories. In this tutorial, we will only use events U1 through U25, which correspond to the beginning of each of the 25 trials of 10 seconds with left-wrist movements. To make sure we reproduce FieldTrip tutorial, we need to reject trial #7, event U7.
Delete unused events: Select all the events except U1-U6 and U8-25 (Ctrl+click / Shift+click), then menu Events > Delete group (or press the Delete key).
Merge events: Select all the event groups, then menu Events > Merge group > "Left". This new event category references 24 trials of the left-wrist condition, i.e. 10-second blocks of left-wrist movements.
Pre-process
In this tutorial, we will analyze only the Left trials (left-wrist extensions). In the following sections, we will process only the first 330 s of the recordings, where the left-wrist trials were performed.
Removal of power line artifacts
In the Process1 box: Drag and drop the Link to raw file.
Run process Frequency > Power spectrum density (Welch):
Time window: 0-330 s
Window length: 10 s
Overlap: 50%
Sensor types: MEG, EMG
Double-click on the new PSD file to visualize the power spectrum density of the data.
- The PSD plot shows two groups of sensors: EMG (highlighted in red above) and the MEG spectra below. Peaks at 50Hz and its harmonics (100, 150, 200Hz and above) correspond to the European power line and are clearly visible. We will use notch filters to attenuate power line contaminants at 50, 100 and 150 Hz.
In the Process1 box: Drag and drop the Raw | clean node.
Run the process Pre-processing > Notch filter with:
Check Process the entire file at once
Sensor types: MEG, EMG
Frequencies to remove (Hz): 50, 100, 150
Troubleshooting in case of memory error:
These MEG recordings have been saved before applying the CTF 3rd-order gradient compensation. The compensation weights are applied on the fly when Brainstorm reads data from the file, however this requires reading all the channels at once. By default, the frequency filter are optimized to process the channels sequentially, which is incompatible with applying the CTF compensation on the fly. This setting can be overridden with the option Process the entire file at once, but this solution has the effect of loading the entire file in memory at once, which can crash on computers with limited memory (RAM < 8Gb). If this happens to you: run the process Artifacts > Apply SSP & CTF compensation on the file first, then the notch filter without the option "Process the entire file at once" (more information).A new folder named SubjectCMC_clean_notch is created. Estimate the PSD of these signals to appreciate the effect of the notch filters applied. As above, please remember to indicate a Time window restricted from 0 to 330 s in the options of the PSD process.
EMG pre-processing
Two typical pre-processing steps for EMG consist in high-pass filtering and rectifying.
In the Process1 box: drag and drop the Raw | notch(50Hz 100Hz 150Hz) node.
Add the process Pre-process > Band-pass filter
Sensor types = EMG
Lower cutoff frequency = 10 Hz
Upper cutoff frequency = 0 Hz
Add the process Pre-process > Absolute values
Sensor types = EMG
- Run the pipeline
Delete intermediate files that won't be needed anymore: Select folders SubjectCMC_notch and SubjectCMC_notch_high, then press the Delete key (or right-click > File > Delete).
MEG pre-processing
Detection and removal of artifacts with SSP
Stereotypical artifacts such eye blinks and heartbeats can be identified from their respective characteristic spatial distributions. Their contamination of MEG signals can then be attenuated specifically using Signal-Space Projections (SSPs). For more details, consult the dedicated tutorials about the detection and removal of artifacts with SSP. The present tutorial dataset features an EOG channel but no ECG. We will perform only the removal of eye blinks.
Right-click on the pre-processed file, ie Raw | notch(50Hz 100Hz 150Hz) | high(10Hz) | abs, then select MEG > Display time series and EOG > Display time series.
In the Events section of the Record tab, select Artifacts > Detect eye blinks, and use the parameters:
Channel name= EOG
Time window = 0 - 330 s
Event name = blink
Three categories of blink events are created. Review the traces of EOG channels around a few of these events to ascertain they are related to eye blinks. In the present case, we note that the blink group contains genuine eye blinks, and that groups blink2 and blink3 capture saccade events.
To remove blink artifacts with SSP go to Artifacts > SSP: Eye blinks, and use the parameters:
Event name=blink
Sensors=MEG
Check Compute using existing SSP/ICA projectors
- Display the time series and topographies of the first two (dominant) SSP components identified. In the present case, only the first SSP component can be clearly related to blinks. Select only component #1 for removal.
Follow the same procedure for the other blink events (blink2 and blink3). As mentioned above, none of the first two SSP components seem to be related to ocular artifacts. The figure below shows the visualization of the first two components for the blink2 group.
We therefore recommend unselecting the blink2 and blink3 groups from the Select Active Projectors panel (see below) rather than removing spatial components which nature remains ambiguous.
Click on the large × at the top right of the main Brainstorm window to close all visualization windows.
Detection of "bad" data segments:
Here we will use the automatic detection of artifacts to identify data segments contaminated by e.g., large eye and head movements and muscle contractions.
Display the MEG and EOG time series. In the Record tab, select Artifacts > Detect other artifacts and enter the following parameters:
Time window = 0 - 330 s
Sensor types=MEG
Sensitivity=3
Check both frequency bands 1-7 Hz and 40-240 Hz
We encourage users to review and validate the segments marked using this procedure. In the present case, the segments detected as bad clearly point at contaminated MEG data segments. We will now label these as "bad".
Select the 1-7Hz and 40-240Hz event groups and select Events > Mark group as bad from the contextual menu. Alternatively, you can also rename the events created above and append the bad_ prefix to their name: Brainstorm will automatically discard these data segments from further processing.
- Close all visualization windows and reply "Yes" to the save the modifications query.
Importing data epochs
At this point we are finished with the pre-processing of the EMG and MEG recordings. We will now extract and import specific data segments of interest into the Brainstorm database for further derivations. We refer to these segments as epochs or trials. As mentioned previously, we will focus on the Left (wrist) category of events. To follow the same pipeline as the FieldTrip tutorial, only the first 8 1-s epochs for each trial are imported. In addition DC offset is removed only for MEG signals.
Drag-and-drop the pre-processed file, ie Raw | notch(50Hz 100Hz 150Hz) | high(10Hz) | abs, to the Process1 box.
Add the process Import > Import recordings > Import MEG/EEG: Events and set its parameters:
Subject name = Subject01 should be set
Folder name = empty
Event names = Left
Time window = 0 - 330 s
Epoch time = 0 - 8000 ms
Split recordings in time blocks = 1 s
Uncheck Create a separate folder for each event type
Check Ignore shorter epochs
Check Use CTF compensation
Check Use SSP/ICA projectors
Add the process Pre-process > Remove DC offset and set its parameters:
Baseline = All file
Sensor types = MEG
- Run the pipeline
|
|
|
A new folder SubjectCMC_notch_high_abs without the 'raw' indication is created for Subject01.
The new folder contains a copy of the channel file from the original raw file, and 192 (24 trials, 8 epochs each) individual trials tagged as Left in a new trial group (). Expand the trial group and note there are trials marked with an exclamation mark in a red circle (). This indicates trials that contain segments of signal occurred in the bad segments we previously identified. All the bad trials will be automatically ignored for further processing, whenever dropped into the Process1 and Process2 tabs.
To have a glance of the signals after the pre-processing, plot the MEG signal for one sensor over the left motor-cortex (MRC21) and the EMG signals, for trial 1 (left image). Note that these traces are similar to the ones obtained in the FieldTrip tutorial (right image).
Coherence 1xN (sensor level)
We will now compute the magnitude square coherence (MSC) between the left EMG signal and each of the MEG sensor data.
In the Process1 box, drag and drop the Left (192 files) trial group.
Open the Pipeline editor:
Add the process Connectivity > Coherence 1xN [2021] with the following parameters:
Time window = 0 - 1000 ms or check All file
Source channel = EMGlft
Do not check Include bad channels nor Remove evoke response
Magnitude squared coherence
Window length for PSD estimation = 0.5 s
Overlap for PSD estimation = 50%
Highest frequency of interest = 80 Hz
Average cross-spectra of input files (one output file)
More details on the Coherence process can be found in the connectivity tutorial.
Add the process File > Add tag with the following parameters:
Tag to add = MEG sensors
Select Add to file name
- Run the pipeline
|
|
|
Double-click on the resulting node mscohere(0.6Hz,555win): EMGlft | MEG sensors to display the MSC spectra. Click on the maximum peak in the 15 to 20 Hz range, and press Enter to plot it in a new figure. This spectrum corresponds to channel MRC21, and shows a large peak at 17.58 Hz. You can also use the frequency slider (under the Time panel) to explore the MSC output more precisely across frequencies.
Right-click on the spectrum and select 2D Sensor cap for a topographical representation of the magnitude of the coherence results across the sensor array. You may also use the shortcut Ctrl-T. The sensor locations can be displayed with a right-click and by selecting Channels > Display sensors from the contextual menu (shortcut Ctrl-E).
We can now average magnitude of the MSC across a frequency band of interest (15-20 Hz):
In the Process1 box, drag-and-drop the mscohere(0.6Hz,555win): EMGlft | MEG sensors node, and add the process Frequency > Group in time or frequency bands with the parameters:
Select Group by frequency
Type cmc_band / 15, 20 / mean in the text box.
The resulting file mscohere(0.6Hz,555win): EMGlft | MEG sensors | tfbands has only one MSC value for each sensor (the MSC average in the 15-20 Hz band). You may visualize the topography of this MSC statistics via 3 possible representations: 2D Sensor cap, 2D Sensor cap and 2D Disk, which are all accessible via a right-click over the MSC node. We clicked on sensor MRC21 below; it is shown in red.
We can observe higher MSC values between the EMG signal and MEG sensor signals over the contralateral set of central sensors in the beta band. Unfortunately, sensor-level connectivity presents the disadvantages of not being interpretable, and being subject to spurious results due to volume conduction.
In the next section we will compute coherence in the source level. To do this, we first need to estimate the sources time series from the sensor data.
MRI segmentation
We then need to segment the head tissues to obtain the surfaces required to derive a realistic MEG head models (aka "forward models"). Here, we will perform MRI segmentation with CAT12, this process takes between 30 to 60 minutes.
Right-click on the SubjectCMC MRI node (), then select MRI segmentation > CAT12: Cortex, atlases, tissues. This will prompt a series of windows to set the parameters for the MRI segmentation, use the following parameters:
Number of vertices on the cortex surface use 15000
Compute anatomical parcellations? select Yes
Compute cortical maps select No
CAT12 computes the scalp surface (), and the cortex surfaces () for white matter, pial envelope and the midpoint between them. The default surface of each type is indicated in green. Moreover, as part of the MRI segmentation with CAT12, the anatomy data is normalized in the MNI space, and several anatomical parcellations () are computed. For further information on the anatomy files see the Display the anatomy tutorial.
Double-click on the head mask and then on the central_15002 surface to display them.
In addition, the registration between the MRI and the surfaces can be checked with context menu MRI registration > Check MRI/surface registration...
MEG source modelling
We will perform source modelling using a distributed model approach for two possible source spaces: the cortex surface and the entire MRI volume. In the surface space, a source grid is made with the source located on the cortical surface obtained from the participant's MRI. For the volume space, the source grid consists of elementary sources uniformly distributed across the entire brain volume. Before estimating the brain sources, we need to derive the sensor noise covariance matrix, and the head model.
Noise covariance
The recommendation for MEG, is to extract basic noise statistics from empty-room recordings. However, when recommended empty-room recordings are not available, as with this tutorial data, resting-state data can be used as proxies for MEG noise covariance. See the noise covariance tutorial for more details.
In the raw SubjectCMC_clean_notch_high_abs node, right-click over Raw | clean | notch(...and select Noise covariance > Compute from recordings. Please enter the following parameters:
Baseline: from 18 to 29 s
Select the Block by block option.
Copy the Noise covariance () node to the SubjectCMC_preprocessed folder. This can be done using the shortcuts Ctrl-C and Ctrl-V.
Head model
The head model, aka forward model, accounts for how neural electrical currents (in a source space) produce magnetic fields captured by sensors outside the head, considering head tissues electromagnetic properties and geometry, independently of actual empirical measurements. As the head model depends on the source space, a distinct head model is required for the surface and volume source spaces. Please refer to the head model tutorial for more in-depth explanations.
Surface
Go to the Anatomy view of the database and verify that the pial_15002V surface is the default (green characters) cortex surface. Otherwise, right-click on it and select Set as default cortex in the contextual menu.
Go back Functional data view of the database, and inside the SubjectCMC_preprocessed folder, right-click over CTF channels (191) and select Compute head model from the contextual menu. Run the process with the options as indicated below:
Comment = Overlapping spheres (surface)
Source space = Cortex surface
Forward model = MEG Overlapping spheres.
The cortical head model will be derived from each of the 15,000 sources (surface vertices) as defined in the default cortex.
The Overlapping spheres (surface) head model () now appears in the database explorer.
Volume
In the SubjectCMC_preprocessed folder, right-click over the CTF channels (191) node and select Compute head model. Set the option values to:
Comment = Overlapping spheres (volume)
Source space = MRI volume
Forward model = Overlapping spheres.
In the Volume source grid window, specify the following parameters that will produce around 11,500 source grid points across the brain volume.
Select Regular grid and Brain
Grid resolution = 5 mm
The Overlapping spheres (volume) head model is now added to the database explorer. The green color indicates this is the default head model for the current folder (this can be changed by simply double clicking over the head model nodes.)
Source estimation
Now that the noise covariance and head model(s) are available, we will perform source estimation, to find the sources that gave origin to the signals registered in the sensors. From the diverse source estimation methods available in Brainstorm, in this tutorial the minimum-norm imaging method is used. The minimum-norm method estimates the linear combination of the current at each point in the source grid that explains the recorded sensor signals favouring minimum energy (L2-norm) solutions. As result, a large matrix called the imaging kernel is obtained. By multiplying the imaging kernel with the sensor data, it is possible to obtain the estimates of brain sources time series. A different imaging kernel is derived for each of the head models we have produced above: surface and volume. See the source estimation tutorial for more details.
Each dipole in the source grid may point arbitrarily in any direction in a 3D space.
Only for surface grids, the dipole orientation can be fixed to be normal to the cortical surface, this approach is based on anatomical observations of the brain cortex. The result is then in a smaller model that is faster to compute and display.
A discussion on constrained vs unconstrained sources is presented here.
Surface
Here we will estimate the sources in the surface space for constrained (normal to the cortex) and unconstrained dipole orientations.
Right-click on the Overlapping spheres (surface) head model and select Compute sources [2018]. Enter the following parameters:
Minimum norm imaging
Current density map
Constrained: Normal to the cortex
Comment = MN: MEG (surface)
Repeat the previous step, but this time select Unconstrained in the Dipole orientations field.
|
|
|
The inversion kernels () MN: MEG (surface)(Constr) 2018 and MN: MEG (surface)(Unconstr) 2018 are now available in the database explorer.
Volume
To compute the imaging kernel for the volume source space:
Right-click on the Overlapping spheres (volume) head model and select Compute sources [2018], with the following parameters:
Minimum norm imaging
Current density map
Unconstrained
Comment = MN: MEG (volume)
At this point the imaging kernel () MN: MEG (volume)(Unconstr) 2018 is now also available in the database explorer.
Note that each trial is associated with three source link () nodes, that correspond to each of the imaging kernels obtained above.
The source link nodes are not files containing the sources time series, instead, the links indicate Brainstorm to: load the corresponding MEG recordings, load the respective inverse kernel, and multiply the two on the fly to generate the sources time series. This approach saves space on the hard drive.
Coherence 1xN (source level)
Once we have computed the time series for the sources, it is time to compute coherence between the EMG signal and brain sources obtained with each of the imaging kernels.
Let's start with sources from the MN: MEG (surface)(Constr) kernel:
To select the source maps we want to include in the coherence estimation, click on the Search Database button (), and select New search.
Set the search parameters as shown below, and click on Search.
This will create a new tab in the database explorer. This new tab contains only the files that match the search criteria.
Click the Process2 tab at the bottom of the main Brainstorm window and drag-and-drop the Left (192 files) trial group into the Files A box and repeat for the Files B box. Select Process recordings () for Files A, and Process sources () for Files B. The logic is that we will extract from the same files the EMG signal (Files A side) and the sources time series (Files B side), and then compute coherence between these two sets. Note that blue labels over the Files A and the Files B boxes indicate that there are 185 "good trial" files per box.
Open the Pipeline editor:
Add the process Connectivity > Coherence AxB [2021] with the following parameters:
Time window = 0 - 1000 ms or check All file
Source channel (A) = EMGlft
Uncheck Use scouts (B)
Do not Remove evoked responses from each trial
Magnitude squared coherence, Window length = 0.5 s
Overlap = 50%
Highest frequency = 80 Hz
Average cross-spectra.
Add the process File > Add tag with the following parameters:
Tag to add = (surface)(Constr)
Select Add to file name
- Run the pipeline
|
|
|
Once the processing is finish. Go to the Database tab of the database explorer and refresh it (with [F5]) to show the resulting 1xN connectivity file () mscohere(0.6Hz,555win): EMGlft | (surface)(Constr).
Repeat the steps above to compute the EMG-sources coherence for the sources from the kernels MN: MEG (surface)(Unconstr) and MN: MEG (volume)(Unconstr). Do not forget to update the search criteria and the tag to be added to the result.
Results (Surface)
Double-click the 1xN connectivity files for the (surface) source space to show the results on the cortex. If you are not familiar with the options in the cortex figures, check Display: Cortex surface
Find the location and frequency with the highest coherence value.
To compare the results, set manually the colormap range to [0 - 0.07]
In the Surface tab
Set the Smooth slider to 30%
Adjust the amplitude threshold to 95%
Explore with coherence spectra with frequency slider
The highest coherence value is located on the right primary motor cortex (precentral gyrus) around 14.65 Hz for the analysis using constrained and unconstrained sources. Set the amplitude threshold to 0% to see the extension of the high coherence values.
|
|
|
MSC @ 14.65Hz (surface)(Constr) |
|
MSC @ 14.65Hz (surface)(Unconstr) |
We observe that results obtained with constrained and unconstrained sources agree in the location and frequency of the peak coherence. The main difference between these results is that coherence values obtained with unconstrained sources appear smoother, this caused by the maximum aggregation performed across directions, explained at detail in the next section.
Finally, right-click on any of the cortex figures and select Get coordinates. Then click on the right motor cortex with the crosshair cursor that appears. The SCS coordinates will be useful in the next section.
SCS coordinates X:39.2, Y:-22.3 and Z: 113.0
Results (Volume)
Double-click the 1xN connectivity file for the (volume) source space. Note that this time the results are shown in the MRI viewer rather than the cortical surface.
Set frequency slider to 14.65 Hz
Set the SCS coordinates to X:39.2, Y:-22.3 and Z: 113.0
Set the Transparency of the coherence values (Data) in the Surface tab to 20%
|
MSC @ 14.65Hz (volume)(Unconstr) |
We note that all the results obtained with constrained (surface) and unconstrained (surface and volume) sources agree with each other, and in the location and frequency of the peak coherence. Moreover, they agree with our hypothesis, previous results in the literature [REFS], and the results presented in the FieldTrip tutorial.
Coherence with constrained and unconstrained sources
For constrained sources, each vertex in the source grid is associated with ONE time series, as such, when coherence is computed with the EMG signal (also one time series), the result is ONE coherence spectrum per vertex. In other words, for each frequency bin, there is coherence brain map.
In the case of unconstrained sources, each vertex in the grid is associated with THREE time series, each one corresponding to the X, Y and Z directions. Thus, when coherence is computed with the EMG signal (one time series), there are THREE coherence spectra. This complicates its representation in the brain, thus; these THREE coherence spectra need to be flattened into one, resulting in one coherence spectrum per vertex, the maximum across directions is found for each frequency bin for each vertex.
An alternative approach in the literature, to address the 3-dimensional nature of the unconstrained sources, consists in flattening the vertex X, Y and Z time series before the coherence computation; resulting in a similar case as the constrained sources (REF). Common methods for this flattening include: PCA (only first component is kept), and (Euclidean) norm. This flattening of the time series can be performed in Brainstorm with the process: Sources > Unconstrained to flat map.
- Flattened sources are saved as full rather than recordings+kernel.
- We have tested this flattening approach with simulations and the real data (from this tutorial) and we have found decrimental effects on the expected results.
Coherence 1xN (scout level)
So far, we have computed coherence at the source level, thus, a coherence spectrum is computed for each of the 15002 source points. This large dimension hinders later analysis of the results. Therefore, the strategy is to reduce the dimensionality of the source space by using a surface- or volume-parcellation scheme, in Brainstorm jargon this is an atlas that is made of scouts. See the scout tutorial for detail information on atlases and scouts in Brainstorm.
Under this approach, instead of providing one result (coherence spectrum) per source vertex, one result is computed for each scout. When computing coherence (or other connectivity metrics) in the scout level, it is necessary to provide two parameters that define how the data is aggregated per scout:
The scout function (mean is often used), and
When the within-scout aggregation takes place. Either before or after the coherence computation.
Before: The scout function is applied for each direction on the vertices' source time series that make up a scout; resulting in one time series per direction per scout. Then, the scout time series are used to compute coherence with the reference signal (EMG in this tutorial), and the coherence spectra for each scout are aggregated across dimensions, as shown previously, to obtain one coherence spectrum per scout.
After: Coherence is computed between the reference signal and each direction of the vertices' source time series, as in the previous section. Then, the scout function is applied on the coherence spectra for each direction of the vertices within a scout, finally these spectra are aggregated across dimensions to obtain a coherence spectrum per scout.
As it can be seen, the After option takes longer and used more resources as it computes the coherence spectrum for each vertex in the scouts, and then, the coherence spectra are aggregated.
Let's here compute the coherence using scouts, using mean as scout function alongside with the Before option. We will use the Schaefer 100 parcellation atlas on the results from constrained sources.
Use Search Database () to select the Left trials with their respective (surface)(Constr) source maps, as shown in the previous section.
On the Process2 tab drag-and-drop the Left (192 files) trial group into the Files A and Files B boxes. Select Process recordings () for Files A, and Process sources () for Files B. There should be 185 files in each side.
Open the Pipeline editor:
Add the process Connectivity > Coherence AxB [2021] with the following parameters:
Time window = 0 - 1000 ms or check All file
Source channel (A) = EMGlft
Check Use scouts (B)
From the menu at the right, select Schaefer_100_17net
- Select all the scouts
Scout function: Mean
When to apply the scout function: Before
Do not Remove evoked responses from each trial
Magnitude squared coherence, Window length = 0.5 s
Overlap = 50%
Highest frequency = 80 Hz
Average cross-spectra.
Add the process File > Add tag with the following parameters:
Tag to add = (surface)(Constr)
Select Add to file name
- Run the pipeline
|
|
|
Open the file: mscohere(0.6Hz,555win): EMGlft x 102 scouts, mean before | (surface)(Constr) by double-clicking on it. This time the coherence spectra are not displayed on the cortex, but they are plotted for each scout. Moreover, 1xN connectivity file can be shown as image.
|
|
|
Note that for 14.65 Hz, the highest two peaks correspond to the SomMotA_4 R and SomMotA_2 R scouts, both located over the right primary motor cortex.
The choice of the optimal parcellation scheme for the source space is not easy.
The optimal choice is to choose a parcellation based on anatomy, for example the Brodmann parcellation.
In Brainstorm these atlases are imported in Brainstorm as scouts (cortical regions of interest), and saved directly in the surface files as explained in this tutorial here.
BRAINSTORM TEAM
Due to the current implementation of the bst_connectivity, the full source map for each trial (185) are loaded in memory, thus replicate the After, only for the (surface)(Constr) option ~30GB of RAM are needed! (Unconstrained take 3 times that).
Coherence NxN (scout level)
In previous sections, we have computed coherence between a reference signal (EMG) and sources (or scouts). However, depending on the experimental setup and hypotheses, we may want to study the brain as network, this is to say, to compute the NxN connectivity. Due to the large number of sources (often several thousands) while in theory it is possible to compute NxN connectivity, it is not practical, as such a common approach is to use of scouts to reflect the functional connections among its cell assemblies, resulting in a connectome.
Diverse studies have shown some overlap between connectomes derived from electrophysiological signals (MEG/EEG) and the ones derived from fMRI, which is reasonably expected as both are the result of the undergoing biological system. However, due to its nature, the electrophysiological connectomes provide unique insights on how functional communication is implemented in the brain (Sadaghiani et al., 2022).
Similar to the coherence 1xN with scouts, we need to define the scout function and when it is going to be applied. Note that computing coherence between two unconstrained leads to 9 (3x3) coherence spectra.
As in the coherence 1xN with scouts case, the After option takes longer and uses way more resources as it computes the coherence spectrum for each vertex in all the scouts, leading to arrays as big as [sources, sources, frequency bins]!
The result is a NxN connectivity file (), It contains (Scouts x Scouts) coherence spectra.
Such a visualization is not practical, thus the connectivity graph or the adjacent matrix are displayed for each frequency bin in the coherence spectra. For more details, see the connectivity graph tutorial.
A coherence NxN example can be found in the main connectivituy tutorial.
Scripting
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.
Corticomuscular Coherence and Its Applications: A Review.
Front Hum Neurosci. 2019 Mar 20;13:100.Sadaghiani S, Brookes MJ, Baillet S.
Connectomics of human electrophysiology.
NeuroImage. 2022 Feb;247:118788.
Tutorials
Tutorial: Functional connectivity
Tutorial: Source estimation
Tutorial: Volume source estimation
Tutorial: Scouts
Tutorial: Connectivity graphs
Forum discussions
[TODO] Find relevant Forum posts.