[Eeglablist] how to create new data sets based on the number of event

James Desjardins jdesjardins at brocku.ca
Tue Sep 3 07:05:10 PDT 2013


Hi Min Sheng,

I think that it may be easier to rename your events form the command line so that you can segment your conditions separately.

e.g.

If your event labels are 'stim', and you know that the first condition consists of 'stim' events 2-97:

%make sure that the events are stored in chronological order...
EEG=eeg_checkset(EEG,'eventconsistency');

%initiate an event counter...
event_count=0;

%loop through all of the events...
for event_index=1:length(EEG.event)

    %check that the type is 'stim'...
    if strcmp(EEG.event(event_index).type, 'stim')

        %increase the event counter by 1...
        event_count=event_count+1;

        %check that the event counter is in your target range....
        if event_count>1 && event_count<98

            %change the name of your event to include a code for condition 1 (e.g. '_C1')
            EEG.event(event_index).type=[EEG.event(event_index).type,'C1'];

        end

        %break out of the loop after it renames the 97th 'stim' event...
        if event_count==97
            break
        end
    end
end


Once this is done you will be able to segment normally to condition 1 by choosing 'stimC1' event types, and condition 2 by choosing 'stim' event types.



James Desjardins, MA
Electrophysiology Technologist
Cognitive and Affective Neuroscience Lab, Psychology Department
Jack and Nora Walker Centre for Lifespan Development Research
Brock University
500 Glenridge Ave.
St. Catharines, ON, Canada L2S 3A1
905-688-5550 x4676
--
"'Cause you never can tell What goes on down below!
"This pool might be bigger Than you or I know!"

McElligot's Pool
Dr.Seuss 1947
________________________________
From: eeglablist-bounces at sccn.ucsd.edu [eeglablist-bounces at sccn.ucsd.edu] on behalf of Min Sheng [Min.Sheng at utsouthwestern.edu]
Sent: August-30-13 6:01 PM
To: eeglablist at sccn.ucsd.edu
Subject: [Eeglablist] how to create new data sets based on the number of event

Dear all;
I am processing visual ERP data, I have 768 events which under 2 different conditions( room air and hyperoxia). I did not mark these two conditions when record EEG data but I know the time period of each conditons.
Such as from event 2 to  event 97 was under room air. So can I extract this period and create a new dataset to do further analysis? I want to compare ERP under these two conditions.
Thanks
Min Sheng


________________________________

UT Southwestern Medical Center
The future of medicine, today.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20130903/b888e818/attachment.html>


More information about the eeglablist mailing list