Extract TEPs
This function averages over trials to generate a TMS-evoked potential (TEP). Either a region-of-interest analysis (ROI), which averages over selected electrodes, or a global field amplitude analysis (GMFA; standard deviation across electrodes at each time point) can be performed. Outputs are saved in the EEG structure EEG.ROI or EEG.GMFA respectively.
For TEPs following paired pulses, an additional file can be specified to subtract from the conditioning pulse and thereby minimising the impact of on-going activity in the test pulse time period. For example, in a paired pulse condition with interstimulus interval of 100 ms, a single pulse file can be time shifted 100 ms and subtracted from the paired pulse file before the ROI or GMFA is calculated.
Finding peaks and returning amplitudes and latencies is performed with tesa_peakanalysis and tesa_peakoutput.
Further reading on importance of correcting paired pulses with TMS-EEG (in particular, see supplementary materials):

EEGLAB user interface

1. Select the type of analysis.
2. If region of interest (ROI) is chosen, select the electrodes included in the analysis. Electrodes can either be entered manually or selected from a list of existing electrodes by pressing the 'Select electrodes' button. Hold Ctrl to select multiple electrodes.
3. Enter an identifier for the ROI or GMFA analysis. For example, if motor is entered here, data will be stored in EEG.ROI.motor or EEG.GMFA.motor. If nothing is entered here, the data will be stored as EEG.ROI.R1 or EEG.GMFA.R1 (where R increases numerically for each unique analysis performed).
4. Turn on or off paired pulse correction. If paired pulse correction is on, a value must be given in 5. When OK is pressed, the user will be able to select the file for subtraction. Note that the number of electrodes and sampling rate must be equal between files.
5. Enter the interstimulus interval (in ms). Data from the second file will be shifted in time by this value prior to subtraction.


Base function

EEG = tesa_tepextract( EEG, type ); Default use.
EEG = tesa_tepextract( EEG, type, 'key1',value1... ); Custom input.

Pop function

EEG = pop_tesa_tepextract( EEG ); Pop up window.
EEG = pop_tesa_tepextract( EEG, type ); Default.
EEG = pop_tesa_tepextract( EEG, type, 'key1',value1... ); Custom input.

Required inputs

EEGLAB EEG structure
String describing analysis type. Either 'ROI' or 'GMFA'.

Optional inputs (key/value pairs)

Input value
String or cell
[Required for type 'ROI']. Define electrodes to be averaged for ROI analysis. Type 'all' to average over all electrodes.
'C3' (single); {'C3','C4','CP1'} (multiple); 'all' (all electrodes)
'on' or 'off'
Turns on/off pair correction.
[Required if 'pairCorrect','on']. Integer defines the inter-stimulus interval between the conditioning and test pulse. The single TEP that is subtracted from the paired TEP will be shifted by this many ms to align with the conditioning pulse. Integer is in ms.
[ ]
[Required if 'pairCorrect','on']. String is the path and name of the .set file to be subtracted from the paired TEP. This should be a single TEP evoked by a stimulus intensity equivalent to the conditioning pulse with the same electrodes and sampling rate.
[ ]


EEGLAB EEG structure


EEG = pop_tesa_tepextract( EEG, 'ROI', 'elecs', {'FC1','FC3','C1','C3'} ); Standard ROI analysis.
EEG = pop_tesa_tepextract( EEG, 'ROI', 'elecs', {'C1','C3'}, 'tepName','motor' ); ROI analysis with specific name.
EEG = pop_tesa_tepextract( EEG, 'ROI', 'elecs', 'C3', 'pairCorrect', 'on', 'ISI', 100, 'fileName', 'C:\tmseeg\LICI.set' ); Paired pulse analysis for ROI
EEG = pop_tesa_tepextract( EEG, 'GMFA'); Standard GMFA analysis
EEG = pop_tesa_tepextract( EEG, 'GMFA', 'pairCorrect', 'on', 'ISI', 100, 'fileName', 'C:\tmseeg\LICI.set' ); Paired pulse analysis for GMFA
Last modified 2yr ago