[Eeglablist] How to segment this continuous data into a regular time windows?

James Desjardins jdesjardins at brocku.ca
Mon Dec 16 07:40:40 PST 2013


Hi Eduardo,

The pop_epoch function that is called by eeg_regepochs automatically removes any epochs that contain "boundary" events after it completes the segmentation. This is done because it is almost always inappropriate to have epochs of data that contain discontinuities. I think that the phenomenon that you are seeing is that the epochs containing boundaries are disappearing not the "boundary" event markers themselves.

If you need to leave the discontinuous epochs in (which, does not seem to be the case, and very rarely is the case) you can change the reserved "boundary" names to something different, perform the segmentation, then rename the "boundary" events back to the reserved name.

e.g.

%RENAME "BOUNDARY" EVENTS "TMP_BOUNDARY"
for i=1:length(EEG.event)
    if strcmp(EEG.event(i).type,'boundary')
        EEG.event(i).type='tmp_boundary');
    end
end

%SEGMENT TO REGULAR INTERVALS
EEG=eeg_regepochs(EEG,'recurrence',2,'limits',[-2 0]);
EEG=eeg_checkset(EEG);
eeglab redraw

%RENAME "TMP_BOUNDARY" EVENTS "BOUNDARY"
for i=1:length(EEG.event)
    if strcmp(EEG.event(i).type,'tmp_boundary')
        EEG.event(i).type='boundary');
    end
end


Following this procedure you should be able to then plot your segmented data and see your "boundary" discontinuities.


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: Eduardo Schenberg [edueeg at gmail.com]
Sent: December-16-13 8:03 AM
To: James Desjardins
Cc: Taewon Chung 정태원; eeglablist at sccn.ucsd.edu; 백연지
Subject: Re: [Eeglablist] How to segment this continuous data into a regular time windows?

Hello James,

Thank you very much for that. I have a very similar question as Taewon and this seems to work nice.

However, this code you sent using eeg_regepochs seems to discard previous events created in my EEGLab dataset when I manually selected bad segments of my continuous dataset for deletion (using the standard EEGLab GUI to plot, mark segments and delete). But it is important for me to still know where these events are before, for example, doing FFT on the segmented data

Do you know how to segment data in EEGLab keeping previous events on the dataset?

many thanks

eduardo


Em 26/11/2013, às 02:08, James Desjardins escreveu:

Hi Chung,

There is no menu item for dividing the data into regular intervals yet, but the eeg_regepochs should do what you want from the command line.

The following should come pretty close to producing what you described:

EEG=eeg_regepochs(EEG,'recurrence',2,'limits',[-2 0]);
EEG=eeg_checkset(EEG);
eeglab redraw

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<mailto:eeglablist-bounces at sccn.ucsd.edu> [eeglablist-bounces at sccn.ucsd.edu<mailto:eeglablist-bounces at sccn.ucsd.edu>] on behalf of Taewon Chung 정태원 [tchung215 at gmail.com<mailto:tchung215 at gmail.com>]
Sent: November-22-13 3:44 AM
To: eeglablist at sccn.ucsd.edu<mailto:eeglablist at sccn.ucsd.edu>
Cc: 백연지
Subject: [Eeglablist] How to segment this continuous data into a regular time windows?

Dear all,

I have obtained single continuous EEG data,
and I want to know how to segment this continuous data into a regular time windows from the recording starting point (e.g. 0 ~ 2 sec, 2~ 4, 4 ~ 6, ...) regardless of event markers.
Is there any applicable menu in EEGLAB or function that I can use in the command line?
If there is, please let me know how to go about writing an appropriate script.

Thanks a lot in advance!

Taewon Chung
_______________________________________________
Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu<mailto:eeglablist-unsubscribe at sccn.ucsd.edu>
For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu<mailto:eeglablist-request at sccn.ucsd.edu>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20131216/77e58305/attachment.html>


More information about the eeglablist mailing list