TMSEEG Tutorial. Version 4.0. This tutorial was written by: Sravya Atluri and Matthew Frehlich. Contact:

Similar documents
ERPEEG Tutorial. Version 1.0. This tutorial was written by: Sravya Atluri, Matthew Frehlich and Dr. Faranak Farzan.

DSI-STREAMER TO EEGLAB EXTENSION

M/EEG pre-processing 22/04/2014. GUI Script Batch. Clarification of terms SPM speak. What do we need? Why batch?

ADJUST: An Automatic EEG artifact Detector based on the Joint Use of Spatial and Temporal features

MindWare Electromyography (EMG) Analysis User Reference Guide Version Copyright 2011 by MindWare Technologies LTD. All Rights Reserved.

A Framework for Evaluating ICA Methods of Artifact Removal from Multichannel EEG

The BERGEN Plug-in for EEGLAB

PREPROCESSING FOR ADVANCED DATA ANALYSIS

1. Introduction Installation and requirements... 2

Source Reconstruction in MEG & EEG

Tutorial BOLD Module

Manual. User Reference Guide. Analysis Application (EMG) Electromyography Analysis

You need to use the URL provided by your institute s OMERO administrator to access the OMERO.web client.

Managing custom montage files Quick montages How custom montage files are applied Markers Adding markers...

Rat 2D EPSI Dual Band Variable Flip Angle 13 C Dynamic Spectroscopy

Student Quick Reference Guide

CONTROL ROOM SOFTWARE

SIVIC GUI Tutorial. HMTRC Workshop - March 23-24, 2017

Social Interaction Tutorial

Working with Spreadsheets in Target

The iworx 214 and LabScribe V2.0 Tutorial. Overview

Target Drillhole Mapping

Instruction for Mass Spectra Viewer

For the SIA Features of GigaView. Introduction. Initial Dialog Bar

Experiment 3. Getting Start with Simulink

MindWare Heart Rate Variability (HRV) Analysis User Reference Guide Version Copyright 2011 by MindWare Technologies LTD. All Rights Reserved.

OHBA M/EEG Analysis Workshop. Mark Woolrich Diego Vidaurre Andrew Quinn Romesh Abeysuriya Robert Becker

INTViewer Tutorial Cube Tutorial

The LabScribe Tutorial

Clinic Visual Evoked Response Imaging System Short User Manual

GE Dynamic 13 C Acquisition

Getting Familiar with Microsoft Word 2010 for Windows

ASA Getting Started. ANT BV, Enschede, Netherlands Advanced Neuro Technology

SIVIC GUI Overview. SIVIC GUI Layout Overview

Maize Sampler 2 Documentation

Performing real-time BCI experiments

GUARD1 PLUS Manual Version 2.8

Agent Console. The Agent Console. The topics in this section provide information about the Agent Console.

Quality Control for your Induced Polarization Data

EE261 Computer Project 1: Using Mentor Graphics for Digital Simulation

In this lab, you will build and execute a simple message flow. A message flow is like a program but is developed using a visual paradigm.

WNS Waves Noise Suppressor

A Guide to Processing Photos into 3D Models Using Agisoft PhotoScan

6 Using Noise Reduction Filters

PsyAcoustX Manual (v1)

Science Visual Evoked Response Imaging System Short User Manual

INTRODUCTION TO VISUAL BASIC 2010

Performing a resequencing assembly

TimeStudio process manual Pupil analysis

Lesson 1: Getting Familiar with Microsoft Word 2007 for Windows

DAQLink II System 24 bit Acquisition System

USER MANUAL S6000 / S7000 S8000 / S9000. Associated Research, Inc., West Laurel Drive Lake Forest, Illinois, U.S.A.

D1.5a Create Access Master Files

Tutorial - Introduction to LabScribe and the IX-ELVIS

Background on Kingdom Suite for the Imperial Barrel Competition 3D Horizon/Fault Interpretation Parts 1 & 2 - Fault Interpretation and Correlation

VE-Pro User Guide IES Virtual Environment 6.4

IT INFRASTRUCTURE PROJECT PHASE I INSTRUCTIONS

Start Active-HDL. Create a new workspace TUTORIAL #1 CREATING AND SIMULATING SIMPLE SCHEMATICS

Enterprise Architect. User Guide Series. Model Navigation

Concept Toolkit 12 Calculate Plan Educate

PI3000. User Guide PASSENGER INFORMATION SYSTEM. rev 1.2

BESA Research. CE certified software package for comprehensive, fast, and user-friendly analysis of EEG and MEG

Scottish Improvement Skills

Importing and processing a DGGE gel image

OpenEx Supplement for Synapse Users

User Manual. for ArcTrax UWP version

BASICS OF THE RENESAS SYNERGY PLATFORM

A short tutorial for RIDE toolbox

Reference for Off-Campus Remote Desktop Connection ipad Edition

Introducing WinQuake 2.5

Scope View provides a number of powerful visual tools to enhance analysis and display.

v Data Visualization SMS 12.3 Tutorial Prerequisites Requirements Time Objectives Learn how to import, manipulate, and view solution data.

Tutorial 3: Using the Waveform Viewer Introduces the basics of using the waveform viewer. Read Tutorial SIMPLIS Tutorials SIMPLIS provide a range of t

LEGENDplex Data Analysis Software Version 8 User Guide

1 User Guide. 1 Main screen

Cartoon Transformation

Geology Interpretation Project Big Injun Sand & Trenton-Black River plays, Central Appalachian Basin, WV

Tutorial of Origin 7.0. Chuang Tan, Zheyun Liu

SigmaStudio User Manual

Computing seismic QC attributes, fold and offset sampling in RadExPro software Rev

3 TUTORIAL. In This Chapter. Figure 1-0. Table 1-0. Listing 1-0.

GoedelWorks Press release

Biopac Student Lab 4.1 BSL PRO TUTORIAL. BIOPAC Systems, Inc. Windows 10, 8, 7 Mac OS X

Single-sided Magnet Diffusion Measurements

FMRI Pre-Processing and Model- Based Statistics

BSL PRO 3.7 BSL PRO TUTORIAL. BIOPAC Systems, Inc. PC/Windows 98SE, Me, 2000 Pro, XP Mac OS X

Prestack Workflows: Prestack Structure-Oriented Filtering. The Prestack Structure-Oriented Filtering Workflow. Introduction

P300 Accuracy V Copyright 2012 g.tec medical engineering GmbH

User's Guide. For CarChip and CarChip E/X 8210 & 8220

GUARD1 PLUS Documentation. Version TimeKeeping Systems, Inc. GUARD1 PLUS and THE PIPE are registered trademarks

The Fundamentals. Document Basics


cief Data Analysis Chapter Overview Chapter 12:

v Introduction to WMS WMS 11.0 Tutorial Become familiar with the WMS interface Prerequisite Tutorials None Required Components Data Map

Since you can designate as many symbols as needed as baseline symbols it s possible to show multiple baselines with unique symbology.

v SRH-2D Post-Processing SMS 12.3 Tutorial Prerequisites Requirements Time Objectives

You will need to add the path to all the related files into the MATLAB path. To do so, click Set Path in the Home tab.

Getting Started with DADiSP

SIMULINK A Tutorial by Tom Nguyen

1. Introduction Installation and requirements... 2

Transcription:

TMSEEG Tutorial Version 4.0 This tutorial was written by: Sravya Atluri and Matthew Frehlich Contact: faranak.farzan@sfu.ca For more detail, please see the Method article describing the TMSEEG Toolbox: http://journal.frontiersin.org/article/10.3389/fncir.2016.00078/full# 1

Table of Contents Introduction... 3 Installation... 4 Dataset Loading and Setup... 6 Settings... 8 Step 1 Initial Processing... 9 1. Epoching and Baseline Removal... 9 2. Resampling... 9 3. Channel location lookup... 10 Step 2 TMS Artifact Removal... 11 1. Selecting Pulse Paradigm... 11 2. Adjusting Removal Period... 11 Step 3 Removal of Bad Trials and Channels... 12 1. Select Attribute for Display... 12 2. Plot Trials... 13 3. Plot Channels... 15 4. EEGPLOT... 17 5. Clear Subject... 18 6. Deletion Matrix... 18 Step 4 Round 1 of ICA... 19 Step 5 - Remove TMS Decay with ICA (Round1)... 19 Step 6 Filtering... 20 Step 7 Round 2 of ICA... 21 Step 8 Remove Artifacts with ICA (Round 2)... 22 Step 9 Remove Channels and Trials 2... 23 Step 10 Final Processing... 23 2

Introduction Due to the nature of transcranial magnetic stimulation (TMS) and the sensitivity of electroencephalography signals (EEG), a number of artifacts often mask TMS-evoked potentials (TEP)s. Proper analysis of TMS-EEG data requires the development and standardization of signal processing algorithms to recover TEPs from various sources of artifacts. TMSEEG is a MATLAB App dedicated for processing TMS-EEG data. Implemented with a modular graphical user interface (GUI), TMSEEG provides an interactive and compact platform to process data from various TMS-EEG paradigms. The GUI is designed to guide novice users while the software architecture supports the integration of alternative or additional processing modules for users with experience in TMS-EEG data processing. To simplify and standardize the TMS-EEG signal processing, the toolbox integrates five main novel approaches: Focused removal of TMS-induced artifacts from EEG data, A streamlined, step-by-step yet modular data processing workflow for ease-of-use and modification flexibility, A comprehensive multi-panel display of artifact characteristics for faster and more accurate data removal, Integrated quality control using online visualization of the TEP waveforms throughout the data processing steps, and Online visualization of component-based artifact removal with capability to label and store a database of artifacts. 3

Installation There are currently two versions of TMSEEG available. One for MATLAB 2016 and above (MASTER BRANCH) found here (https://github.com/cogsmac/tmseeg/) and another for MATLAB 2013-2015 (TMSEEG2014 BRANCH), found here (https://github.com/cogsmac/tmseeg/tree/tmseeg2014). Before loading the electrophysiological dataset into TMSEEG, users must convert their dataset to.set format using the EEGLAB software suite (http://sccn.ucsd.edu/eeglab/downloadtoolbox.php). TMSEEG requires installation of EEGLAB v12.0.2.6b or higher. It also requires: MATLAB signal processing toolkit. Make sure to set the MATLAB signal toolbox as a higher path priority than other software such as field trip, as some functions may share common names. Or ideally, remove fieldtrip from your MATLAB path if errors persist. FASTICA is the current preferred algorithm for ICA in TMSEEG. More detail on the FASTICA algorithm can be found here: (http://research.ics.aalto.fi/ica/fastica/code/dlcode.shtml) TMSEEG creates multiple intermediate datasets at each processing step to allow easy reprocessing of the data. We highly recommend that each base dataset for processing is placed in its own folder to easily track datasets. 4

To install TMSEEG: 1. Copy the.mlappinstall file to your current working folder in MATLAB. 2. Right click on the file and select 'Install'. 5

Dataset Loading and Setup TMSEEG is initialized by selecting the app from the MATLAB apps toolbar. Users can also open the tool by running the tmseeg_main function directly in the MATLAB command window (to do this ensure the software folder, under MATLAB -> APPS, has been added to the path). Running the program will display the main GUI of TMSEEG. Figure 1: TMSEEG Main GUI To load a dataset: 1. Select the Working Folder button, calling a select working folder window. Using the pathing tool, select the folder you have created containing your base.set file 2. After selecting the folder, select the Dataset button and choose your.set file in the working folder 6

Figure 2: Selecting folder (Left) and File (Right) If you have previously processed the dataset in the working folder, the TMSEEG GUI will indicated a completed dataset by colouring the step green (see Figure 3 below) Figure 3: Main GUI displaying previous work and settings 7

The Settings button in the main GUI brings up a smaller window, allowing the user to select and change the processing parameters of the toolbox. Users can also access main GUI of EEGLAB main GUI at any time during data processing through the EEGLAB button. Settings Parameters for data processing can be changed in the settings tab. Settings are currently available for: Step 1 Initial processing Step 2 TMS Artifact removal Steps 3 and 9 Removal of bad trials and channels Steps 7 and 8 Rejecting artifacts using ICA (round 2) Due to the sequential nature of the TMSEEG workflow, if the settings are changed for a specified step, the workflow will reset to that step (i.e., all data processing from the specified step and onwards will be erased). We highly recommend users to specify all parameters in the setting tab before processing the data to avoid unnecessary resets of the processing workflow. 8

Step 1 Initial Processing After completing the loading steps, select the Initial Processing button on the main GUI to initiate the first processing step, which guides the user with a series of pop-ups through the following processes: 1. Epoching and Baseline Removal If the dataset was not previously epoched, TMSEEG will prompt the user with a list of events in the input dataset to epoch around. The default setting for epoching is -1000ms to 1000ms. After epoching the dataset, the user is prompted for baseline removal based on a user-selected time range (default is set relative to the selected pre-stimulus range). Figure 4: Epoching and Baseline Process 2. Resampling Resampling is recommended to improve toolbox performance and reduce data storage requirements. TMSEEG will prompt the user to resample if data sampling frequency is greater than 1000Hz. 9

Figure 6: Resample Prompt and Input 3. Channel location lookup After resampling, the user is prompted to select a channel location file using EEGLABS pop_chanedit() function or load default locations using a database of 385 defined channel labels from the Standard-10-5-Cap385.elp file originally from the EEGLAB distribution. If the user decides to keep channels without channel locations, a warning is provided. It is highly recommended to delete channels without channel locations in Step 1 or alternatively in Step 3. Channels without any location information cannot be interpolated and therefore may cause issues if trials within these channels are marked for deletion. Non-EEG channels should also be removed before ICA. Future versions will allow the user to select channels for ICA. An automatic pop-up window shows the channel locations (if available) in a topographic display, with a scrolling list for the user to select channels for removal. If the channel locations cannot be found, a popup window will alert the user. Figure 7: Channel Removal Display 10

Step 2 TMS Artifact Removal TMS artifact removal consists of an interactive GUI that allows the user to visualize the range of data removal relative to the dataset. This allows the user to delete the TMS pulse artifact while retaining the TMS decay artifact for later removal in Step 4-5. Figure 8: TMS Pulse Removal A) Single Pulse Paradigm, B) Double Pulse paradigm. Adjusting the sliders below each pulse will change the range of deletion. 1. Selecting Pulse Paradigm The user selects the TMS Paradigm, currently between single and double pulse. The inter-stimulus interval and pulse duration can both be adjusted in the settings function from the main GUI. Figure 8 shows the Step 2 display for both single and paired-pulse paradigms. 2. Adjusting Removal Period Adjusting the sliders will change the range of data removal. This selected data will be removed from the dataset and the surrounding data is concatenated before saving the dataset. For visualization in the toolbox, the removed data interval is represented with NaN values (i.e., a gap). Pulse duration can be adjusted through the Settings tab to allow removal of large blocks of data (ex., for repetitive TMS data). 11

Step 3 Removal of Bad Trials and Channels 1. Select Attribute for Display TMSEEG displays data through the Plot Trials and Plot Channels GUI with a user-selected attribute. In the Plot Trials display, trials are displayed based on the chosen attribute extracted over all channels. In the Plot Channels option, a subplot is generated for each channel to display the ATTRIBUTE value at each trial for the specified channel. Figure 9: Main GUI for Trial/Channel Removal with ATTRIBUTE Selection 12

2. Plot Trials Plot Trial uses the selected ATTRIBUTE to calculate an attribute value for each trial. This is displayed through a scatterplot (Figure 10). By clicking these dots, the relevant trial data is displayed through a new GUI, allowing the user to delete selected channels in the trial, or the whole trial. Figure 10: Plot Trials GUI Trials that have been marked for deletion are shown in red. Clicking a dot with the mouse brings up the display shown in Figure 11 below. 13

Figure 11: Trial Deletion GUI Called by clicking on the corresponding dot in the Plot Trials GUI. Channel data is displayed for the selected trial (in this case trial 49). The red channel (PO5) has been selected for deletion in the above display, and will be removed for the duration of trial 49 by clicking the Delete button. In this Trial Deletion GUI, channels can be selected for deletion for the duration of the trial using the Delete button. Alternatively, if the user clicks on the Delete button without selecting any channels then the whole trial is deleted. 14

3. Plot Channels ** NOTE: THIS WINDOW MAY TAKE LONGER TO LOAD WITH THE TMSEEG VERSION DESIGNED FOR MATLAB 2016. This issue will be addressed in the near future. TMSEEG offers easy visualization so that the user can assess data for removal with the Plot Channels GUI. Plot Channels creates a subplot for each channel in the dataset as seen in Figure 12. This scatterplot displays the ATTRIBUTE value of each trial within the channel (Figure 12). Selecting these subplots will bring up the Channel Removal GUI (Figures 13-14), while selecting the dots in the subplots will bring up the same Trial Deletion GUI as seen in Figure 11. Figure 12: Plot Channels GUI The position of the scatterplot for each channel is based on the loaded channel co-ordinates file. Dots in each channel subplot indicate the ATTRIBUTE value of each trial, and a blacked out channel indicates that it has been set for removal. IMPORTANT NOTE: Users are highly recommended to delete channels without co-ordinates at this step. Alternatively, if users want to retain these channels they can make sure they do not delete any trials within these channels. Deleted trials within channels will be interpolated (if below the user-specified threshold) at the end of step 3 and channels with no channel co-ordinates cannot be interpolated. It will result in an error. 15

Figure 13: Channel Removal GUI Spread Mode Figure 14: Channel Removal GUI Stacked Mode 16

Figure 13 and Figure 14 show the Channel Removal GUI in its two display modes: Stacked and Spread. The spread display plots the channels in a more traditional offset format, while the stacked display plots all traces on the same baseline for comparison. Three options exist for deleting data in this window: a. Removal of Trial in Channel Delete an individual trial-channel pair, by right-clicking the data segment or by selecting the data segment and clicking the R/ Trial in Channel button. b. Remove Channel Using the R/ Channel option, mark all trials in the channel for deletion. c. Trial Deletion Select a trial and use the Show Trial button to open the Trial Deletion GUI to delete the entire trials or selected channels within the trial (Figure 11). Trials marked for deletion will be seen as red in the Channel Removal GUI if the Visible option is selected. The channel drop down menu allows quick scrolling through the channels, and can be operated using the up and down arrows on the keyboard. 4. EEGPLOT For users familiar with the eegplot function in EEGLAB, we have included this function directly linked to TMSEEG: Figure 14 EEGPlot Option Called using the EEGplot option from the remove trials and channels GUI. Selected trials (highlighted in blue) are removed by pressing the REJECT button. 17

5. Clear Subject If the user needs to restart the cleaning process, the trials/channels marked for deletion can be quickly cleared using the Clear Subject button. 6. Deletion Matrix The Deletion Matrix button offers an efficient quality control on the deletion process by plotting the trials and channels currently selected for deletion in a matrix (Trials vs Channels) format: Figure 15: The Deletion Matrix 18

Step 4 Round 1 of ICA TMSEEG uses the pop_runica function from EEGLAB to run ICA, currently using the FASTICA algorithm (see introduction for downloading link). Assuming FASTICA has been downloaded and is on the MATLAB path, selecting the ICA1 button will run ICA on the latest dataset (post removal of channels and trials selected in step 3) to extract the maximum number of components (i.e., the number of channels in the dataset). If non-eeg channels are present in the data please remove them before ICA. In future versions, users will be able to specify the channels that should be used with ICA in the settings window 1. Step 5 - Remove TMS Decay with ICA (Round1) After running ICA in Step 4, Step 5 calls the TMS Decay Removal GUI, to assist users in the process of removing the optimal combination of components associated with the TMS decay artifact: Figure 16: TMS Decay Artifact Removal Step 5 GUI displays the 15 largest components in terms of magnitude, with both the direct component plots and the topographic displays. The bottom left display shows a butterfly plot of the data before removal of components, while the bottom right display is updated to show the data after selected components have been removed. 1 This will be implemented in the next version of TMSEEG within the settings tab for Steps 4-5. 19

Step 6 Filtering After removing the TMS Decay Artifact, selecting Step 6 from the main GUI brings up the filtering GUI (Figure 17). TMSEEG currently offers two options: FIR filtering filtering with a basic FIR filter (recommended 1-55Hz) to remove unwanted frequencies and avoid power line noise. The user can adjust the filter order using the filter order button. IIR Filtering Bandpass filtering using a butterworth filter, with a notch filter centred at 60Hz for removal of power line noise. Currently, the user can adjust the frequency bands of the filter, and the order of the butterworth filter by selecting the filter order button. Figure 17: Filtering GUI 20

Step 7 Round 2 of ICA Step 7 runs ICA once again with the pop_runica function and the FASTICA algorithm. The number of components extracted is dependent on a percentage of remaining channels (default 90%) that can be adjusted in the step 7/8 settings. Figure 18: Step 7/8 Settings 21

Step 8 Remove Artifacts with ICA (Round 2) Using the calculated ICA components in step 7, step 8 calls the component removal GUI to facilitate tagging and removal of common TMS-EEG related artifacts: Figure 18: ICA Round 2 Component Removal Display The main component removal GUI shows topographic plots of the ICA components, sorted in decreasing order of magnitude. Selecting the button of the relevant ICA component brings up a custom display showing information on topography, frequency content, and trial/channel amplitude information (Figure 18). Using this display, components can be marked using the drop-down menu as a specific artifact type, or viewed more closely using the data button. Once a component is marked as an artifact for deletion, the ICA component label turns red, while viewing (not marking) a component will mark the label as green. In the top-left corner of the GUI, the user can view the butterfly waveform before and after the removal of the marked components by clicking on the Update button. However, these marked components are not removed until the user decides to Save the workspace. Finally, for quality control, the user can visualize the number of deleted components and the type of artifacts deleted through the Comp Mat button. 22

Step 9 Remove Channels and Trials 2 Step 9 includes a second round of trial and channel removal, targeting any residual noise or artifacts introduced in the processing workflow. Please refer to the Step 3 instructions as the noise removal process is identical. The parameters of this step can be modified as needed through the Settings button in the main GUI of TMSEEG. Step 10 Final Processing TMSEEG performs three tasks during the final processing step: (i) interpolation of channels deleted in Steps 3 and 9, (ii) re-referencing of channel data, and (iii) the addition of a buffer space for time period(s) deleted in Step 2 2. Interpolation is performed using the pop_interp function from EEGLAB. By default, the function is specified to use the spherical method. This step concludes the processing of EEG data from raw TMS-EEG signals to clean TEPs. At any given step during the workflow, users can visualize the progressive removal of artifacts through the averaged TEP butterfly plot by clicking on the "View Step" button in the main GUI (Figure 19), or continue data processing in EEGLAB using the EEGLAB button. Figure 19: Butterfly plots shown when selecting the View Step button (with and without topographical map) 2 Re-referencing and the addition of a buffer space will be optional in future versions. 23