[Eeglablist] Contralateral and Ipsilateral waveforms

Mikołaj Magnuski imponderabilion at gmail.com
Sun Mar 17 05:40:09 PDT 2013


Dear Dwight,

CDA should be pretty robust, did you try to first look at
single-subject ERPs? It may give you a clue to why you
don't observe a regular CDA.

Unfortunately, I do not know ERPlab, so the syntax of
your code does not tell me much, but plotting ERPs for
your subjects is pretty easy to do either in matlab or
through EEGlab gui.

You can for example try the following code:

% I assume that all your events are in EEGlab, and
% all are signalling the onset of the stimulus that has
% to be held in memory, and that the last character
% of event type is either 'l' or 'r' corresponding to the
% attended hemifield.
% I also assume that the data are epoched.
% If these assumptions are wrong, tell me :)

% looking for left and right attended stimuli:
types = {EEG.event.type};
hemif = cellfun(@(x) x(end), types, 'UniformOutput', false);

lefthem = strcmp('l', hemif);
righthem = strcmp('r', hemif);

% now we will be filling a matrix with relevant epochs
% for example: if left hemifield --> right electrode
% below, the electrodes vector has the form:
% electrodes = [left_electrode, right_electrode];
% so you have to change electrode numbers
% to the electrodes you want to compare

electrodes = [2, 3];

len = sum([lefthem, righthem]);

ERPs_contra = zeros(len, EEG.pnts);
ERPs_ipsi = zeros(len, EEG.pnts);

% left hemifield --> right electrode:
lenl = sum(lefthem);
ERPs_contra(1:lenl, :) = squeeze(EEG.data(electrodes(2), :, lefthem))';
EPRs_ipsi(1:lenl, :) = squeeze(EEG.data(electrodes(1), :, lefthem))';

%  right hemifield --> left electrode:
ERPs_contra(lenl+1:end, :) = squeeze(EEG.data(electrodes(1), :, righthem))';
ERPs_ipsi(lenl+1:end, :) = squeeze(EEG.data(electrodes(2), :, righthem))';

% plotting:
plot(EEG.times, mean(ERPs_contra), 'LineWidth', 1.5, 'Color', [0.3, 0.3,
0.3]);
hold on;
plot(EEG.times, mean(ERPs_ipsi), 'LineWidth', 1.5, 'Color', [0.7, 0.7,
0.7]);
title(EEG.setname); legend('contralateral', 'ipsilateral');

% END of CODE


Let me know if this helps.
This can also be augmented with a loop that
goes through all the subjects, so that you don't
have to load subjects manually.

Good Luck!
Mikolaj Magnuski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20130317/a216e91e/attachment.html>


More information about the eeglablist mailing list