Plot and remove components
Last updated
Last updated
This function plots independent components following ICA and allows users to classify components for removal using a dropdown menu. Each plot includes a butterfly plot of the EEG data with and without the current IC, the average time course of the component, the trial-by-trial amplitude of the component, the topography of the component, and the power spectrum of the component. Infomration on the % mean variance (of total variance) accounted for by each component is also provided.
Users can interactively alter the x and y axes of the plots by selecting 'Update plots'. Note that three figures sizes are available: 'small','medium' and 'large'.
When satisfied with classification, press the 'Next' button to continue to the next component. Users can scroll backwards and forward through components by selecting the 'Next' and 'Back' buttons, or skip to another component by selecting the component number from the dropdown menu. Users can also skip to the 'Finish' from this dropdown.
Components are classified as one of the following: keep, reject, reject - TMS-evoked muscle, reject - blink, reject - eye movement, reject - muscle, reject - electrode noise, or reject - sensory . If a component classification algorithm has been used to classify components in TESA, this can be used as an input to tesa_compplot to automatically mark components for rejection. If a component is selected for rejection, it is plotted as red on subsequent plots, if not it is plotted as blue. Following removal, a before-and-after plot is generated and users can select whether to continue or repeat the process. Component numbers and % variance represented by each component selected for removal is stored in the EEG structure => EEG.icaCompClass.xxx
Note that tesa_compplot is automatically called by tesa_compselect if 'compCheck' is 'on'.
For further information on selecting components, please read:
Independent component plotting. Interactive figure providing information on each independent component, including: temporal, spatial and spectral features; classification (if tesa_compselect run); and the effect of removing the IC has on the overall data.
1. Select the IC classification from the drop down menu (if required). Note that tesa_compselect is required for this option.
2. Set the size of the plotted figures. Three sizes are possible: small, medium and large.
3. Set the time course limits (x axis limits) for the component time course plots.
4. Set the frequency limits (x axis limits) for the component frequency plots.
5. Set the y-axis scaling for the frequency plot. Four scaling options are possible: raw, log, log10 and dB.
6. Turn on or off whether to save the IC weights in the EEG structure (useful for post hoc analysis of classified component features). Note turning this on will lead to larger file sizes.
EEG = tesa_compplot( EEG );
Default use
EEG = tesa_compplot( EEG, 'key1',value1... );
Custom input
EEG = pop_tesa_compplot( EEG );
Pop up window
EEG = pop_tesa_compplot( EEG, 'key1',value1... );
Custom input
Input
Description
Example
Default
EEG
EEGLAB EEG structure
EEG
-
Key
Input value
Description
Example
Default
Plot settings
'compClassInput'
EEGLAB structure field
Location in EEGLAB structure where output from TESA components classification algorithms are stored (e.g. tesa_compselect). Note that the number of components that have been classified must match the the number of components currently stored in the data (i.e. this won't work if you have already removed the components in tesa_compselect).
EEG.icaCompClass.TESA1
[ ]
'saveWeights'
'on' or 'off'
Saves the winv (topoplot weights) and icaact (time course weights) that the classification was performed on. Note this will increase the storage size of the files.
'on'
'off'
'figSize'
'small' or 'medium' or 'larger'
Determines the size of the figures that are plotted displaying the information on the components.
'medium'
'small'
'plotTimeX'
[start,end]
Vector with integers for plotting the component time course (in ms).
[-300,600]
[-200,500]
'plotFreqX'
[low,high]
Vector with integers for plotting the frequency distribution of components (in Hz)
[2,45]
[1,100]
'freqScale'
'raw' or 'log' or 'log10' or 'db'
y-axis scaling for the frequency plots
'log10'
'log'
Output
Description
EEG
EEGLAB EEG structure
EEG = pop_tesa_compplot( EEG, 'compClassInput', EEG.icaCompClass.TESA1 );
% Loads automated component classifications performed by tesa_compselect
EEG = tesa_compplot( EEG, 'figSize', 'small','plotTimeX',[-600,600], 'plotFreqX', [2,45], 'freqScale', 'db' );
Changes the size of the figure and the x axis' of the time course and frequency plots, and the scale of the y-axis on the frequency plots.