Head Plots
Headplots allow us to spatially visualize the neural activity for a given time range. We look at these to make sure the plots look like neural activity and not noise.
These are examples of good headplots. The time range is shown in seconds. time = [0.22 0.28] means that the plot is the average headplot from 0.22 seconds to 0.28 seconds is shown.
H O W T O
Method 1
Use FieldTrip again for the headplots. There are two ways to do this. The first is to use the the ft_topoplotER function.
Example Code:
% Load the datasets into the workspace (You may have more or less datasets.)
load '013A.mat'
dataA = timelock;
load '013F.mat'
dataF = timelock;
load '013J.mat'
dataJ = timelock;
load '013N.mat'
dataN = timelock;
% Average the datasets of interest together (For example, all the scene stimuli for a subject)
cfg = [];
grandavg = ft_timelockgrandaverage(cfg, dataA, dataF, dataJ, dataN);
% Plot the headplot
cfg = []; % clear the cfg structure
load lay.mat; % load the saved GSN256 layout structure (contains channel locations)
cfg.layout = lay; % set the layout to the one that was just loaded
cfg.xlim = [0.150 0.200]; % set the time window to 0.150 to 0.200 seconds
cfg.fontsize = 14; % set the font size on the plot to be size 14
figure; ft_topoplotER(cfg,grandavg); colorbar; % plot the headplot
saveas(gcf, 'yourfilename.png'); % save the image to the Matlab folder with the filename
% numberScenesN170.png (example: '012ScenesN170.png')
This code is from the automation5fxn.m. The yellow sections are the ones you need to replace with your own words or numbers.
Click here for info on how to save the layout structure.
Method 2
The second method is better if you want to see the headplots for various time ranges. Here, you use the ft_singleplotER function. Use this code:
Example Code:
% Load the datasets into the workspace (You may have more or less datasets.)
load '013A.mat'
dataA = timelock;
load '013F.mat'
dataF = timelock;
load '013J.mat'
dataJ = timelock;
load '013N.mat'
dataN = timelock;
% Average the datasets of interest together (For example, all the scene stimuli for a subject)
cfg = [];
grandavg = ft_timelockgrandaverage(cfg, dataA, dataF, dataJ, dataN);
% Plot a single ERP waveform
figure
cfg = [];
load 'lay.mat';
cfg.layout = lay; % Set the layout. The layout will always be loaded into the "lay" variable no matter what
% you save the variable as. cfg.layout = lay256 will not work.
clf;
ft_singleplotER(cfg,grandavg);
This code will give you a waveform plot. Click and drag the mouse while continuing to click in order to select a time range. Then, click the selected time range and the headplot of that time range will pop up.
Alternate Quick Method
You can also do a quick check using EEGLAB. This will only give you the plot for a single timepoint instead of a window.
Click Plot --> Channel ERPs --> With scalp maps
Click ok
You can click on the waveforms at any time to see the headplot at that time. You have to click on the waveformd. It won't work if you click on white space.