MEG median nerve tutorial (CTF)

Authors: Francois Tadel, Elizabeth Bock, John C Mosher, Sylvain Baillet

The dataset presented in this tutorial was used in the previous generation of introduction tutorials. We kept it on the website as an additional illustration of data analysis, and as a comparison with median nerve experiments recorded with other MEG systems (Elekta-Neuromag, Yokogawa). No new concepts are presented in this tutorial. For in-depth explanations of the interface and theoretical foundations, please refer to the introduction tutorials.

License

This tutorial dataset (MEG and MRI data) remains a property of the MEG Lab, McConnell Brain Imaging Center, Montreal Neurological Institute, McGill University, Canada. Its use and transfer outside the Brainstorm tutorial, e.g. for research purposes, is prohibited without written consent from the MEG Lab.

If you reference this dataset in your publications, please acknowledge its authors (Elizabeth Bock, Esther Florin, Francois Tadel and Sylvain Baillet) and cite Brainstorm as indicated on the website. For questions, please contact us through the forum.

Presentation of the experiment

Experiment

  • One subject, one acquisition run of 6 minutes
  • Subject stimulated using Digitimer Constant Current Stimulator (model DS7A)
  • The run contains 200 electric stimulations randomly distributed between left and right:
    • 102 stimulations of the left hand
    • 98 stimulations of the right hand
  • Inter-stimulus interval: jittered between [1500, 2000]ms
  • Stimuli generated using PsychToolBox on Windows PC (TTL pulse generated with the parallel port connected to the Digitimer via the rear panel BNC)

MEG acquisition

  • Acquisition at 1200Hz, with a CTF 275 system, subject in seating position

  • Recorded at the Montreal Neurological Institute in November 2011
  • Anti-aliasing low-pass filter at 300Hz, files saved with the 3rd order gradient
  • Recorded channels (302):
    • 1 Stim channel indicating the presentation times of the stimuli: UPPT001 (#1)
    • 26 MEG reference sensors (#3-#28)
    • 272 MEG axial gradiometers (#29-#300)
    • 1 ECG bipolar (#301)
    • 1 vertical EOG bipolar (#302)
    • 1 Unused channels (#2)
  • 1 dataset: subj001_somatosensory_20111109_01_AUX-f.ds

Stimulation delays

  • Delay #1: 4 samples @ 1200Hz = 3.3ms. The CTF MEG system has an anti-aliasing filter (1/4 the sampling rate) applied at the time of recording. This filter is applied only to the MEG channels and not to the stimulus channels. Therefore the MEG has a 4 sample delay when compared with the stimulus channel.

Head shape and fiducial points

  • 3D digitization using a Polhemus Fastrak device (subj00111092011.pos)

  • Position of the anatomical references used for these recordings:
    The position of the CTF head localization coils, pictures available in file fiducials.jpg

  • Around 110 head points distributed on the hard parts of the head (no soft tissues)

Subject anatomy

  • Subject with 1.5T MRI
  • Processed with FreeSurfer 5.2

Download and installation

Import the anatomy

Pre-processing

Evaluate the recordings

Remove: 60Hz and harmonics

Epoching and averaging

Import the recordings

Averaging

Stimulation artifact

Zoom around 4ms. This sharp peak followed by fast oscillations is an artifact due to the electric stimulation device. In the stimulation setup: the stimulus trigger is initiated by the stimulation computer and sent to the electric stimulator. This stimulator generates an electric pulse that is sent to electrodes on the subject's wrists. This electric current flows in the wires and the in the body, so it also generates a small magnetic field that is captured by the MEG sensors. This is what we observe here at 4ms.

There is a 4ms delay before the stimulus is actually received by the subject, due to all the electronics in between, therefore everything is shifted by 4ms in the recordings. These hardware delays are unavoidable and should be quantified precisely before starting scanning subjects or patients. You have two options: either you remember it and subtract the delays when you publish your results, or you fix the files now by changing the time reference in all the files. Let's illustrate this second method now.

Explore the average

Open the time series for the "Avg: left". Then press Control+T, to see on the side a spatial topography at the current time point. Then observe what is happening between 0ms and 100ms.

Source analysis

We need to calculate a source model for these recordings, using a noise covariance matrix calculated from the pre-stimulation baselines. This process is not detailed a lot here because it is very similar to what is shown in the introduction tutorials.

Head model

Noise covariance matrix

Inverse model

Scouts

Place scouts to capture the activity in the primary and secondary somatosensory areas to track the processing of the electric stimulations in time, at the surface surface of the brain. When reviewing the average for the left condition, you can use the following times and thresholds:

Scripting

The following script from the Brainstorm distribution reproduces the analysis presented in this tutorial page: brainstorm3/toolbox/script/tutorial_raw.m

1 function tutorial_raw(tutorial_dir) 2 % TUTORIAL_RAW: Script that reproduces the results of the online tutorials "MEG median nerve (Yokogawa)". 3 % 4 % DESCRIPTION: 5 % It is based on a median nerve stimulation experiment recorded at the Montreal Neurological Institute in 2011 6 % with a CTF MEG 275 system. The sample dataset contains 6 minutes of recordings at 1200Hz for one subject 7 % and includes 100 stimulations of each arm. 8 % 9 % CORRESPONDING ONLINE TUTORIALS: 10 % https://neuroimage.usc.edu/brainstorm/Tutorials/MedianNerveCtf 11 % 12 % INPUTS: 13 % tutorial_dir: Directory where the sample_raw.zip file has been unzipped 14 15 % @============================================================================= 16 % This function is part of the Brainstorm software: 17 % https://neuroimage.usc.edu/brainstorm 18 % 19 % Copyright (c) University of Southern California & McGill University 20 % This software is distributed under the terms of the GNU General Public License 21 % as published by the Free Software Foundation. Further details on the GPLv3 22 % license can be found at http://www.gnu.org/copyleft/gpl.html. 23 % 24 % FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE 25 % UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY 26 % WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF 27 % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY 28 % LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE. 29 % 30 % For more information type "brainstorm license" at command prompt. 31 % =============================================================================@ 32 % 33 % Author: Francois Tadel, 2013-2016 34 35 36 % ===== FILES TO IMPORT ===== 37 % You have to specify the folder in which the tutorial dataset is unzipped 38 if (nargin == 0) || isempty(tutorial_dir) || ~file_exist(tutorial_dir) 39 error('The first argument must be the full path to the tutorial dataset folder.'); 40 end 41 % Build the path of the files to import 42 AnatDir = fullfile(tutorial_dir, 'sample_raw', 'Anatomy'); 43 RawFile = fullfile(tutorial_dir, 'sample_raw', 'Data', 'subj001_somatosensory_20111109_01_AUX-f.ds'); 44 % Check if the folder contains the required files 45 if ~file_exist(RawFile) 46 error(['The folder ' tutorial_dir ' does not contain the folder from the file sample_raw.zip.']); 47 end 48 49 % ===== CREATE PROTOCOL ===== 50 % The protocol name has to be a valid folder name (no spaces, no weird characters...) 51 ProtocolName = 'TutorialRaw'; 52 % Start brainstorm without the GUI 53 if ~brainstorm('status') 54 brainstorm nogui 55 end 56 % Delete existing protocol 57 gui_brainstorm('DeleteProtocol', ProtocolName); 58 % Create new protocol 59 gui_brainstorm('CreateProtocol', ProtocolName, 0, 0); 60 % Start a new report 61 bst_report('Start'); 62 63 64 % ===== ANATOMY ===== 65 % Subject name 66 SubjectName = 'Subject01'; 67 % Process: Import anatomy folder 68 bst_process('CallProcess', 'process_import_anatomy', [], [], ... 69 'subjectname', SubjectName, ... 70 'mrifile', {AnatDir, 'FreeSurfer'}, ... 71 'nvertices', 15000, ... 72 'nas', [127, 212, 123], ... 73 'lpa', [ 55, 124, 119], ... 74 'rpa', [200, 129, 114]); 75 76 % ===== LINK CONTINUOUS FILE ===== 77 % Process: Create link to raw file 78 sFilesRaw = bst_process('CallProcess', 'process_import_data_raw', [], [], ... 79 'subjectname', SubjectName, ... 80 'datafile', {RawFile, 'CTF'}, ... 81 'channelreplace', 1, ... 82 'channelalign', 1); 83 % Process: Snapshot: Sensors/MRI registration 84 bst_process('CallProcess', 'process_snapshot', sFilesRaw, [], ... 85 'target', 1, ... % Sensors/MRI registration 86 'modality', 1, ... % MEG (All) 87 'orient', 1, ... % left 88 'Comment', 'MEG/MRI Registration'); 89 90 91 % ===== REMOVE 60/180/240 Hz ===== 92 % Process: Notch filter: 60Hz 120Hz 180Hz 93 sFilesClean = bst_process('CallProcess', 'process_notch', sFilesRaw, [], ... 94 'freqlist', [60, 120, 180], ... 95 'sensortypes', 'MEG', ... 96 'read_all', 0); 97 98 % Process: Power spectrum density (Welch) 99 sFilesPsd = bst_process('CallProcess', 'process_psd', [sFilesRaw, sFilesClean], [], ... 100 'timewindow', [0, 50], ... 101 'win_length', 4, ... 102 'win_overlap', 50, ... 103 'clusters', {}, ... 104 'sensortypes', 'MEG', ... 105 'edit', struct(... 106 'Comment', 'Power', ... 107 'TimeBands', [], ... 108 'Freqs', [], ... 109 'ClusterFuncTime', 'none', ... 110 'Measure', 'power', ... 111 'Output', 'all', ... 112 'SaveKernel', 0)); 113 114 % Process: Snapshot: Frequency spectrum 115 bst_process('CallProcess', 'process_snapshot', sFilesPsd, [], ... 116 'target', 10, ... % Frequency spectrum 117 'modality', 1, ... % MEG (All) 118 'Comment', 'Power spectrum density'); 119 120 121 % ===== CORRECT BLINKS AND HEARTBEATS ===== 122 % Process: Detect heartbeats 123 sFilesClean = bst_process('CallProcess', 'process_evt_detect_ecg', sFilesClean, [], ... 124 'channelname', 'EEG057', ... 125 'timewindow', [], ... 126 'eventname', 'cardiac'); 127 128 % Process: Detect eye blinks 129 sFilesClean = bst_process('CallProcess', 'process_evt_detect_eog', sFilesClean, [], ... 130 'channelname', 'EEG058', ... 131 'timewindow', [], ... 132 'eventname', 'blink'); 133 134 % Process: Remove simultaneous 135 sFilesClean = bst_process('CallProcess', 'process_evt_remove_simult', sFilesClean, [], ... 136 'remove', 'cardiac', ... 137 'target', 'blink', ... 138 'dt', 0.25, ... 139 'rename', 0); 140 141 % % Process: SSP ECG: cardiac 142 % sFilesClean = bst_process('CallProcess', 'process_ssp_ecg', sFilesClean, [], ... 143 % 'eventname', 'cardiac', ... 144 % 'sensortypes', 'MEG', ... 145 % 'usessp', 1, ... 146 % 'select', []); % Force selection of some components 147 148 % Process: SSP EOG: blink 149 sFilesClean = bst_process('CallProcess', 'process_ssp_eog', sFilesClean, [], ... 150 'eventname', 'blink', ... 151 'sensortypes', 'MEG', ... 152 'usessp', 1, ... 153 'select', 1); % Force selection of some components 154 155 % Process: Snapshot: SSP projectors 156 bst_process('CallProcess', 'process_snapshot', sFilesClean, [], ... 157 'target', 2, ... % SSP projectors 158 'Comment', 'SSP projectors'); 159 160 161 % ===== IMPORT EVENTS ===== 162 % Process: Import MEG/EEG: Events 163 sFilesEpochs = bst_process('CallProcess', 'process_import_data_event', sFilesClean, [], ... 164 'subjectname', SubjectName, ... 165 'condition', '', ... 166 'eventname', 'left, right', ... 167 'timewindow', [], ... 168 'epochtime', [-0.1, 0.3], ... 169 'createcond', 0, ... 170 'ignoreshort', 1, ... 171 'usectfcomp', 1, ... 172 'usessp', 1, ... 173 'freq', [], ... 174 'baseline', [-0.1, 0]); 175 176 % Process: Add time offset: -4.20ms 177 sFilesEpochs = bst_process('CallProcess', 'process_timeoffset', sFilesEpochs, [], ... 178 'offset', -0.0042, ... 179 'overwrite', 1); 180 181 % Process: Average: By condition (subject average) 182 sFilesAvg = bst_process('CallProcess', 'process_average', sFilesEpochs, [], ... 183 'avgtype', 6, ... % By trial groups (subject average) 184 'avg_func', 1, ... % Arithmetic average: mean(x) 185 'keepevents', 0); 186 187 % Process: Snapshot: Recordings time series 188 bst_process('CallProcess', 'process_snapshot', sFilesAvg, [], ... 189 'target', 5, ... % Recordings time series 190 'modality', 1, ... % MEG (All) 191 'Comment', 'Evoked response'); 192 193 194 % ===== SOURCE MODELING ===== 195 % Process: Compute head model 196 bst_process('CallProcess', 'process_headmodel', sFilesAvg, [], ... 197 'comment', '', ... 198 'sourcespace', 1, ... 199 'meg', 3); % Overlapping spheres 200 201 % Process: Compute noise covariance 202 bst_process('CallProcess', 'process_noisecov', sFilesEpochs, [], ... 203 'baseline', [-0.104, -0.005], ... 204 'sensortypes', 'MEG, EEG', ... 205 'target', 1, ... % Noise covariance (covariance over baseline time window) 206 'dcoffset', 1, ... 207 'identity', 0, ... 208 'copycond', 0, ... 209 'copysubj', 0, ... 210 'replacefile', 1); % Replace 211 212 % Process: Snapshot: Noise covariance 213 bst_process('CallProcess', 'process_snapshot', sFilesAvg, [], ... 214 'target', 3, ... % Noise covariance 215 'Comment', 'Noise covariance'); 216 217 % Process: Compute sources 218 sFilesSrcAvg = bst_process('CallProcess', 'process_inverse', sFilesAvg, [], ... 219 'comment', '', ... 220 'method', 2, ... % dSPM 221 'wmne', struct(... 222 'NoiseCov', [], ... 223 'InverseMethod', 'dspm', ... 224 'ChannelTypes', {{}}, ... 225 'SNR', 3, ... 226 'diagnoise', 0, ... 227 'SourceOrient', {{'fixed'}}, ... 228 'loose', 0.2, ... 229 'depth', 1, ... 230 'weightexp', 0.5, ... 231 'weightlimit', 10, ... 232 'regnoise', 1, ... 233 'magreg', 0.1, ... 234 'gradreg', 0.1, ... 235 'eegreg', 0.1, ... 236 'ecogreg', 0.1, ... 237 'seegreg', 0.1, ... 238 'fMRI', [], ... 239 'fMRIthresh', [], ... 240 'fMRIoff', 0.1, ... 241 'pca', 1), ... 242 'sensortypes', 'MEG, MEG MAG, MEG GRAD, EEG', ... 243 'output', 1); % Kernel only: shared 244 245 % Process: Snapshot: Sources (one time) 246 bst_process('CallProcess', 'process_snapshot', sFilesSrcAvg, [], ... 247 'target', 8, ... % Sources (one time) 248 'modality', 1, ... % MEG (All) 249 'orient', 3, ... % top 250 'time', 0.035, ... 251 'Comment', 'Source maps at 35ms'); 252 253 254 255 % Save and display report 256 ReportFile = bst_report('Save', sFilesSrcAvg); 257 bst_report('Open', ReportFile); 258 259 260

Tutorials/MedianNerveCtf (last edited 2016-08-01 21:30:25 by FrancoisTadel)