Yokogawa/KIT tutorial: Median nerve stimulation

Authors: Francois Tadel, Yasuhiro Haruta, Ei-ichi Okumura, Takashi Asakawa

This tutorial introduces some concepts that are specific to the management of MEG/EEG files recorded with Yokogawa/KIT systems in the Brainstorm environment.

Note that the operations used here are not detailed, the goal of this tutorial is not to introduce Brainstorm to new users. For in-depth explanations of the interface and theoretical foundations, please refer to the introduction tutorials.

License

This tutorial dataset (MEG/EEG and MRI data) remains proprietary of Yokogawa Electric Corporation, Japan. Its use and transfer outside the Brainstorm tutorial, e.g. for research purposes, is prohibited without written consent from Yokogawa Electric Corporation.

Description of the experiment

This tutorial is based on a simple median nerve stimulation experiment:

Export recordings from Meg160

To import Yokogawa/KIT data files (.con, .raw, .ave) into Brainstorm, a data export process is required beforehand. The data export function is available in Meg160, which is data analysis software equipped in most of Yokogawa/KIT systems.

The dataset used in this tutorial has already been exported using this procedure. It is described here so that later you can export your own recordings to Brainstorm.

If your software does not support the functions used below, please contact Yokogawa via
http://www.yokogawa.com/me/index.htm

Export the digitizer file

Full head shape in the the digitizer file

In order to realize a precise MRI registration or for warping the default anatomy, you should collect 100 to 200 points describing the entire head shape in addition to the 8 Yokogawa/KIT standard stylus points. To import additional digitized points, follow the instruction below:

Export the recordings

Alternative

Some older versions of the Yokogawa/KIT software do not inlcude this export menu "Third-party export". In this case, you can pass the digitizer information to Brainstorm with three additional files, saved in the same folder as the .sqd file containing the MEG recordings you want to process. The folder must contain one file only for each type of information, therefore you cannot save multiple runs or subjects in the same folder, you must create one subfolder per acquisition run.

Download and installation

Import the anatomy

Access the recordings

Prepare the channel file

Refine the MRI registration

Read the stimulation information

Pre-processing

Evaluate the recordings

Frequency filters

Review the recordings

MEG: Default montages

Pre-defined selections of sensors are available to help reviewing the MEG recordings.

If you don't see all the "KIT..." entries in this list, load them manually:

MEG: Bad channels

EEG: Average reference

Artifacts cleaning with ICA

EEG: Heartbeats and eye movements

MEG: Heartbeats and eye movements

Epoching and averaging

Import the recordings

In this experiment, the electric stimulation is sent with a frequency of 2.8Hz, meaning that the inter-stimulus interval is 357ms. We are going to import epochs of 300ms around the stimulation events.

Averaging

Source estimation

Head model

Noise covariance matrix

Inverse model

Regions of interest

Scripting

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

1 function tutorial_yokogawa(tutorial_dir) 2 % TUTORIAL_YOKOGAWA: Script that reproduces the results of the online tutorials "Yokogawa recordings". 3 % 4 % CORRESPONDING ONLINE TUTORIALS: 5 % https://neuroimage.usc.edu/brainstorm/Tutorials/Yokogawa 6 % 7 % INPUTS: 8 % tutorial_dir: Directory where the sample_yokogawa.zip file has been unzipped 9 10 % @============================================================================= 11 % This function is part of the Brainstorm software: 12 % https://neuroimage.usc.edu/brainstorm 13 % 14 % Copyright (c) University of Southern California & McGill University 15 % This software is distributed under the terms of the GNU General Public License 16 % as published by the Free Software Foundation. Further details on the GPLv3 17 % license can be found at http://www.gnu.org/copyleft/gpl.html. 18 % 19 % FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE 20 % UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY 21 % WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF 22 % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY 23 % LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE. 24 % 25 % For more information type "brainstorm license" at command prompt. 26 % =============================================================================@ 27 % 28 % Author: Francois Tadel, 2014-2016 29 30 31 % ======= FILES TO IMPORT ======= 32 % You have to specify the folder in which the tutorial dataset is unzipped 33 if (nargin == 0) || isempty(tutorial_dir) || ~file_exist(tutorial_dir) 34 error('The first argument must be the full path to the tutorial dataset folder.'); 35 end 36 % Build the path of the files to import 37 AnatDir = fullfile(tutorial_dir, 'sample_yokogawa', 'anatomy', 'freesurfer'); 38 RawFile = fullfile(tutorial_dir, 'sample_yokogawa', 'data', 'SEF_000-export.con'); 39 % Check if the folder contains the required files 40 if ~file_exist(RawFile) 41 error(['The folder ' tutorial_dir ' does not contain the folder from the file sample_yokogawa.zip.']); 42 end 43 44 % ======= CREATE PROTOCOL ======= 45 % The protocol name has to be a valid folder name (no spaces, no weird characters...) 46 ProtocolName = 'TutorialYokogawa'; 47 % Start brainstorm without the GUI 48 if ~brainstorm('status') 49 brainstorm nogui 50 end 51 % Delete existing protocol 52 gui_brainstorm('DeleteProtocol', ProtocolName); 53 % Create new protocol 54 gui_brainstorm('CreateProtocol', ProtocolName, 0, 0); 55 % Start a new report 56 bst_report('Start'); 57 58 59 % ===== IMPORT ANATOMY ===== 60 % Subject name 61 SubjectName = 'Subject01'; 62 % Process: Import anatomy folder 63 bst_process('CallProcess', 'process_import_anatomy', [], [], ... 64 'subjectname', SubjectName, ... 65 'mrifile', {AnatDir, 'FreeSurfer'}, ... 66 'nvertices', 15000, ... 67 'nas', [128, 227, 93], ... 68 'lpa', [ 48, 130, 69], ... 69 'rpa', [214, 130, 76]); 70 71 % ===== ACCESS RECORDINGS ===== 72 % Process: Create link to raw file 73 sFileRaw = bst_process('CallProcess', 'process_import_data_raw', [], [], ... 74 'subjectname', SubjectName, ... 75 'datafile', {RawFile, 'KIT'}, ... 76 'channelreplace', 0, ... 77 'channelalign', 0); 78 % Process: Set channels types 79 bst_process('CallProcess', 'process_channel_settype', sFileRaw, [], ... 80 'sensortypes', 'EO1, EO2', ... 81 'newtype', 'EOG'); 82 bst_process('CallProcess', 'process_channel_settype', sFileRaw, [], ... 83 'sensortypes', 'EKG+', ... 84 'newtype', 'ECG'); 85 bst_process('CallProcess', 'process_channel_settype', sFileRaw, [], ... 86 'sensortypes', 'E', ... 87 'newtype', 'MISC'); 88 % Process: Events: Read from channel 89 bst_process('CallProcess', 'process_evt_read', sFileRaw, [], ... 90 'stimchan', 'Trigger01', ... 91 'trackmode', 3, ... % TTL: detect peaks of 5V/12V on an analog channel (baseline=0V) 92 'zero', 0); 93 % Process: Snapshot: Sensors/MRI registration 94 bst_process('CallProcess', 'process_snapshot', sFileRaw, [], ... 95 'target', 1, ... % Sensors/MRI registration 96 'modality', 1, ... % MEG (All) 97 'orient', 1, ... % left 98 'Comment', 'MEG/MRI Registration'); 99 % Process: Snapshot: Sensors/MRI registration 100 bst_process('CallProcess', 'process_snapshot', sFileRaw, [], ... 101 'target', 1, ... % Sensors/MRI registration 102 'modality', 4, ... % EEG 103 'orient', 1, ... % left 104 'Comment', 'EEG/MRI Registration'); 105 106 107 % ===== FREQUENCY FILTERS ===== 108 % Process: Band-pass:0.5Hz-200Hz 109 sFileClean = bst_process('CallProcess', 'process_bandpass', sFileRaw, [], ... 110 'sensortypes', 'MEG, EEG', ... 111 'highpass', 0.5, ... 112 'lowpass', 200, ... 113 'attenuation', 'strict', ... % 60dB 114 'mirror', 0, ... 115 'read_all', 0); 116 % Process: Notch filter: 60Hz 120Hz 180Hz 117 sFileClean = bst_process('CallProcess', 'process_notch', sFileClean, [], ... 118 'freqlist', [60, 120, 180], ... 119 'sensortypes', 'MEG, EEG', ... 120 'read_all', 0); 121 % Process: Power spectrum density (Welch) 122 sFilesPsd = bst_process('CallProcess', 'process_psd', [sFileRaw sFileClean], [], ... 123 'timewindow', [0, 50], ... 124 'win_length', 4, ... 125 'win_overlap', 50, ... 126 'clusters', {}, ... 127 'sensortypes', 'MEG, EEG', ... 128 'edit', struct(... 129 'Comment', 'Power', ... 130 'TimeBands', [], ... 131 'Freqs', [], ... 132 'ClusterFuncTime', 'none', ... 133 'Measure', 'power', ... 134 'Output', 'all', ... 135 'SaveKernel', 0)); 136 % Process: Snapshot: Frequency spectrum 137 bst_process('CallProcess', 'process_snapshot', sFilesPsd, [], ... 138 'target', 10, ... % Frequency spectrum 139 'Comment', 'Power spectrum density'); 140 141 142 % ===== BAD CHANNELS AND AVERAGE REF ===== 143 % Process: Set bad channels 144 bst_process('CallProcess', 'process_channel_setbad', sFileClean, [], ... 145 'sensortypes', 'LC11'); 146 % Process: Re-reference EEG 147 bst_process('CallProcess', 'process_eegref', sFileClean, [], ... 148 'eegref', 'AVERAGE', ... 149 'sensortypes', 'EEG'); 150 151 % ===== DETECT HEARTBEATS AND BLINKS ===== 152 % Process: Detect heartbeats 153 bst_process('CallProcess', 'process_evt_detect_ecg', sFileClean, [], ... 154 'channelname', 'EKG+', ... 155 'timewindow', [0, 119.9995], ... 156 'eventname', 'cardiac'); 157 % Process: Detect eye blinks 158 bst_process('CallProcess', 'process_evt_detect_eog', sFileClean, [], ... 159 'channelname', 'EO2', ... 160 'timewindow', [0, 119.9995], ... 161 'eventname', 'blink'); 162 % Process: Remove simultaneous 163 bst_process('CallProcess', 'process_evt_remove_simult', sFileClean, [], ... 164 'remove', 'cardiac', ... 165 'target', 'blink', ... 166 'dt', 0.25, ... 167 'rename', 0); 168 169 % ===== ICA: MEG/EEG ===== 170 % Process: ICA components: Infomax 171 bst_process('CallProcess', 'process_ica', sFileClean, [], ... 172 'timewindow', [0, 119.9995], ... 173 'eventname', '', ... 174 'eventtime', [-0.1992, 0.1992], ... 175 'bandpass', [0, 0], ... 176 'nicacomp', 0, ... 177 'sensortypes', 'EEG', ... 178 'usessp', 0, ... 179 'ignorebad', 1, ... 180 'saveerp', 0, ... 181 'method', 1, ... % Infomax: EEGLAB / RunICA 182 'select', [1 2 6]); 183 % Process: ICA components: Infomax 184 bst_process('CallProcess', 'process_ica', sFileClean, [], ... 185 'timewindow', [0, 119.9995], ... 186 'eventname', '', ... 187 'eventtime', [-0.1992, 0.1992], ... 188 'bandpass', [0, 0], ... 189 'nicacomp', 40, ... 190 'sensortypes', 'MEG', ... 191 'usessp', 0, ... 192 'ignorebad', 1, ... 193 'saveerp', 0, ... 194 'method', 1, ... % Infomax: EEGLAB / RunICA 195 'select', [1 2]); 196 % Process: Snapshot: SSP projectors 197 bst_process('CallProcess', 'process_snapshot', sFileClean, [], ... 198 'target', 2, ... % SSP projectors 199 'Comment', 'SSP projectors'); 200 201 202 % ===== IMPORT EVENTS ===== 203 % Process: Import MEG/EEG: Events 204 sFilesEpochs = bst_process('CallProcess', 'process_import_data_event', sFileClean, [], ... 205 'subjectname', SubjectName, ... 206 'condition', '', ... 207 'eventname', 'Trigger01', ... 208 'timewindow', [], ... 209 'epochtime', [-0.050, 0.250], ... 210 'createcond', 1, ... 211 'ignoreshort', 1, ... 212 'usectfcomp', 1, ... 213 'usessp', 1, ... 214 'freq', [], ... 215 'baseline', [-0.050, -0.010]); 216 % Process: Average: By trial group (folder average) 217 sFilesAvg = bst_process('CallProcess', 'process_average', sFilesEpochs, [], ... 218 'avgtype', 5, ... % By trial group (folder average) 219 'avg_func', 1, ... % Arithmetic average: mean(x) 220 'weighted', 0, ... 221 'keepevents', 0); 222 223 % Process: Snapshot: Recordings time series (MEG + EEG) 224 bst_process('CallProcess', 'process_snapshot', sFilesAvg, [], ... 225 'target', 5, ... % Recordings time series 226 'modality', 1, ... % MEG (All) 227 'Comment', 'Evoked response (MEG)'); 228 bst_process('CallProcess', 'process_snapshot', sFilesAvg, [], ... 229 'target', 5, ... % Recordings time series 230 'modality', 4, ... % EEG 231 'Comment', 'Evoked response (EEG)'); 232 % Process: Snapshot: Recordings topography (one time, MEG + EEG) 233 bst_process('CallProcess', 'process_snapshot', sFilesAvg, [], ... 234 'target', 6, ... % Recordings topography (one time) 235 'modality', 1, ... % MEG (All) 236 'orient', 1, ... % left 237 'time', 0.0190, ... 238 'Comment', 'Evoked response (MEG topography)'); 239 bst_process('CallProcess', 'process_snapshot', sFilesAvg, [], ... 240 'target', 6, ... % Recordings topography (one time) 241 'modality', 4, ... % EEG 242 'orient', 1, ... % left 243 'time', 0.0190, ... 244 'Comment', 'Evoked response (EEG topography)'); 245 246 247 % ===== SOURCE MODELING ===== 248 % Process: Generate BEM surfaces 249 bst_process('CallProcess', 'process_generate_bem', [], [], ... 250 'subjectname', SubjectName, ... 251 'nscalp', 1922, ... 252 'nouter', 1922, ... 253 'ninner', 1922, ... 254 'thickness', 4, ... 255 'method', 'brainstorm'); 256 % Process: Compute head model 257 bst_process('CallProcess', 'process_headmodel', sFilesAvg, [], ... 258 'comment', '', ... 259 'sourcespace', 1, ... 260 'meg', 3, ... % Overlapping spheres 261 'eeg', 3, ... % OpenMEEG BEM 262 'openmeeg', struct(... 263 'BemSelect', [1, 1, 1], ... 264 'BemCond', [1, 0.0125, 1], ... 265 'BemNames', {{'Scalp', 'Skull', 'Brain'}}, ... 266 'BemFiles', {{}}, ... 267 'isAdjoint', 1, ... 268 'isAdaptative', 1, ... 269 'isSplit', 0, ... 270 'SplitLength', 4000)); 271 % Process: Compute noise covariance 272 bst_process('CallProcess', 'process_noisecov', sFilesEpochs, [], ... 273 'baseline', [-0.050, -0.010], ... 274 'dcoffset', 1, ... 275 'identity', 0, ... 276 'copycond', 0, ... 277 'copysubj', 0); 278 % Process: Compute sources (MEG) 279 sFilesSrcMeg = bst_process('CallProcess', 'process_inverse', sFilesAvg, [], ... 280 'Comment', '', ... 281 'method', 2, ... % dSPM 282 'wmne', struct(... 283 'SourceOrient', {{'fixed'}}, ... 284 'loose', 0.2, ... 285 'SNR', 3, ... 286 'pca', 1, ... 287 'diagnoise', 0, ... 288 'regnoise', 1, ... 289 'magreg', 0.1, ... 290 'gradreg', 0.1, ... 291 'eegreg', 0.1, ... 292 'depth', 1, ... 293 'weightexp', 0.5, ... 294 'weightlimit', 10), ... 295 'sensortypes', 'MEG', ... 296 'output', 1); % Kernel only: shared 297 % Process: Compute sources (EEG) 298 sFilesSrcEeg = bst_process('CallProcess', 'process_inverse', sFilesAvg, [], ... 299 'Comment', '', ... 300 'method', 2, ... % dSPM 301 'wmne', struct(... 302 'SourceOrient', {{'fixed'}}, ... 303 'loose', 0.2, ... 304 'SNR', 3, ... 305 'pca', 1, ... 306 'diagnoise', 0, ... 307 'regnoise', 1, ... 308 'magreg', 0.1, ... 309 'gradreg', 0.1, ... 310 'eegreg', 0.1, ... 311 'depth', 1, ... 312 'weightexp', 0.5, ... 313 'weightlimit', 10), ... 314 'sensortypes', 'EEG', ... 315 'output', 1); % Kernel only: shared 316 317 % Process: Snapshot: Sources (one time) 318 bst_process('CallProcess', 'process_snapshot', sFilesSrcMeg, [], ... 319 'target', 8, ... % Sources (one time) 320 'orient', 3, ... % top 321 'time', 0.019, ... 322 'Comment', 'Source maps at 19ms (MEG)'); 323 bst_process('CallProcess', 'process_snapshot', sFilesSrcEeg, [], ... 324 'target', 8, ... % Sources (one time) 325 'orient', 3, ... % top 326 'time', 0.019, ... 327 'Comment', 'Source maps at 19ms (EEG)'); 328 329 330 % Save and display report 331 ReportFile = bst_report('Save'); 332 bst_report('Open', ReportFile); 333 334 335





Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):


Tutorials/Yokogawa (last edited 2022-06-24 10:17:30 by FrancoisTadel)