43931
Comment:
|
43052
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
<<HTML(<style>.backtick {font-size: 16px; font-weight: bold;}</style>)>><<HTML(<style>abbr {font-weight: bold;}</style>)>> <<HTML(<style>em strong {font-weight: bold; font-style: normal; padding: 2px; border-radius: 5px; background-color: #DDD; color: #111;}</style>)>> = Corticomuscular coherence (MEG) = |
<<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) = |
Line 8: | Line 8: |
[[https://en.wikipedia.org/wiki/Corticomuscular_coherence|Corticomuscular coherence]] measures a 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)>> == Background == [[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 cortico-muscular coherence effects in the 15–30 Hz range during maintained voluntary contractions. IMAGE OF EXPERIMENT, SIGNALS and COHERENCE |
[[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(3,2)>> |
Line 18: | Line 13: |
The dataset comprises recordings from MEG (151-channel CTF MEG system) and bipolar EMG (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! | The dataset is distributed as part of the FieldTrip tutorial [[https://www.fieldtriptoolbox.org/tutorial/coherence/|Analysis of corticomuscular coherence]]: * One participant * MEG recordings: 151-channel CTF MEG system * Bipolar EMG recordings: from left and right extensor carpi radialis longus muscles * EOG recordings: used for detection and attenuation of ocular artifacts * MRI: 1.5T Siemens system * Task: The participant 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. * 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! Corticomuscular coherence: * [[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. * TODO: IMAGE OF EXPERIMENT, SIGNALS and COHERENCE |
Line 21: | Line 30: |
* '''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 CAT12 plugin]] in Brainstorm. [[http://www.neuro.uni-jena.de/cat/index.html|CAT12]] will be used for MRI segmentation. * '''Download the dataset''': * Download `SubjectCMC.zip` from FieldTrip's FTP server:<<BR>> ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/SubjectCMC.zip * Unzip the .zip in a folder not located in any of current Brainstorm's folders (the app per se or its database folder). * '''Brainstorm''': * Launch Brainstorm (via Matlab's command line or use Brainstorm's 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'''. The next sections describe how to import the participant's anatomical data, review raw data, manage event markers, pre-process EMG and MEG signals, epoch and import recordings for further analyzes, with a focus on computing coherence at the sensor (scalp) and brain map (sources) levels. == Importing and processing anatomy data == * Right-click on the newly created '''TutorialCMC''' node in your Brainstorm data tree then: '''''New subject > Subject01'''''.<<BR>>Keep the default options defined for the study (aka "protocol" in Brainstorm's jargon). * Switch to the '''Anatomy''' view of the protocol. * Right-click on the '''Subject01''' node then '''''Import MRI''''': * Select the adequate file format from the pull-down menu: '''All MRI file (subject space)''' |
'''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. '''Download the dataset''' * 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). '''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:<<BR>> No, use individual anatomy, <<BR>> No, use one channel file per acquisition run. == Importing anatomy == * 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 39: | Line 53: |
* 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 identifed. These fiducials are located near the left/right ears and just above the nose respectively. Click on '''Save'''. {{{#!wiki comment * Register the individual anatomy to MNI brain space, for standardization of coordinates: in the '''MRI viewer''' click on '''Click here to compute MNI normalization''', use the '''maff8''' method. When the normalization is complete, verify that the locations of the anatomical fiducials are adequate (essentially that they are indeed near the left/right ears and right above the nose) and click on '''Save'''. }}} {{{#!wiki comment {{attachment:mri_viewer.png}} }}} . [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=mri_viewer.png|{{attachment:mri_viewer.png|https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence?action=AttachFile&do=get&target=mri_viewer.png}}]] We then need to segment the head tissues to obtain the surfaces required to derive a realistic MEG [[Tutorials/HeadModel|head model (aka "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` * '''fill holes factor''': `2` A set of (head and brain) surface files are now available for further head modelling (see below). . {{attachment:import_result.png||width="40%"}} You can display the surfaces by double-clicking on these new nodes. There are a couple of issues with the structural data available from this tutorial. Note how the '''cortex''' (shown in red) overlaps with the '''innerskull''' surface (shown in gray). For this reason, the [[Tutorials/TutBem|BEM forward model cannot be derived accurately with OpenMEEG]]. We will use an analytical approximation using the [[Tutorials/HeadModel#Forward_model|overlapping-spheres method]], which in MEG has been shown to be adequately accurate for most studies. Note also how the '''cortex''' and '''white''' surfaces obtained do not register accurately with the cortical surface. We will therefore use a [[Tutorials/TutVolSource|volume-based source estimation]] approach based on a volumic grid of elementary MEG source across the cerebrum (not a surface-constrained source model). We encourage users to try [[Tutorials/SegCAT12|CAT12]] or [[Tutorials/LabelFreeSurfer|FreeSurfer]], also directely from Brainstorm, to obtain surface segmentations of higher quality before running BEM modelling (as an extra exercise). . {{attachment:over_innerskul_cortex.png||width="50%"}} As the imported anatomy data is normalized in the MNI space, it is possible to apply use [[Tutorials/DefaultAnatomy#MNI_parcellations|MNI parcellation]] templates to define anatomical regions of the brain of the subject. These anatomical regions can be used to create [[Tutorials/TutVolSource#Volume_atlases|volume]] and [[Tutorials/Scouts|surface scouts]], which are convenient when performing the coherence analysis in the source level. Let's add the [[https://www.gin.cnrs.fr/en/tools/aal/|AAL3]] parcellation to the imported data. * Right-click on Subject01 then go to the menu '''''Add MNI parcellation > AAL3'''''. The menu will appear as '''''Download: AAL3''''' if the atlas is not in your system. Once the MNI atlas is downloaded, an atlas node (ICON) appears in the database explorer and the atlas is displayed in the the MRI viewer. . {{attachment:gui_mni_aal3.png}} <<BR>> == Review the MEG and EMG recordings == === Link the recordings to Brainstorm's database === * Switch now to the '''Functional data''' view (X button). * Right-click on the '''Subject01''' node then '''''Review raw file''''': * Select the file format of current data from the pulldown menu options: '''MEG/EEG: CTF(*.ds; *.meg4; *.res4)''' |
* 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 === * Switch now to the '''Functional data '''view (<<Icon(iconStudyDBSubj.gif)>>). * Right-click on the Subject01 > '''Review raw file''': * Select the file format: '''MEG/EEG: CTF(*.ds; *.meg4; *.res4)''' |
Line 85: | Line 67: |
A new folder is now created in Brainstorm's database explorer and contains: * '''SubjectCMC''': a folder that provides access to the MEG dataset. Note the "RAW" tag over the icon of the folder, indicating the files contain unprocessed, continuous data. * '''CTF channels (191)''': a node containing '''channel information''' with all channel types, names locations, etc. The number of channels available (MEG, EMG, EOG etc.) is indicated between parentheses''' (here, 191'''). * '''Link to raw file''' provides access to '''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's 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]]). |
* 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]]). |
Line 93: | Line 73: |
=== Display MEG helmet and sensors === * Right-click on the '''CTF channels (191)''' node, then select '''''Display sensors > CTF helmet''''' from the contextual menu and '''''Display sensors > MEG. '''''This will open a new display window showing the inner surface of the MEG helmet, and the lo MEG sensors respectively. Try [[Tutorials/ChannelFile#Display_the_sensors|additional display menus]]. . {{attachment:helmet_sensors.png}} === Reviewing continuous recordings === * Right-click on the '''Link to raw file''' node, then '''''Switch epoched/continuous''''' to convert the file to '''continuous''', a technical detail proper to CTF file formatting. * Right-click again on the '''Link to raw file''' node, then '''''MEG > Display time series''''' (or double-click on the node). 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]]). * We will also display EMG traces by right-clicking on the '''Link to raw file''' node, then '''''EMG > Display time series'''''. |
=== 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 === * 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'''. |
Line 106: | Line 85: |
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'''''. From the options of the '''Read from channel''' process window, set '''Event channels''' = `Stim`, select '''Value''', and click '''Run'''. . {{attachment:read_evnt_ch.png}} This procedure 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 how each of the 25 left-wrist trials had been encoded in the study. We will now delete other events of no interest, and merge the left trial events under a single event category, for convenience. * Delete other events: select the events to delete in the event box/list with '''Ctrl+click''', then in the menu '''''Events > Delete group''''' and confirm. Alternatively, you can selected all events with '''Ctrl+A''' and deselect the '''U1''' to '''U25''' events by clicking on them. * To make sure we reproduce FieldTrip's tutorial, we need to reject trial #7: Select events '''U1''' to '''U6''' and '''U8''' to '''U25''', then from the '''Events '''menu, select''' Merge group''' and type ina new label ('''Left''') to describe this is the left-wrist condition. . {{attachment:left_24.png}} These events correspond to the beginning of 10-s trials of left-wrist movements. We will compute coherence over 1-s epochs over the first 8 s of each trial. To that purpose, we will now create extra events to define these epochs. * Duplicate 7 times the '''Left''' events by selecting '''''Duplicate group''''' in the '''''Events''''' menu. The groups '''Left_02''' to '''Left_08''' will be created. * For each copy of the '''Left''' events, we will add a time offset of 1 s for '''Left02''', 2 s for '''Left03''', and so on. Select the '''Left '''event group to add a 1,000 ms time offset, by going to the menu '''''Events > Add time offset'', '''enter 1,000 in the text box. Repeat for each other group, entering 2,000, then 3,000 etc. . {{attachment:dup_offset.png}} * Once done for '''Left_08''', merge all these '''Left*''' events into a single '''Left '''category, and select '''''Save modifications''''' in the '''''File''''' menu in the '''''Record''''' tab. . {{attachment:left_192.png}} {{{#!wiki comment === Keep relevant recordings === As only data for the left wrist will be analyzed, we will import only the first '''330 s''' of the original file and rewrite that segment as a binary continuous file, a raw file. This will help to optimize computation times and memory usage. * In the Process1 box: Drag and drop the '''Link to raw file''' node inside '''SubjectCMC'''. * Run process '''Import > Import recordings > Import MEG/EEG: Time''':<<BR>> * '''Subject name'''=`Subject01`, '''Condition name'''= `Left`, '''Time window'''=`0.0 - 330.0 s`, '''Split recordings'''=`0`, and check the three remaining options.<<BR>> . {{attachment:import330_process.png||width="50%"}} * Right-click on the '''Raw(0.00s,330.00s)''' node inside the newly created '''Left''' condition and select '''Review as raw'''. This will crate the condition '''block001''' with the link to the created raw file. . {{attachment:review_as_raw.png||width="50%"}} * To avoid any confusion later, delete the conditions '''SubjectCMC''' (which is a link to the original file), and the condition '''Left'''. Select both folders containing and press Delete (or right-click '''File > Delete'''). }}} == Pre-process == |
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, Reject events shorter than 12 samples. Click '''Run'''. . . {{attachment:read_evnt_ch.gif}} * The rejection of short events is nececessary in this dataset, because in the STIM channel the transitions between values span sometimes over multiple samples. As an example, if we were not rejecting short events, an event U1 would be created at 121.76s because the transition from the event U1025 back to zero has two unwanted values at the end of the event. The rejection criteria is set to 12 samples (= 10ms at 1200Hz), because the duration of all the triggers we are interested in is longer than 15ms. This value has to be adjusted carefully for each acquisition setup.<<BR>><<BR>> {{attachment:triggers_min_duration.gif}} * 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-processing == |
Line 149: | Line 105: |
Another idiosyncrasy of the present dataset is that the CTF MEG data were saved without the desired 3-rd order gradient compensation for optimal denoising. We will now apply this compensation as follows: * In the '''''Process1''''' box: Drag and drop the '''Link to raw file''' node. * Run process '''''Artifacts > Apply SSP & CTF compensation''''':<<BR>> . {{attachment:pro_ctf_compensation.png||width="50%"}} This process creates the '''SubjectCMC_clean''' folder that contains a copy of the '''channel file''' and a link to the raw file '''Raw | clean''', which points to the original data and to the fact that the 3-rd order gradient compensation will be applied. Brainstorm does not create a physical copy of the actual, large dataset at this stage. . {{attachment:tre_raw_clean.png||width="40%"}} === Removal of power line artifacts === We will start with identifying the spectral components of power line contamination of MEG and EMG recordings. * In the '''''Process1''''' box: Drag and drop the '''Raw | clean''' node. |
=== Power line artifacts === * In the Process1 box: Drag and drop the '''Link to raw file'''. |
Line 165: | Line 108: |
* '''Time window''': `0 - 330 s` * '''Window length='''`10 s` * '''Overlap'''=`50%` * '''Sensor types'''=`MEG, EMG . {{attachment:pro_psd.png||width="50%"}} * Double-click on the new '''PSD''' file to visualize the power spectrum density of the data.<<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>> |
Line 175: | Line 118: |
* The PSD plot shows two groups of sensors: EMG (highlighted in red above) and the MEG spectra below. Peaks at 50Hz and harmonics (150, 200Hz and above; European power line main and harmonics) are clearly visible. We will use notch filters to attenuate power line contaminants at 50, 150 and 200 Hz. * In the '''''Process1''''' box: Drag and drop the '''Raw | clean''' node. * Run the process '''''Pre-processing > Notch filter''''' with: <<BR>> * '''Sensor types''' = `MEG, EMG` * '''Frequencies to remove (Hz)''' = `50, 100, 150` . {{attachment:pro_notch.png||width="50%"}} A new '''raw''' 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. |
* 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>> |
Line 188: | Line 132: |
=== EMG pre-processing === | === EMG: Filter and rectify === |
Line 191: | Line 135: |
* In the '''''Process1''''' box: drag and drop the '''Raw | notch(50Hz 100Hz 150Hz)''' node. * Add the process '''''Pre-process > Band-pass filter''''' |
* In the Process1 box: drag and drop the '''Raw | notch(50Hz 100Hz 150Hz)''' node. * Add the process '''Pre-process > Band-pass filter''' |
Line 197: | Line 141: |
* Add the process '''''Pre-process > Absolute values''''' | * Add the process '''Pre-process > Absolute values''' |
Line 204: | Line 148: |
Two new folders '''SubjectCMC_clean_notch_high''' and '''SubjectCMC_clean_notch_high_abs''' are added to Brainstorm's database explorer. We can now safely delete folders that are not needed anymore: * Delete '''SubjectCMC_clean_notch''' and '''SubjectCMC_clean_notch_high '''by selecting both before pressing Delete (or right-click '''''File > Delete'''''). === MEG pre-processing === We need to remove more artifacts from the MEG traces via the: 1. '''Detection and removal of stereotypical artifacts with SSP''' 1. '''Detection of noisy (bad) data segments.''' ==== Detection and removal of artifacts with SSP (Signal Space Projection) ==== Stereotypical artifacts such eye blinks and heartbeats can be identified from their respective characteristic spatial distributions. Their contaminationn 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. * Display the MEG and EOG time series: Right-click on the pre-processed (for EMG) continuous file '''Raw | clean | notch(...''' (in the '''SubjectCMC_clean_notch_high_abs''' folder) then '''''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: |
* 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: Blink SSP and bad segments === 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. ==== Blink correction with SSP ==== * Right-click on the pre-processed file > '''MEG > Display time series''' and '''EOG > Display time series'''. * In the Record tab: '''Artifacts > Detect eye blinks''', and use the parameters: |
Line 225: | Line 161: |
. {{attachment:detect_blink_process.png||width="50%"}} | . {{attachment:detect_blink_process.png||width="60%"}} |
Line 231: | Line 167: |
* To [[Tutorials/ArtifactsSsp|remove blink artifacts with SSP]] go to '''''Artifacts > SSP: Eye blinks''''', and use the parameters: | * To [[Tutorials/ArtifactsSsp|remove blink artifacts with SSP]], go to '''Artifacts > SSP: Eye blinks''': |
Line 234: | Line 170: |
* Check '''Compute using existing SSP/ICA projectors''' . {{attachment:ssp_blink_process.png||width="50%"}} * 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_process.png||width="60%"}} * Display the time series and topographies of the first two SSP components identified. In the present case, only the first SSP component can be clearly related to blinks: percentage between brackets much higher than the others, typical spatial topography, time series highly correlated with the EOG signal. Select only '''component #1''' for removal. |
Line 242: | Line 177: |
* 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 to unselect 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 crosshair at the top right of the main Brainstorm window to close all visualization windows. ==== Detection of "bad" data segments: ==== |
* The second SSP component could be related with other ocular artifacts. For a more precise characterization of this artifact, it could be better indicated to use the other events detected on the EOG (blink2 and blink3). We will not do this here because advanced SSP cleaning is not the main topic of this tutorial. * Close all figures: Click on the large '''×''' at the top-right of the main Brainstorm window. ==== Detection of "bad" data segments ==== |
Line 255: | Line 184: |
* Display the MEG and EOG time series. In the '''''Record''''' tab, select '''''Artifacts > Detect other artifacts''''' and enter the following parameters: | * Display the MEG and EOG time series. In the '''Record''' tab, select '''Artifacts > Detect other artifacts''' and enter the following parameters: |
Line 261: | Line 190: |
. {{attachment:detect_other.png||width="50%"}} 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, which 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:detect_other.png||width="60%"}} * We encourage users to review all the segments marked using this procedure. In the present case, all the segments detected clearly point at artifacts. * Select the '''1-7Hz''' and '''40-240Hz''' event groups and select '''Events > Mark group as bad'''. Alternatively, you can add the prefix '''bad_''' to the event names. Brainstorm will automatically discard these data segments from further processing. |
Line 271: | Line 200: |
== 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. * Right-click on the filtered continuous file '''Raw | clean | notch(...''' (in the '''SubjectCMC_clean_notch_high_abs''' condition), then '''''Import in database'''''. . {{attachment:import_menu.png||width="40%"}} * Enter the following parameter values: |
== Epoching == 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. As mentioned previously, we will focus on the '''Left''' category of events (left wrist movements). To follow the same pipeline as the [[https://www.fieldtriptoolbox.org/tutorial/coherence/|FieldTrip tutorial]]: we will consider 8 seconds of recordings after each trigger (out of the 10s of each trial), and split them in epochs of 1 second. In addition DC offset is removed, only for MEG signals. * In the Process1 box: Drag-and-drop the pre-processed file. * Select the process '''Import > Import recordings > Import MEG/EEG: Events''': * '''Subject name''' = `Subject01` * '''Folder name''' = empty * '''Event names''' = `Left` |
Line 280: | Line 210: |
* Check '''Use events''' and highlight the '''Left(x192)''' event group * '''Epoch time''' = `0 - 1000 ms` * Check '''Apply SSP/ICA projectors''' * Check '''Remove DC offset''' and select '''All recordings''' . {{attachment:import_options.png||width="80%"}} A new folder '''SubjectCMC_clean_notch_high_abs''' is created for '''Subject01'''. It contains a copy of the '''channel file''' from the original raw file, and individual trials tagged as '''Left '''in a new trial group. Expand the trial group and note there are trials marked with a question mark in a red circle (ICON). These indicate trials that occurred in the '''bad''' segments identified in the previous section. All the bad trials are automatically ignored for further processing, whenever dropped into the '''''Process1''''' and '''''Process2''''' tabs. |
* '''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''': * '''Baseline''' = `All file` * '''Sensor types''' = `MEG` * Run the pipeline || {{attachment:pro_import.png}} || || {{attachment:pro_remove_dc.png}} || * A new folder '''SubjectCMC_notch_high_abs''' without the 'raw' indication is created, including '''192 epochs''' (24 trials x 8 epochs each). The epochs overlapping with a "bad" event are marked as bad and identified with an exclamation mark in a red circle (<<Icon(iconModifBad.gif)>>). The bad epochs will be automatically ignored by the '''Process1''' and '''Process2''' tabs, and therefore excluded from further processing. |
Line 291: | Line 230: |
== Coherence estimation (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. Note that the number between square brackets is '''[185]''', as the 7 '''bad''' trials will be ignored by the MSC process. |
==== Comparison with FieldTrip ==== The figures below represent the EMG and MRC21 channels (sensor over the left motor-cortex) from the epoch #1.1, in Brainstorm (left) and in the [[https://www.fieldtriptoolbox.org/tutorial/coherence/|FieldTrip tutorial]] (right). {{attachment:bst_ft_trial1.png||width="100%"}} == Coherence: EMG x MEG == Let's compute the '''magnitude square coherence (MSC)''' between the '''left EMG''' and the '''MEG''' channels. * In the Process1 box, drag and drop the '''Left (192 files)''' trial group. |
Line 297: | Line 241: |
* Run the process '''''Connectivity > Coherence 1xN [2021]''''' with the following parameters: * '''Time window''' = `0 - 1000 ms` or check '''All file''' |
* Select the process '''Connectivity > Coherence 1xN [2021]''': * '''Time window''' = '''All file'''<<BR>>The imported epochs have different times (e.g. Left#1.1: 0-1s, Left#1.2: 1-2s, Left#1.8: 7-8s), but the process offers by default only the time window of the first file, which would fail reading the next files will fail. Selecting "All file" ensures that the entire time window is read for each epoch. |
Line 306: | Line 250: |
* More details on the '''Coherence''' process can be found in the [[connectivity tutorial]]. . {{attachment:coh_meg_emgleft.png||width="40%"}} * Double-click on the resulting node '''mscohere(0.6Hz,555win): EMGlft''' 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)`. |
* 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 the selected sensor 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)`. |
Line 316: | Line 267: |
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''' node, and add the process '''''Frequency > Group in time or frequency bands''''' with the parameters: * Select '''Group by frequency''' |
* We can now average magnitude of the MSC over the beta band (15-20 Hz). <<BR>>In the Process1 box, select the new '''mscohere''' file. * Run process '''Frequency > Group in time or frequency bands''': * Select '''Group by frequency bands''' |
Line 322: | Line 272: |
. {{attachment:pro_group_freq.png||width="40%"}} The resulting file '''mscohere(0.6Hz,555win): EMGlft | 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. In the next sections we will perform source estimation and compute coherence across the entire brain volume. == MEG source imaging == We will perform source modelling using a [[Tutorials/HeadModel#Dipole_fitting_vs_distributed_models|distributed model]] approach for two possible source maps:the '''cortex surface''' and the entire '''MRI volume'''. SB: I thought we had said above the cortical surface was too crappy for cortical source modelling. For the cortical source model, the locations of the sources are constrained to the cortical surface obtained from the participants anatomical MRI, as imported above. For MRI violume approach, elementary sources are uniformly distributed across the entire brain volume. Before estimating the brain sources, we need to derive a '''head model''' and estimate the '''noise covariance '''of the recordings. Note that a distinct head model is required for each source space tested here (cortical vs. volume). === Head modelling === The head model accounts for how neural electrical currents produce magnetic fields captured by sensors outside the head, considering head tissues electromagnetic properties and geometry, independently of actual empirical measurements. Please refer to the [[Tutorials/HeadModel|head model tutorial]] for more in-depth explanations. '''Cortical surface''' * In the '''SubjectCMC_clean_notch_high_abs '''node, right-click over '''CTF channels (191)''' and select '''Compute head model '''from the contextual menu. Run the process with the default options as indicated below: |
. {{attachment:pro_group_freq.png||width="60%"}} * The resulting file '''mscohere...|tfbands''' has only one MSC value for each sensor (the MSC average in the 15-20 Hz band). Right-click on the file to display a 2D or 3D topography. <<BR>><<BR>> {{attachment:res_coh_tfgroup.gif}} * 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]] is difficult to interpret. In the rest of this tutorial, we will compute coherence at the source level. == Source estimation == === MRI segmentation === In order to estimate the brain sources for these MEG recordings, we first need to reconstruct the cortex surface from the T1 MRI imported at the beginning of this tutorial. For this puropose, we decided to use [[https://neuroimage.usc.edu/brainstorm/Tutorials/SegCAT12|CAT12]] because it is fast (30-60min) and fully integrated with Brainstorm as a plugin. * Switch back to the Anatomy view of the protocol (<<Icon(iconSubjectDB.gif)>>). * Right-click on the MRI (<<Icon(iconMri.gif)>>) > '''MRI segmentation > CAT12''': * '''Number of vertices'''{{{: }}}`15000` * '''Anatomical parcellations''': `Yes` * '''Cortical maps''': {{{No}}} . {{attachment:cat12.png||width="100%"}} * Keep the low-resolution central surface selected as the default cortex ('''central_15002V'''). This surface is the primary output of CAT12, and is located half-way between the pial envelope and the grey-white interface ([[https://neuroimage.usc.edu/brainstorm/Tutorials/SegCAT12|more information]]). The head surface was recomputed during the process, you now have two identical head surfaces: you can either delete one or simply ignore this detail. * For quality control, double-click on the head and central_15002V surfaces to display them.<<BR>><<BR>> {{attachment:cat12_files.gif}} === Head models === We will perform source modeling using a [[Tutorials/HeadModel#Dipole_fitting_vs_distributed_models|distributed model]] approach for two different source spaces: the '''cortex surface''' and the entire '''MRI volume'''. The forward model, labelled ''head model'' in Brainstorm, accounts for how neural electrical currents produce magnetic fields captured by sensors outside the head, considering head tissues electromagnetic properties and geometry, independently of actual empirical measurements ([[http://neuroimage.usc.edu/brainstorm/Tutorials/HeadModel|more information]]). As the head model depends on the source space, a distinct head model is required for the surface and volume source spaces: we will compute them both now. ==== Surface ==== * Go back to the '''Functional data''' view of the database. * Right-click on the channel file of the imported epochs folder > '''Compute head model'''. |
Line 345: | Line 300: |
* '''Forward model''' = `Overlapping spheres`. The cortical head model will be derived from each of the 10,000 sources (surface vertices) as defined when when the subject anatomy was imported. . {{attachment:pro_head_model_srf.png||width="40%"}} The (ICON) '''Overlapping spheres (surface)''' head model now appears in the database explorer. ==== MRI volume source model ==== * In the '''SubjectCMC_clean_notch_high_abs '''node, right-click over the '''CTF channels (191)''' node and select '''''Compute head model'''''. Keep all default options: |
* '''Forward model''' = `MEG Overlapping spheres`. . {{attachment:pro_head_model_srf.gif}} ==== Volume ==== * Right-click on the channel file again > '''Compute head model'''. |
Line 358: | Line 309: |
. {{attachment:pro_head_model_vol.png||width="40%"}} * In the '''Volume source grid''' window, specify the following parameters that will produce about '''12,200''' elementary source grid points across the brain volume. |
|
Line 365: | Line 312: |
. {{attachment:pro_grid_vol.png||width="50%"}} The '''Overlapping spheres (volume)''' node 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 surface node immediately above.) . {{attachment:tre_head_models.png||width="50%"}} |
. {{attachment:pro_head_model_vol.gif}} * 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 double clicking on a different head model. . {{attachment:tre_head_models.gif}} |
Line 372: | Line 319: |
Basic noise statistics can be extracted (as [[Tutorials/NoiseCovariance#The_case_of_MEG|recommended]]) from empty-room recordings. However, these latter are not available from the present tutorial data. However, we will assume that data segments prior to wrist extension 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 30 s` * Select the '''Block by block''' option. . {{attachment:pro_noise_cov.png||width="60%"}} * Lastly, copy the '''Noise covariance''' node to the '''SubjectCMC_clean_notch_high_abs''' folder along with the head model. This can be done using the shortcuts `Ctrl-C` and `Ctrl-V`. . {{attachment:tre_covmat.png||width="40%"}} === Source estimation === Now that the '''head model(s)''' and '''noise covariance''' are available, we will use the [[Tutorials/SourceEstimation#Method|minimum-norm imaging]] approach to solve the so-called '''inverse problem '''of source estimation. This will produce a large matrix called the '''imaging kernel''', that will be multiplied to the sensor data, to produce estimates of brain source 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. ==== Cortical surface ==== * To compute the corresponding imaging kernel, right-click over the '''Overlapping spheres (surface)''' head model and select '''Compute sources [2018]. '''Enter the following parameters: |
The [[Tutorials/NoiseCovariance#The_case_of_MEG|recommendation for MEG]] is to extract basic noise statistics from empty-room recordings. When not available, resting-state data can be used as proxies for MEG noise covariance. We will use a segment of the MEG recordings, away from the task or major artifacts: '''18s-29s'''. * Right-click on the clean continuous file > '''Noise covariance > Compute from recordings'''.<<BR>><<BR>> {{attachment:pro_noise_cov.gif}} * Right-click on the Noise covariance (<<Icon(iconNoiseCov.gif)>>) > '''Copy to other folders'''.<<BR>><<BR>> {{attachment:tre_covmat.gif}} === Inverse models === We will now compute three inverse models, with different source spaces: cortex surface with '''constrained''' (normal to the cortex) dipole orientations, cortex surface with '''unconstrained''' orientation, and MRI '''volume''' ([[Tutorials/SourceEstimation|more information]]). ==== Surface ==== * Right-click on '''Overlapping spheres (surface)''' > '''Compute sources''': |
Line 391: | Line 332: |
* '''Unconstrained''' | * '''Constrained: Normal to the cortex''' |
Line 394: | Line 335: |
. {{attachment:pro_sources_srf.png||width="40%"}} The inversion kernel (ICON) '''MN: MEG (surface)(Unconstr) 2018''' is now available in the database explorer. ==== MRI volume ==== * Compute the corresponding imaging kernel by right-clicking over the '''Overlapping spheres (volume)''' head model and select '''Compute sources [2018], '''with the following parameters: * '''Minimum norm imaging''' |
* Repeat the previous step, but this time select '''Unconstrained''' in the Dipole orientations field. || {{attachment:pro_sources_srfc.png}} || || {{attachment:pro_sources_srfu.png}} || ==== Volume ==== * Right-click on the '''Overlapping spheres (volume)''' > '''Compute sources:''' |
Line 407: | Line 348: |
The imaging kernel (ICON) '''MN: MEG (volume)(Unconstr) 2018''' is now also available in the database explorer. Note that now each trial is associated with '''two''' source link (ICON) nodes. One corresponds to the '''MN: MEG (surface)(Unconstr) 2018''' kernel and the other to the '''MN: MEG (volume)(Unconstr) 2018''' kernel. . {{attachment:gui_inverse_kernel.png||width="60%"}} === Defining "scouts" (regions of interest) === To contain computational cost, we will now restrict the computation of coherence with the left EMG signal to selected MEG source activity. We will define regions of interest, whic are known as '''scouts '''in Brainstorm. They can be defined as [[Tutorials/Scouts|surface]]or [[Tutorials/TutVolSource#Volume_scouts|volume scouts]]. ==== Surface scouts ==== * Richt click over '''MN: MEG (surface)(Unconstr) 2018''' for one of the trials and select '''''Cortical activations > Display on cortex'''''. In the '''''Surface''''' tab, set the '''''Amplitude''''' slider to `100%` to hide all the sources. . {{attachment:fig_sources_srf.png||width="100%"}} * In the '''''Scout''''' tab, select from the menu '''''Atlas > From subject anatomy > AAL3 (MNI-linear)'''''. This will create the '''From volume: AAL3''' set of surface scouts. After you click on any scout label shown in the list, Brainstorm will show at the bottom the number of sources (vertices) within the region and an estimate of its surface area in cm2. Activate the (ICON) '''Show only the selected scouts''' option to shown only the scout(s) you have selected from the list. . {{attachment:fig_scouts_srf.png||width="90%"}} |
* Three imaging kernels (<<Icon(iconResultKernel.gif)>>) are now available in the database explorer. Note that each trial is associated with three source links (<<Icon(iconResultLink.gif)>>). . {{attachment:tre_sources.gif}} == Coherence: EMG x Sources == We can now compute the coherence between the EMG signal and the brain source time series, for each of the source models. Let's start with the '''surface/constrained''' model. * 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 parameters as shown below, and click on '''Search'''. . {{attachment:gui_search_srf.png||width="70%"}} * It creates a new tab in the database explorer, showing only the files that match the criteria. . {{attachment:tre_search_srf.gif}} * Click the '''Process2''' tab at the bottom of the main Brainstorm window. * '''Files A''': Drag-and-drop the '''Left (192 files)''' group, select '''Process recordings''' (<<Icon(iconEegList.gif)>>). * '''Files B''': Drag-and-drop the '''Left (192 files)''' group, select '''Process sources''' (<<Icon(iconResultList.gif)>>). * Objective: Extract from the same files the EMG recordings (Files A) and the sources time series (Files B), then compute coherence between these two sets. Note that the blue labels over the file lists indicate that there are 185 "good" files (7 bad epochs). . {{attachment:process2.png||width="80%"}} * Select the process '''Connectivity > Coherence AxB [2021]''': * '''Time window''' = '''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''': * '''Tag to add''' = `(surface)(Constr)` * Select '''Add to file name''' * Run the pipeline || {{attachment:pro_coh_srf.png}} || || {{attachment:pro_coh_srf2.png}} || * Repeat the steps above to compute the EMG-sources coherence for the other source models: '''surface/unconstrained''' and '''volume''': * Edit the search criteria: Right-click on the search tab > '''Edit search'''. * It updates automatically the file selection in the Process2 tab. * Select the processes: Do not forget to select again '''All file''' and update the '''file tag'''. * Close the search tab. If you don't see the 3 new connectivity files <<Icon(iconConnect1.gif)>>) in the database explorer: refresh it, by pressing '''[F5]''' or clicking again on the selected button "Functional data". <<BR>><<BR>> {{attachment:tre_coh_src_files.gif}} === Surface === Double-click the 1xN connectivity files for the two '''(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. * In the '''Surface''' tab: Smooth=30%, Amplitude=0%. * To compare visually different cortex maps, set manually the [[Tutorials/Colormaps|colormap]] range (e.g.`[0 - 0.07])` * Explore with coherence spectra with the '''frequency slider''' * The highest coherence value is located at '''14.65 Hz''', in the '''right primary motor cortex''' (precentral gyrus). To observe the coherence spectrum at a given location: right-click on the cortex > '''Source: Power spectrum'''. <<BR>><<BR>> {{attachment:res_coh_surf.gif}} * The analysis using constrained (top) and unconstrained (bottom) orientations agree in the location and frequency of the peak coherence. The main difference between these results is that unconstrained sources appear smoother, due to maximum aggregation performed across directions, explained later. These results agree with our hypothesis, previous results in the literature, and the results presented in the [[https://www.fieldtriptoolbox.org/tutorial/coherence/|FieldTrip tutorial]]. * To get the 3D coordinates of the peak: right-click on the figure > '''Get coordinates'''. Then click on the right motor cortex with the crosshair cursor that appears. These coordinates can be useful to compare with the volume results. <<BR>><<BR>> {{attachment:res_get_coordinates.gif}} === Volume === * Double-click the 1xN connectivity file for the '''(volume)''' source space. * Go to 14.65 Hz, set the data transparency to 20% (Surface tab). * Find the peak by navigating in the volume, or using the coordinates from the surface results. * Right-click on the figure > Anatomical atlas > None. This will show the coherence value under the cursor at the top-right corner, instead of an anatomical label. <<BR>><<BR>> {{attachment:res_coh_vol.gif}} === Method === 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 a 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''' or '''volume''' 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. To be represented on the cortex, these three values need to be '''flattened''' into one, resulting in one coherence spectrum per vertex. For performing this dimension reduction, we decided to take the '''maximum '''across three directions, 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%"}}]] |
Line 426: | Line 427: |
[TODO] A note, that the definition of scouts is far from perfect, but can give us a good idea of the surface projections of the MNI parcellations (described in the importing anatomy section). | 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. 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 found detrimental effects on the expected results. |
Line 428: | Line 434: |
* Close the figure. ==== Volume scouts ==== * Right click over '''MN: MEG (volume)(Unconstr) 2018''' for one of the trials and select '''''Cortical activations > Display on MRI (3D): Subject CMC'''''. In the '''''Surface''''' tab, set the '''''Amplitude''''' slider to `100%` to hide all the source map. . {{attachment:fig_sources_vol.png||width="100%"}} * In the '''''Scout''''' tab, select the menu '''''Atlas > From subject anatomy > AAL3 (MNI-linear)'''''. This will create a set of '''Volume 12203: AAL3''' volumic scouts. As with the surface scouts above, clicking on a scout in the list will show the number of elementary sources withinand its volume in cm3. Activate the (ICON) '''Show only the selected scouts''' option to show only the selected scout(s). . {{attachment:fig_scouts_vol.png||width="90%"}} * Close the figure. == Estimating source-wise coherence == === Surface scouts === We will use the [[Tutorials/PipelineEditor#Search_Database|search features of the Brainstorm database]] to select the source maps we want to include in the EMG-cortex coherence estimation. We will first select files related to the '''MN: MEG (surface)(Unconstr) 2018''' imaging kernel. * Click on the magnifying glass (ICON) above the database explorer to open the database search panel, and select '''''New search'''''. * Set the search parameters as shown below: . {{attachment:gui_search_srf.png||width="70%"}} After pressing '''Search''', a new tab called '''''(surface)''''' appears in the database explorer. This new tab contains the data filtered through the search query above. . {{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''' for Files A, and '''Process sources''' for Files B. The logic is that we will extract from the same files the EMG traces (Files A) and the source time series (Files B) 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. |
== Coherence: EMG x Scouts == 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) at 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 ('''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. This option computes the coherence between the EMG and 45000 source signals, instead of a handful of times with the "before" option. The computation is therefore much longer and demanding in terms of RAM memory. [[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%"}}]] 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]]. * In the Process2: '''Left '''trial group into both 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. |
Line 465: | Line 460: |
* Select `From volume: AAL3` in the drop-down list (these are surface scouts) * Select all the scouts (shortcut `Ctrl-A`) * '''Scout function''' = `Mean` * '''When to apply''' = `Before` |
* From the menu at the right, select '''Schaefer_100_17net''' * Select all the scouts * '''Scout function''': `Mean` * '''When to apply the scout function''': `Before` |
Line 476: | Line 471: |
* '''Tag to add''' = `(surface)` | * '''Tag to add''' = `(surface)(Constr)` |
Line 481: | Line 476: |
. {{attachment:pro_coh_srf.png||width="100%"}} * Double-click on the resulting node '''mscohere(0.6Hz,555win): Left (#1) | (surface)''' to display the coherence spectra. Open also the result node as an image with '''Display image''' from its contextual menu. * To visualize the location of the scouts on the cortex, double-click one of the (surface) source links for any of the trials. In the '''Surface''' tab, set the '''Amplitude''' threshold to `100%` to hide the cortical activations. Lastly, in the '''Scouts''' tab, select the `From volume: AAL3` atlas in the drop-down list, select '''Show only the selected scouts''' and the '''Show/hide the scout labels'''. Note that all visualization windows are linked depending on which scout is selected in the '''image''' representation of the coherence results. . {{attachment:res_coh_srf.png||width="100%"}} The large peak at 14.65 Hz in the coherence spectra corresponds to the '''Precentral R''' scout, which encompasses the right primary motor cortex, as expected. === Volume scouts === We will repeat the same approach Similar for volume scouts. Iniate a file selection query related to the '''MN: MEG (volume)(Unconstr) 2018''' imaging kernel. * Click on the magnifying glass (ICON) above the database explorer to open the search panel, with the following specifications: . {{attachment:gui_search_vol.png||width="70%"}} . {{attachment:tre_search_vol.png||width="40%"}} * In the '''Process2''' tab, drag and drop the '''Left (192 files)''' trial group into the '''Files A '''box and repeat for the '''Files B''' box. Select the '''Process recordings''' icon for Files A, and '''Process sources''' for Files B. . {{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)''' * Select `Volume 12203: AAL3` in the drop-down list (these are volume scouts) * Select all the scouts (shortcut `Ctrl-A`) * '''Scout function''' = `Mean` * '''When to apply''' = `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)` * Select '''Add to file name''' * Run the pipeline . {{attachment:pro_coh_vol.png||width="100%"}} * Double-click on the resulting node '''mscohere(0.6Hz,555win): Left (#1) | (volume)''' to display the coherence spectra. Open also the result node by selecting '''Display as image''' from its contextual menu. * Open one of the (volume) source links for any of the trials by selecting from the contextual menu '''''Display cortical activations > Display on MRI (3D): SubjectCMC '''''. In the '''Surface''' tab, set the '''Amplitude''' threshold to `100%` to hide all the cortical activations. Lastly, in the '''Scouts''' tab, select the `Volume 12203: AAL3` atlas in the drop-down list, select the '''Show only the selected scouts''' and the '''Show/hide the scout labels'''. . {{attachment:res_coh_vol.png||width="100%"}} Here too, the coherence peak at 14.65 Hz corresponds to the '''Precentral R''' scout, which encompasses the right primary motor cortex, as expected. <<TAG(Advanced)>> == Brain-wise coherence estimation (no scouts) == |
|| {{attachment:pro_coh_srfc_bef_sct.png}} || || {{attachment:pro_coh_srfc_bef_sct2.png}} || Open the output file 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. |
Line 540: | Line 488: |
* We could downsample the surface and create a more sparse volume grid . OR * Refactor the coherence process to accumulate the auto- and cross-spectra outside of the function . OR }}} === Comparison of cortical surface with FieldTrip and CAT === {{{#!wiki caution '''[TO DISCUSS among authors]''' This image and GIF are just for reference. They were obtained with all the surface sources using FieldTrip and CAT derived surfaces. Comparison for 14.65 Hz {{attachment:ft_vs_cat.png||width="100%"}} Sweeping from 0 to 80 Hz {{attachment:ft_vs_cat.gif||width="80%"}} |
The choice of the optimal parcellation scheme for the source space is not easy, this is still an active field of research. The only recommendation we can give at the moment is to use regions of interest that are small and homogenous in size. |
Line 559: | Line 492: |
== Script == {{{#!wiki caution '''[TO DO]''' Once we agree on all the steps above. }}} |
|
Line 571: | Line 500: |
* 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 572: | Line 503: |
* Tutorial: [[Tutorials/Connectivity|Functional connectivity]] * Tutorial: [[Tutorials/SourceEstimation|Source estimation]] |
|
Line 573: | Line 506: |
* Tutorial: [[Tutorials/Connectivity|Functional connectivity]] ==== Forum discussions ==== {{{#!wiki caution '''[TO DO]''' Find relevant Forum posts. }}} <<HTML(<!-- END-PAGE -->)>> |
* Tutorial: [[Tutorials/Scouts|Scouts]] * Tutorial: [[Tutorials/ConnectivityGraph|Connectivity graphs]] == Scripting == The following script from the Brainstorm distribution reproduces the analysis presented in this tutorial page: [[https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/script/tutorial_coherence.m|brainstorm3/toolbox/script/tutorial_coherence.m]] <<HTML(<div style="border:1px solid black; background-color:#EEEEFF; width:720px; height:500px; overflow:scroll; padding:10px; font-family: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,sans-serif; font-size: 13px; white-space: pre;">)>><<EmbedContent("https://neuroimage.usc.edu/bst/viewcode.php?f=tutorial_coherence.m")>><<HTML(</div >)>> |
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
Dataset description
The dataset is distributed as part of the FieldTrip tutorial Analysis of corticomuscular coherence:
- One participant
- MEG recordings: 151-channel CTF MEG system
- Bipolar EMG recordings: from left and right extensor carpi radialis longus muscles
- EOG recordings: used for detection and attenuation of ocular artifacts
- MRI: 1.5T Siemens system
- Task: The participant 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.
- 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!
Corticomuscular coherence:
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.
- TODO: IMAGE OF EXPERIMENT, SIGNALS and COHERENCE
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
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
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
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, Reject events shorter than 12 samples. Click Run.
The rejection of short events is nececessary in this dataset, because in the STIM channel the transitions between values span sometimes over multiple samples. As an example, if we were not rejecting short events, an event U1 would be created at 121.76s because the transition from the event U1025 back to zero has two unwanted values at the end of the event. The rejection criteria is set to 12 samples (= 10ms at 1200Hz), because the duration of all the triggers we are interested in is longer than 15ms. This value has to be adjusted carefully for each acquisition setup.
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-processing
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.
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: Filter and rectify
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: Blink SSP and bad segments
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.
Blink correction with SSP
Right-click on the pre-processed file > MEG > Display time series and EOG > Display time series.
In the Record tab: 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:
Event name=blink
Sensors=MEG
Display the time series and topographies of the first two SSP components identified. In the present case, only the first SSP component can be clearly related to blinks: percentage between brackets much higher than the others, typical spatial topography, time series highly correlated with the EOG signal. Select only component #1 for removal.
- The second SSP component could be related with other ocular artifacts. For a more precise characterization of this artifact, it could be better indicated to use the other events detected on the EOG (blink2 and blink3). We will not do this here because advanced SSP cleaning is not the main topic of this tutorial.
Close all figures: Click on the large × at the top-right of the main Brainstorm window.
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 all the segments marked using this procedure. In the present case, all the segments detected clearly point at artifacts.
Select the 1-7Hz and 40-240Hz event groups and select Events > Mark group as bad. Alternatively, you can add the prefix bad_ to the event names. Brainstorm will automatically discard these data segments from further processing.
- Close all visualization windows and reply "Yes" to the save the modifications query.
Epoching
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. As mentioned previously, we will focus on the Left category of events (left wrist movements). To follow the same pipeline as the FieldTrip tutorial: we will consider 8 seconds of recordings after each trigger (out of the 10s of each trial), and split them in epochs of 1 second. In addition DC offset is removed, only for MEG signals.
- In the Process1 box: Drag-and-drop the pre-processed file.
Select the process Import > Import recordings > Import MEG/EEG: Events:
Subject name = Subject01
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:
Baseline = All file
Sensor types = MEG
- Run the pipeline
|
|
|
A new folder SubjectCMC_notch_high_abs without the 'raw' indication is created, including 192 epochs (24 trials x 8 epochs each). The epochs overlapping with a "bad" event are marked as bad and identified with an exclamation mark in a red circle (). The bad epochs will be automatically ignored by the Process1 and Process2 tabs, and therefore excluded from further processing.
Comparison with FieldTrip
The figures below represent the EMG and MRC21 channels (sensor over the left motor-cortex) from the epoch #1.1, in Brainstorm (left) and in the FieldTrip tutorial (right).
Coherence: EMG x MEG
Let's compute the magnitude square coherence (MSC) between the left EMG and the MEG channels.
In the Process1 box, drag and drop the Left (192 files) trial group.
Select the process Connectivity > Coherence 1xN [2021]:
Time window = All file
The imported epochs have different times (e.g. Left#1.1: 0-1s, Left#1.2: 1-2s, Left#1.8: 7-8s), but the process offers by default only the time window of the first file, which would fail reading the next files will fail. Selecting "All file" ensures that the entire time window is read for each epoch.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 the selected sensor 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 over the beta band (15-20 Hz).
In the Process1 box, select the new mscohere file.Run process Frequency > Group in time or frequency bands:
Select Group by frequency bands
Type cmc_band / 15, 20 / mean in the text box.
The resulting file mscohere...|tfbands has only one MSC value for each sensor (the MSC average in the 15-20 Hz band). Right-click on the file to display a 2D or 3D topography.
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 is difficult to interpret. In the rest of this tutorial, we will compute coherence at the source level.
Source estimation
MRI segmentation
In order to estimate the brain sources for these MEG recordings, we first need to reconstruct the cortex surface from the T1 MRI imported at the beginning of this tutorial. For this puropose, we decided to use CAT12 because it is fast (30-60min) and fully integrated with Brainstorm as a plugin.
Switch back to the Anatomy view of the protocol ().
Right-click on the MRI () > MRI segmentation > CAT12:
Number of vertices: 15000
Anatomical parcellations: Yes
Cortical maps: No
Keep the low-resolution central surface selected as the default cortex (central_15002V). This surface is the primary output of CAT12, and is located half-way between the pial envelope and the grey-white interface (more information). The head surface was recomputed during the process, you now have two identical head surfaces: you can either delete one or simply ignore this detail.
For quality control, double-click on the head and central_15002V surfaces to display them.
Head models
We will perform source modeling using a distributed model approach for two different source spaces: the cortex surface and the entire MRI volume. The forward model, labelled head model in Brainstorm, accounts for how neural electrical currents produce magnetic fields captured by sensors outside the head, considering head tissues electromagnetic properties and geometry, independently of actual empirical measurements (more information). As the head model depends on the source space, a distinct head model is required for the surface and volume source spaces: we will compute them both now.
Surface
Go back to the Functional data view of the database.
Right-click on the channel file of the imported epochs folder > Compute head model.
Comment = Overlapping spheres (surface)
Source space = Cortex surface
Forward model = MEG Overlapping spheres.
Volume
Right-click on the channel file again > Compute head model.
Comment = Overlapping spheres (volume)
Source space = MRI volume
Forward model = Overlapping spheres.
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 double clicking on a different head model.
Noise covariance
The recommendation for MEG is to extract basic noise statistics from empty-room recordings. When not available, resting-state data can be used as proxies for MEG noise covariance. We will use a segment of the MEG recordings, away from the task or major artifacts: 18s-29s.
Right-click on the clean continuous file > Noise covariance > Compute from recordings.
Right-click on the Noise covariance () > Copy to other folders.
Inverse models
We will now compute three inverse models, with different source spaces: cortex surface with constrained (normal to the cortex) dipole orientations, cortex surface with unconstrained orientation, and MRI volume (more information).
Surface
Right-click on Overlapping spheres (surface) > Compute sources:
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.
|
|
|
Volume
Right-click on the Overlapping spheres (volume) > Compute sources:
Current density map
Unconstrained
Comment = MN: MEG (volume)
Three imaging kernels () are now available in the database explorer. Note that each trial is associated with three source links ().
Coherence: EMG x Sources
We can now compute the coherence between the EMG signal and the brain source time series, for each of the source models. Let's start with the surface/constrained model.
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 parameters as shown below, and click on Search.
- It creates a new tab in the database explorer, showing only the files that match the criteria.
Click the Process2 tab at the bottom of the main Brainstorm window.
Files A: Drag-and-drop the Left (192 files) group, select Process recordings ().
Files B: Drag-and-drop the Left (192 files) group, select Process sources ().
- Objective: Extract from the same files the EMG recordings (Files A) and the sources time series (Files B), then compute coherence between these two sets. Note that the blue labels over the file lists indicate that there are 185 "good" files (7 bad epochs).
Select the process Connectivity > Coherence AxB [2021]:
Time window = 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:
Tag to add = (surface)(Constr)
Select Add to file name
- Run the pipeline
|
|
|
Repeat the steps above to compute the EMG-sources coherence for the other source models: surface/unconstrained and volume:
Edit the search criteria: Right-click on the search tab > Edit search.
- It updates automatically the file selection in the Process2 tab.
Select the processes: Do not forget to select again All file and update the file tag.
Close the search tab. If you don't see the 3 new connectivity files ) in the database explorer: refresh it, by pressing [F5] or clicking again on the selected button "Functional data".
Surface
Double-click the 1xN connectivity files for the two (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.
In the Surface tab: Smooth=30%, Amplitude=0%.
To compare visually different cortex maps, set manually the colormap range (e.g.[0 - 0.07])
Explore with coherence spectra with the frequency slider
The highest coherence value is located at 14.65 Hz, in the right primary motor cortex (precentral gyrus). To observe the coherence spectrum at a given location: right-click on the cortex > Source: Power spectrum.
The analysis using constrained (top) and unconstrained (bottom) orientations agree in the location and frequency of the peak coherence. The main difference between these results is that unconstrained sources appear smoother, due to maximum aggregation performed across directions, explained later. These results agree with our hypothesis, previous results in the literature, and the results presented in the FieldTrip tutorial.
To get the 3D coordinates of the peak: right-click on the figure > Get coordinates. Then click on the right motor cortex with the crosshair cursor that appears. These coordinates can be useful to compare with the volume results.
Volume
Double-click the 1xN connectivity file for the (volume) source space.
- Go to 14.65 Hz, set the data transparency to 20% (Surface tab).
- Find the peak by navigating in the volume, or using the coordinates from the surface results.
Right-click on the figure > Anatomical atlas > None. This will show the coherence value under the cursor at the top-right corner, instead of an anatomical label.
Method
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 a coherence brain map.
In the case of unconstrained or volume 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. To be represented on the cortex, these three values need to be flattened into one, resulting in one coherence spectrum per vertex. For performing this dimension reduction, we decided to take the maximum across three directions, 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. 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 found detrimental effects on the expected results.
Coherence: EMG x Scouts
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) at 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 (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. This option computes the coherence between the EMG and 45000 source signals, instead of a handful of times with the "before" option. The computation is therefore much longer and demanding in terms of RAM memory.
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.
In the Process2: Left trial group into both the Files A and Files B boxes. Select Process recordings () for Files A, and Process sources () for Files B.
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 output file 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, this is still an active field of research. The only recommendation we can give at the moment is to use regions of interest that are small and homogenous in size.
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
Scripting
The following script from the Brainstorm distribution reproduces the analysis presented in this tutorial page: brainstorm3/toolbox/script/tutorial_coherence.m