Documentation: Some Practical Examples of how to use the BBCI Toolbox


IN CONSTRUCTION


Table of Contents

ERP Analysis

% Define some settings

file= 'VPibv_10_11_02/CenterSpellerMVEP_VPibv';
[cnt, mrk, mnt]= eegfile_loadMatlab(file);

% Apply highpass filter to reduce drifts
b= procutil_firlsFilter(0.5, cnt.fs);
cnt= proc_filtfilt(cnt, b);
  
% Artifact rejection based on variance criterion
mrk= reject_varEventsAndChannels(cnt, mrk, disp_ival, 'verbose', 1);

% Segmentation
epo= cntToEpo(cnt, mrk, disp_ival);
  
% Artifact rejection based on maxmin difference criterion on frontal chans
epo= proc_rejectArtifactsMaxMin(epo, crit_maxmin, ...
            'clab',crit_clab, 'ival',crit_ival, 'verbose',1);
epo= proc_baseline(epo, ref_ival);
epo_r= proc_r_square_signed(epo);
  
fig_set(1);
constraint= ...
      {{-1, [100 300], {'I#','O#','PO7,8','P9,10'}, [50 300]}, ...
       {1, [200 350], {'P3-4','CP3-4','C3-4'}, [200 400]}, ...
       {1, [400 500], {'P3-4','CP3-4','C3-4'}, [350 600]}};
[ival_scalps, nfo]= ...
    select_time_intervals(epo_r, 'visualize', 1, 'visu_scalps', 1, ...
                          'title', [sbj ': ' taglist{ff}], ...
                          'clab',{'not','E*','Fp*','AF*'}, ...
                          'ival_pick_peak', [100 600], ...
                          'c_threshold', 0.85, ...
                          'constraint', constraint);
printFigure('r_matrix', [18 13], opt_fig);
ival_scalps= visutil_correctIvalsForDisplay(ival_scalps, 'fs',epo.fs);

fig_set(3)
H= grid_plot(epo, mnt, defopt_erps, 'colorOrder',colOrder);
grid_addBars(epo_r, 'h_scale',H.scale);
printFigure(['erp'], [19 12], opt_fig);

fig_set(2);
H= scalpEvolutionPlusChannel(epo, mnt, clab, ival_scalps, ...
                             defopt_scalp_erp2, ...
                             'colorOrder',colOrder);
grid_addBars(epo_r);
printFigure(['erp_topo'], [20  4+5*size(epo.y,1)], opt_fig);

fig_set(4, 'shrink',[1 2/3]);
scalpEvolutionPlusChannel(epo_r, mnt, clab_rsq, ival_scalps, ...
                          defopt_scalp_r2);
printFigure(['erp_topo_r'], [20 9], opt_fig);

Even in this very basic ERP analysis, there are several steps, in which the choice of processing can have quite a big impact on the results, but nevertheless, the correct choice is not clear to us (maybe we will find out a recommendable choice at some point).