<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_ym19_1_1462458822082_7362"><span></span></div><div></div><div id="yui_3_16_0_ym19_1_1462458822082_7363"> Hi,</div><div id="yui_3_16_0_ym19_1_1462458822082_7432">I am trying to concatenate two EDF files in Matlab and convert it back to EDF. (basically sticking the original data to on piece)</div><div id="yui_3_16_0_ym19_1_1462458822082_7433">Here is my code. It does create the 'a' file but it does not open as EDF.</div><div id="yui_3_16_0_ym19_1_1462458822082_7434">Any suggestion?</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462458822082_7435"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7436"></div><div id="yui_3_16_0_ym19_1_1462458822082_7437"></div><div id="yui_3_16_0_ym19_1_1462458822082_7438"> </div><div id="yui_3_16_0_ym19_1_1462458822082_7439"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7440"></div><div id="yui_3_16_0_ym19_1_1462458822082_7441"><div id="yui_3_16_0_ym19_1_1462458822082_7442">clc;</div><div id="yui_3_16_0_ym19_1_1462458822082_7443">clear all;</div><div id="yui_3_16_0_ym19_1_1462458822082_7444">close all;</div><div id="yui_3_16_0_ym19_1_1462458822082_7445">%%</div><div id="yui_3_16_0_ym19_1_1462458822082_7446">[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');</div><div id="yui_3_16_0_ym19_1_1462458822082_7447">file1 = fullfile(pathName1, fileName1);</div><div id="yui_3_16_0_ym19_1_1462458822082_7448">cfg1 = [];</div><div id="yui_3_16_0_ym19_1_1462458822082_7449">%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms</div><div id="yui_3_16_0_ym19_1_1462458822082_7450">cfg1.trialdef.triallength = 5;</div><div id="yui_3_16_0_ym19_1_1462458822082_7451">cfg1.dataset =file1; %'For leila.edf';</div><div id="yui_3_16_0_ym19_1_1462458822082_7452">cfg1= ft_definetrial( cfg1 );</div><div id="yui_3_16_0_ym19_1_1462458822082_7453">cfg1.continuous = 'yes';</div><div id="yui_3_16_0_ym19_1_1462458822082_7454">datastr1 = ft_preprocessing(cfg1);</div><div id="yui_3_16_0_ym19_1_1462458822082_7455">data1=datastr1.trial{1,1};</div><div id="yui_3_16_0_ym19_1_1462458822082_7456"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7457"></div><div id="yui_3_16_0_ym19_1_1462458822082_7458">Fs=datastr1.fsample;</div><div id="yui_3_16_0_ym19_1_1462458822082_7459"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7460"></div><div id="yui_3_16_0_ym19_1_1462458822082_7461">hdr=datastr1.hdr;</div><div id="yui_3_16_0_ym19_1_1462458822082_7462">%%</div><div id="yui_3_16_0_ym19_1_1462458822082_7463"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7464"></div><div id="yui_3_16_0_ym19_1_1462458822082_7465"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7466"></div><div id="yui_3_16_0_ym19_1_1462458822082_7467">[fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');</div><div id="yui_3_16_0_ym19_1_1462458822082_7468">file2 = fullfile(pathName2, fileName2);</div><div id="yui_3_16_0_ym19_1_1462458822082_7469">cfg2 = [];</div><div id="yui_3_16_0_ym19_1_1462458822082_7470">%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms</div><div id="yui_3_16_0_ym19_1_1462458822082_7471">cfg2.trialdef.triallength = 5;</div><div id="yui_3_16_0_ym19_1_1462458822082_7472">cfg2.dataset =file2; %'For leila.edf';</div><div id="yui_3_16_0_ym19_1_1462458822082_7473">cfg2= ft_definetrial( cfg2 );</div><div id="yui_3_16_0_ym19_1_1462458822082_7474">cfg2.continuous = 'yes';</div><div id="yui_3_16_0_ym19_1_1462458822082_7475">datastr2 = ft_preprocessing(cfg2);</div><div id="yui_3_16_0_ym19_1_1462458822082_7476"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7477"></div><div id="yui_3_16_0_ym19_1_1462458822082_7478">data2=datastr2.trial{1,1};</div><div id="yui_3_16_0_ym19_1_1462458822082_7479"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7480"></div><div id="yui_3_16_0_ym19_1_1462458822082_7481">Fs2=datastr2.fsample;</div><div id="yui_3_16_0_ym19_1_1462458822082_7482"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7483"></div><div id="yui_3_16_0_ym19_1_1462458822082_7484">% EEG=cat(2,data1,data2)</div><div id="yui_3_16_0_ym19_1_1462458822082_7485">% EEG=EEG';</div><div id="yui_3_16_0_ym19_1_1462458822082_7486">% HDR=hdr1</div><div id="yui_3_16_0_ym19_1_1462458822082_7487">% out=EDFCreator(EEG);</div><div id="yui_3_16_0_ym19_1_1462458822082_7488"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7489"></div><div id="yui_3_16_0_ym19_1_1462458822082_7490">dat = cat(2,data1,data2);</div><div id="yui_3_16_0_ym19_1_1462458822082_7491">%%</div><div id="yui_3_16_0_ym19_1_1462458822082_7492">% write_edf('a', hdr, dat);</div><div id="yui_3_16_0_ym19_1_1462458822082_7493"><br clear="none" id="yui_3_16_0_ym19_1_1462458822082_7494"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462458822082_7495">ft_write_data('a', dat, 'header', hdr,'dataformat','edf' )</div></div><div id="yui_3_16_0_ym19_1_1462458822082_7496"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462458822082_7497"> </div><div class="signature" id="yui_3_16_0_ym19_1_1462458822082_7504"><div id="yui_3_16_0_ym19_1_1462458822082_7503"><font color="#000000" id="yui_3_16_0_ym19_1_1462458822082_7502"><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_ym19_1_1462458822082_7501"><span style="" id="yui_3_16_0_ym19_1_1462458822082_7500"><font face="times new roman, new york, times, serif" id="yui_3_16_0_ym19_1_1462458822082_7499"><font size="2" id="yui_3_16_0_ym19_1_1462458822082_7498">__________________________________________________</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_ym19_1_1462458822082_7507"><span style="" id="yui_3_16_0_ym19_1_1462458822082_7506"><font face="times new roman, new york, times, serif" id="yui_3_16_0_ym19_1_1462458822082_7505"><font size="2" id="yui_3_16_0_ym19_1_1462458822082_7508">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_ym19_1_1462458822082_7509"><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_ym19_1_1462458822082_7510"><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_ym19_1_1462458822082_7511"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1462458822082_7515" style="display: block;">  <div style="font-family: garamond, new york, times, serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1462458822082_7514"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1462458822082_7513"> <div dir="ltr" id="yui_3_16_0_ym19_1_1462458822082_7512"> <font size="2" face="Arial" id="yui_3_16_0_ym19_1_1462458822082_7516"> <hr size="1"> <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> Monday, December 21, 2015 11:39 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [FieldTrip] importing large edf data<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1462458822082_7517"><br><div id="yiv8294131267"><div dir="ltr" id="yui_3_16_0_ym19_1_1462458822082_7521"><div id="yui_3_16_0_ym19_1_1462458822082_7520"><div id="yui_3_16_0_ym19_1_1462458822082_7519"><div id="yui_3_16_0_ym19_1_1462458822082_7518">Hi Leila,<br><br>cfg.trialdef.triallength is a parameter for ft_definetrial(), which is not needed if all you want to do is read a single segment of continuous data based on predetermined latencies; you may notice that, in the sample code snippets I sent in my last message, I did not use this function at all, I just hard-coded the latency range in cfg.trl (and then passed this cfg structure to ft_preprocessing() ). So, if this is all you need to do, there is no need to worry about these additional parameters.<br><br></div>If you are trying to read multiple segments of data as separate epochs into one dataset (which is what you would accomplish by using cfg.trialdef.triallength = 1 and ft_definetrial() ), then I'm not sure why it's not working for you at the moment; I would have to see your code to be able to diagnose what might be going on.<br><br></div>Best,<br></div>Steve<br><div><div><div><div><div class="yiv8294131267gmail_extra"><br clear="all"><div><div class="yiv8294131267gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div><br><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="yiv8294131267gmail_quote"><div> </div><blockquote class="yiv8294131267gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">
<br>
Message: 2<br>
Date: Mon, 21 Dec 2015 09:36:27 +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: FieldTrip discussion list <<a rel="nofollow" ymailto="mailto:fieldtrip@science.ru.nl" target="_blank" href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>><br>
Subject: Re: [FieldTrip] importing large edf data<br>
Message-ID:<br>
        <<a rel="nofollow" ymailto="mailto:1459455402.1301519.1450690587900.JavaMail.yahoo@mail.yahoo.com" target="_blank" href="mailto:1459455402.1301519.1450690587900.JavaMail.yahoo@mail.yahoo.com">1459455402.1301519.1450690587900.JavaMail.yahoo@mail.yahoo.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi Steve,Thanks for checking for me. You are indeed right. Not sure why I got a different result at first.<br>
But now I see thecfg2.trialdef.triallength = 1;?<br>
there is no difference in the way data is loaded once I change the number to let's say 5! Where should I see that difference??Thanks again.Kind regards<br>
?__________________________________________________ Leila Ayoubian, PhD.<br>
Institute of Psychiatry, Psychology and Neuroscience<br>
King's College London<br>
<br>
<br>
<br>
<br>
<br>
      From: Stephen Politzer-Ahles <<a rel="nofollow" ymailto="mailto:stephen.politzer-ahles@ling-phil.ox.ac.uk" target="_blank" href="mailto:stephen.politzer-ahles@ling-phil.ox.ac.uk">stephen.politzer-ahles@ling-phil.ox.ac.uk</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><br>
 Sent: Saturday, December 19, 2015 2:06 PM<br>
 Subject: Re: [FieldTrip] importing large edf data<br>
<br>
Hi Leila,<br>
<br>
I'm not sure why it didn't work for you. I tried the following code (on a sample EDF file I found at <a rel="nofollow" target="_blank" href="http://www.teuniz.net/edf_bdf_testfiles/">http://www.teuniz.net/edf_bdf_testfiles/</a>) and it worked perfectly for me:<br>
<br>
<br>
cfg = [];<br>
cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf';<br>
cfg.trl = [1 500 0];<br>
cfg.continuous = 'yes';<br>
data_500samples = ft_preprocessing(cfg);<br>
<br>
cfg = [];<br>
cfg.dataset = 'C:\Users\Spolitzerahles\Desktop\ma0844az_1-1+.edf';<br>
cfg.trl = [1 1000 0];<br>
cfg.continuous = 'yes';<br>
data_1000samples = ft_preprocessing(cfg);<br>
<br>
<br>
<br>
Here's the output:<br>
>> data_500samples<br>
<br>
data_500samples =<br>
<br>
?????????? hdr: [1x1 struct]<br>
???????? label: {37x1 cell}<br>
????????? time: {[1x500 double]}<br>
???????? trial: {[37x500 double]}<br>
?????? fsample: 200<br>
??? sampleinfo: [1 500]<br>
?????????? cfg: [1x1 struct]<br>
<br>
>> data_1000samples<br>
<br>
data_1000samples =<br>
<br>
?????????? hdr: [1x1 struct]<br>
???????? label: {37x1 cell}<br>
????????? time: {[1x1000 double]}<br>
???????? trial: {[37x1000 double]}<br>
?????? fsample: 200<br>
??? sampleinfo: [1 1000]<br>
?????????? cfg: [1x1 struct]<br>
<br>
<br>
Best,<br>
Steve<br>
<br>
<br>
<br>
<br>
---<br>
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>?<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Fri, 18 Dec 2015 13:40:59 +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: FieldTrip discussion list <<a rel="nofollow" ymailto="mailto:fieldtrip@science.ru.nl" target="_blank" href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>><br>
Subject: Re: [FieldTrip] importing large edf data<br>
Message-ID:<br>
? ? ? ? <<a rel="nofollow" ymailto="mailto:2054001626.533069.1450446059200.JavaMail.yahoo@mail.yahoo.com" target="_blank" href="mailto:2054001626.533069.1450446059200.JavaMail.yahoo@mail.yahoo.com">2054001626.533069.1450446059200.JavaMail.yahoo@mail.yahoo.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
?Thanks Steve for your reply.I think your code for segmenting the data is the way to go for me ! :) And I do appreciate you gave me an example.? Thanks<br>
However I tried it with two different cfg.trl = [1 1000 0]; and cfg.trl = [1 10000 0]; to see the results, and it looked the same!<br>
<br>
So this is what I get:<br>
<br>
<br>
?? hdr: [1x1 struct]<br>
???????? label: {51x1 cell}<br>
????????? time: {1x50710 cell}<br>
???????? trial: {1x50710 cell}<br>
?????? fsample: 1024<br>
??? sampleinfo: [50710x2 double]<br>
?????????? cfg: [1x1 struct]<br>
<br>
so the actual data which is in data.trial? is this in both cases!<br>
size(data.trial)<br>
<br>
ans =<br>
<br>
?????????? 1?????? 50710<br>
<br>
How could that happen if you are segmenting it in two different chunks?<br>
Best regards<br>
<br>
___________________________________________________ Leila Ayoubian<br>
<br>
<br>
<br>
? ? ? From: Stephen Politzer-Ahles <<a rel="nofollow" ymailto="mailto:stephen.politzer-ahles@ling-phil.ox.ac.uk" target="_blank" href="mailto:stephen.politzer-ahles@ling-phil.ox.ac.uk">stephen.politzer-ahles@ling-phil.ox.ac.uk</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><br>
?Sent: Friday, December 18, 2015 12:37 PM<br>
?Subject: Re: [FieldTrip] importing large edf data<br>
<br>
Hello Leila,<br>
<br>
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">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>
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>
cfg.trl = [1 1000 0];<br>
<br>
and then use ft_preprocessing.<br>
<br>
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>
<br>
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>
Best,<br>
Steve<br>
<br>
---<br>
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><br>
On Fri, Dec 18, 2015 at 11:00 AM, <<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>> wrote:<br>
<br>
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>
<br>
<br></blockquote><div> </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>