<html><head></head><body><div style="color:#000; background-color:#fff; font-family:garamond, new york, times, serif;font-size:16px"><div id="yui_3_16_0_1_1454932058613_9128">Hi Stephen:</div><div id="yui_3_16_0_1_1454932058613_9128" dir="ltr">I just happen to realize that when I load the data as you mentioned below, I can not get hold of the real time of the EEG file. (e.g.18:32:43 ).</div><div id="yui_3_16_0_1_1454932058613_9128" dir="ltr">Could you please point out as how I could retrieve the real time of the EEG file after loading.</div><div id="yui_3_16_0_1_1454932058613_9128" dir="ltr"><br></div><div id="yui_3_16_0_1_1454932058613_9128" dir="ltr">Thanks a lot.</div><div id="yui_3_16_0_1_1454932058613_9128" dir="ltr">Kind regards</div><div id="yui_3_16_0_1_1454932058613_9128" dir="ltr"><br></div><div class="signature" id="yui_3_16_0_1_1454932058613_9136"><div id="yui_3_16_0_1_1454932058613_9135"><font color="#000000" id="yui_3_16_0_1_1454932058613_9134"><div style="font-family:'bookman old style', 'new york', times, serif;margin-top:0cm;margin-right:0cm;margin-bottom:0pt;margin-left:0cm;" class="MsoPlainText" id="yui_3_16_0_1_1454932058613_9133"><span style="" id="yui_3_16_0_1_1454932058613_9132"><font face="times new roman, new york, times, serif" id="yui_3_16_0_1_1454932058613_9131"><font size="2" id="yui_3_16_0_1_1454932058613_9130">__________________________________________________</font></font></span></div> <div style="font-family:'bookman old style', 'new york', times, serif;margin-top:0cm;margin-right:0cm;margin-bottom:0pt;margin-left:0cm;" class="MsoPlainText" id="yui_3_16_0_1_1454932058613_9140"><span style="" id="yui_3_16_0_1_1454932058613_9139"><font face="times new roman, new york, times, serif" id="yui_3_16_0_1_1454932058613_9138"><font size="2" id="yui_3_16_0_1_1454932058613_9137">Leila Ayoubian, PhD.<br>Institute of Psychiatry, Psychology and Neuroscience<br>King's College London<br></font></font></span></div> <div style="margin-top:0cm;margin-right:0cm;margin-bottom:0pt;margin-left:0cm;" class="MsoPlainText" id="yui_3_16_0_1_1454932058613_9141"><font class="Apple-style-span" size="2" face="'times new roman', 'new york', times, serif"><br></font></div></font></div><div style="MARGIN:0cm 0cm 0pt;" class="MsoPlainText" id="yui_3_16_0_1_1454932058613_9160"><font color="#000000"><font style="" face="bookman old style, new york, times, serif"><font face="bookman old style, new york, times, serif"><font color="#000000"><span style="color:rgb(84, 140, 214);font-size:9pt;font-family:Arial;" lang="EN-US"><span style="font-size:10pt;font-family:sans-serif;"><br></span></span></font></font></font></font></div></div><div class="qtdSeparateBR" id="yui_3_16_0_1_1454932058613_9161"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_1_1454932058613_9152" style="display: block;">  <div style="font-family: garamond, new york, times, serif; font-size: 16px;" id="yui_3_16_0_1_1454932058613_9151"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1454932058613_9150"> <div dir="ltr" id="yui_3_16_0_1_1454932058613_9162"> <font size="2" face="Arial" id="yui_3_16_0_1_1454932058613_9192"> <hr size="1" id="yui_3_16_0_1_1454932058613_9191"> <b><span style="font-weight:bold;">From:</span></b> Stephen Politzer-Ahles <stephen.politzer-ahles@ling-phil.ox.ac.uk><br> <b><span style="font-weight: bold;">To:</span></b> fieldtrip@science.ru.nl <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, December 18, 2015 12:37 PM<br> <b id="yui_3_16_0_1_1454932058613_9299"><span style="font-weight: bold;" id="yui_3_16_0_1_1454932058613_9298">Subject:</span></b> Re: [FieldTrip] importing large edf data<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1454932058613_9149"><br><div id="yiv0974683004"><div dir="ltr" id="yui_3_16_0_1_1454932058613_9159"><div id="yui_3_16_0_1_1454932058613_9158"><div id="yui_3_16_0_1_1454932058613_9157"><div id="yui_3_16_0_1_1454932058613_9156"><div id="yui_3_16_0_1_1454932058613_9155"><div id="yui_3_16_0_1_1454932058613_9293">Hello Leila,<br><br></div>I think there are a few possible options for you. If you're not interested in analyzing high frequencies, then you could import the data one sample at a time, downsampling each channel, and then concatenate the channels into one structure, as described in <a rel="nofollow" target="_blank" href="http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory" id="yui_3_16_0_1_1454932058613_9294">http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory</a>. I don't know what your sampling rate was, but if your sampling rate was extremely high then this can save you a lot of space. For example, if you're only interested in frequencies up to high gamma (around 90-100 Hz), then your data only need to be sampled at around 250 Hz (per the Nyquist theorem, plus a little extra wiggle room), so if you sampled at e.g. 2500 Hz (which our EDF system does by default) or 5000 Hz then you have way more samples than necessary; downsampling like this will greatly reduce your array size.<br><br><br><br></div>If that is not an option, then you can read in a segment of data as a 'trial'. ft_preprocessing understands trial start and end times from cfg.trl, which minimally is an Nx3 matrix (N is the number of trials to read, and the columns are the start sample for each trial, the end sample for each trial, and the trigger value associated with the trial; you could just put 0 if there's no trigger). So let's say you want to read the first through thousandth sample of the recording, then you would set up your cfg as normal, then add:<br><br></div>cfg.trl = [1 1000 0];<br><br></div>and then use ft_preprocessing. <br><br></div>By way of example, here is code that reads in raw data as a series of 1-second "trials":<br><br>cfg = [];<br>cfg.dataset = 'C:\Users\Steve\Desktop\subj2.vhdr';<br>cfg.trialdef.triallength = 1; % see documentation for ft_definetrial for an explanation of these parameters<br>cfg.trialdef.ntrials = Inf;<br>cfg = ft_definetrial( cfg );<br><br>cfg.continuous = 'yes';<br>data = ft_preprocessing(cfg);<br><div><div><div><div><div><div><div class="yiv0974683004gmail_extra"><br clear="all"><div><div class="yiv0974683004gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div>After doing whatever you need to these trials, you could concatenate them back into continuous data (see <a rel="nofollow" target="_blank" href="http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html">http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003971.html</a> for details).<br><br></div><div>Best,<br></div><div>Steve<br></div><div><br>---<br></div>Stephen Politzer-Ahles<br>University of Oxford<br>Language and Brain Lab<br>Faculty of Linguistics, Phonetics & Philology<br><a rel="nofollow" target="_blank" href="http://users.ox.ac.uk/~cpgl0080/">http://users.ox.ac.uk/~cpgl0080/</a></span></div></div></div></div></div></div></div>
<br><div class="yiv0974683004gmail_quote">On Fri, Dec 18, 2015 at 11:00 AM,  <span dir="ltr"><<a rel="nofollow" ymailto="mailto:fieldtrip-request@science.ru.nl" target="_blank" href="mailto:fieldtrip-request@science.ru.nl">fieldtrip-request@science.ru.nl</a>></span> wrote:<br><blockquote class="yiv0974683004gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">Send fieldtrip mailing list submissions to<br>
        <a rel="nofollow" ymailto="mailto:fieldtrip@science.ru.nl" target="_blank" href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a rel="nofollow" target="_blank" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a rel="nofollow" ymailto="mailto:fieldtrip-request@science.ru.nl" target="_blank" href="mailto:fieldtrip-request@science.ru.nl">fieldtrip-request@science.ru.nl</a><br>
<br>
You can reach the person managing the list at<br>
        <a rel="nofollow" ymailto="mailto:fieldtrip-owner@science.ru.nl" target="_blank" href="mailto:fieldtrip-owner@science.ru.nl">fieldtrip-owner@science.ru.nl</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of fieldtrip digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. importing large edf data (Leila Ayoubian)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 18 Dec 2015 09:43:43 +0000 (UTC)<br>
From: Leila Ayoubian <<a rel="nofollow" ymailto="mailto:leilayou_54@yahoo.com" target="_blank" href="mailto:leilayou_54@yahoo.com">leilayou_54@yahoo.com</a>><br>
To: "<a rel="nofollow" ymailto="mailto:fieldtrip@science.ru.nl" target="_blank" href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>" <<a rel="nofollow" ymailto="mailto:fieldtrip@science.ru.nl" target="_blank" href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>><br>
Subject: [FieldTrip] importing large edf data<br>
Message-ID:<br>
        <<a rel="nofollow" ymailto="mailto:807603762.476165.1450431823359.JavaMail.yahoo@mail.yahoo.com" target="_blank" href="mailto:807603762.476165.1450431823359.JavaMail.yahoo@mail.yahoo.com">807603762.476165.1450431823359.JavaMail.yahoo@mail.yahoo.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi:Thanks for providing us with this amazing toolbox.<br>
I am new to fieldtrip. I am trying to import EEG data in the format of *.edf for the purpose of seizure detection for epileptic patients. I can't break up the data as you understand the detection has to have continuous data. However I could load section of the data at a time and clear what is already used and reload again.?<br>
So trying to load the data like this:<br>
cfg.dataset= ('mydata.edf');<br>
rawdata=ft_preprocessing(cfg);<br>
This is the error message I get :<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
Error using zeros<br>
Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time<br>
and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.<br>
<br>
Error in read_edf (line 403)<br>
? dat = zeros(length(chanindx),nepochs*epochlength);<br>
<br>
Error in ft_read_data (line 622)<br>
??? dat = read_edf(filename, hdr, begsample, endsample, chanindx);<br>
<br>
Error in ft_preprocessing (line 566)<br>
????? dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary',<br>
????? strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat);<br>
<br>
Error in ReadFedfiles (line 8)<br>
rawdata=ft_preprocessing(cfg);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
I tried the ft_redefinetrial, but since the input to this file is the output from ft-PREPROCESSING it gives me the same error.<br>
<br>
<br>
I also tried to use ft_read_data to choose the samples I want to load :?filename???? = 'mydata.edf'<br>
?hdr?? = ft_read_header(filename);<br>
?sample.start=1<br>
?sample.end=100<br>
dat = ft_read_data(filename,'sample.start','1','sample.end','100')<br>
and here is again the error message:<br>
Error using zeros<br>
Requested 51x51927040 (19.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a<br>
long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.<br>
<br>
Error in read_edf (line 403)<br>
? dat = zeros(length(chanindx),nepochs*epochlength);<br>
<br>
Error in ft_read_data (line 622)<br>
??? dat = read_edf(filename, hdr, begsample, endsample, chanindx);<br>
<br>
Error in ReadFedfiles (line 31)<br>
dat = ft_read_data(filename,'sample.start','1','sample.end','100')<br>
?<br>
>><br>
<br>
Could you please direct me as to which functions and in which order I should be using the functions to load data in smaller samples.Some examples would be useful.<br>
Thanks again for your support and assistance.<br>
We appreciate your effort.<br>
Kind regards<br>
<br>
___________________________________________________ Dr. Leila Ayoubian<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a rel="nofollow" target="_blank" href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html">http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151218/6dfa7ce1/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a rel="nofollow" ymailto="mailto:fieldtrip@donders.ru.nl" target="_blank" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a rel="nofollow" target="_blank" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<br>
End of fieldtrip Digest, Vol 61, Issue 14<br>
*****************************************<br>
</blockquote></div><br></div></div></div></div></div></div></div></div></div><br>_______________________________________________<br>fieldtrip mailing list<br><a ymailto="mailto:fieldtrip@donders.ru.nl" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br><br></div> </div> </div>  </div></div></body></html>