<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_1462281996191_8228">Hi,</div><div id="yui_3_16_0_ym19_1_1462281996191_8229">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_1462281996191_8230">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_1462281996191_8231">Any suggestion?</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462281996191_8232"><br></div><div id="yui_3_16_0_ym19_1_1462281996191_8233"></div><div id="yui_3_16_0_ym19_1_1462281996191_8234"> </div><div id="yui_3_16_0_ym19_1_1462281996191_8235"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8236"></div><div id="yui_3_16_0_ym19_1_1462281996191_8237"><div id="yui_3_16_0_ym19_1_1462281996191_8238">clc;</div><div id="yui_3_16_0_ym19_1_1462281996191_8239">clear all;</div><div id="yui_3_16_0_ym19_1_1462281996191_8240">close all;</div><div id="yui_3_16_0_ym19_1_1462281996191_8241">%%</div><div id="yui_3_16_0_ym19_1_1462281996191_8242">[fileName1, pathName1] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');</div><div id="yui_3_16_0_ym19_1_1462281996191_8243">file1 = fullfile(pathName1, fileName1);</div><div id="yui_3_16_0_ym19_1_1462281996191_8244">cfg1 = [];</div><div id="yui_3_16_0_ym19_1_1462281996191_8245">%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms</div><div id="yui_3_16_0_ym19_1_1462281996191_8246">cfg1.trialdef.triallength = 5;</div><div id="yui_3_16_0_ym19_1_1462281996191_8247">cfg1.dataset =file1; %'For leila.edf';</div><div id="yui_3_16_0_ym19_1_1462281996191_8248">cfg1= ft_definetrial( cfg1 );</div><div id="yui_3_16_0_ym19_1_1462281996191_8249">cfg1.continuous = 'yes';</div><div id="yui_3_16_0_ym19_1_1462281996191_8250">datastr1 = ft_preprocessing(cfg1);</div><div id="yui_3_16_0_ym19_1_1462281996191_8251">data1=datastr1.trial{1,1};</div><div id="yui_3_16_0_ym19_1_1462281996191_8252"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8253"></div><div id="yui_3_16_0_ym19_1_1462281996191_8254">Fs=datastr1.fsample;</div><div id="yui_3_16_0_ym19_1_1462281996191_8255"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8256"></div><div id="yui_3_16_0_ym19_1_1462281996191_8257">hdr=datastr1.hdr;</div><div id="yui_3_16_0_ym19_1_1462281996191_8258">%%</div><div id="yui_3_16_0_ym19_1_1462281996191_8259"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8260"></div><div id="yui_3_16_0_ym19_1_1462281996191_8261"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8262"></div><div id="yui_3_16_0_ym19_1_1462281996191_8263">[fileName2, pathName2] = uigetfile({'*.edf;*.e', 'Nicolete files (*.edf;*.e)'; '*.*', 'All files (*.*)'}, 'Select edf file');</div><div id="yui_3_16_0_ym19_1_1462281996191_8264">file2 = fullfile(pathName2, fileName2);</div><div id="yui_3_16_0_ym19_1_1462281996191_8265">cfg2 = [];</div><div id="yui_3_16_0_ym19_1_1462281996191_8266">%cfg.trl = [1 1000 0];%45min*60=2700 sec % 2700sec*1000=2700000 ms</div><div id="yui_3_16_0_ym19_1_1462281996191_8267">cfg2.trialdef.triallength = 5;</div><div id="yui_3_16_0_ym19_1_1462281996191_8268">cfg2.dataset =file2; %'For leila.edf';</div><div id="yui_3_16_0_ym19_1_1462281996191_8269">cfg2= ft_definetrial( cfg2 );</div><div id="yui_3_16_0_ym19_1_1462281996191_8270">cfg2.continuous = 'yes';</div><div id="yui_3_16_0_ym19_1_1462281996191_8271">datastr2 = ft_preprocessing(cfg2);</div><div id="yui_3_16_0_ym19_1_1462281996191_8272"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8273"></div><div id="yui_3_16_0_ym19_1_1462281996191_8274">data2=datastr2.trial{1,1};</div><div id="yui_3_16_0_ym19_1_1462281996191_8275"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8276"></div><div id="yui_3_16_0_ym19_1_1462281996191_8277">Fs2=datastr2.fsample;</div><div id="yui_3_16_0_ym19_1_1462281996191_8278"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8279"></div><div id="yui_3_16_0_ym19_1_1462281996191_8280">% EEG=cat(2,data1,data2)</div><div id="yui_3_16_0_ym19_1_1462281996191_8281">% EEG=EEG';</div><div id="yui_3_16_0_ym19_1_1462281996191_8282">% HDR=hdr1</div><div id="yui_3_16_0_ym19_1_1462281996191_8283">% out=EDFCreator(EEG);</div><div id="yui_3_16_0_ym19_1_1462281996191_8284"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8285"></div><div id="yui_3_16_0_ym19_1_1462281996191_8286">dat = cat(2,data1,data2);</div><div id="yui_3_16_0_ym19_1_1462281996191_8287">%%</div><div id="yui_3_16_0_ym19_1_1462281996191_8288">% write_edf('a', hdr, dat);</div><div id="yui_3_16_0_ym19_1_1462281996191_8289"><br clear="none" id="yui_3_16_0_ym19_1_1462281996191_8290"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462281996191_8291">ft_write_data('a', dat, 'header', hdr,'dataformat','edf' )</div></div><div></div><div> </div><div class="signature"><div><font color="#000000"><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"><span style=""><font face="times new roman, new york, times, serif"><font size="2">__________________________________________________</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"><span style=""><font face="times new roman, new york, times, serif"><font size="2">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"><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"><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"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: garamond, new york, times, serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> <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> Wednesday, February 10, 2016 11:20 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"><br><div id="yiv0124166169"><div dir="ltr"><div>Hi Leila (and Arjen):<br><br></div>I just tried this out with a sample file, it looks like you can get this information if you use ft_read_header() rather than ft_preprocessing. The cfg structure I got from ft_preprocessing didn't contain the time-of-day information, but the structure returned from ft_read_header did:<br><br>>> hdr = ft_read_header( cfg.dataset ); hdr.orig.T0<br><br>ans =<br><br> 2005 9 15 10 18 42<br><div><div><div class="yiv0124166169gmail_extra"><br clear="all"><div><div class="yiv0124166169gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div><br><br></div><div>I assume that's showing year, month, day, hour, minute (presumably based on the clock of the computer that made the recording).<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>
<div class="yiv0124166169gmail_quote"><div> </div><blockquote class="yiv0124166169gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">
<br>
Message: 3<br>
Date: Tue, 9 Feb 2016 15:40:35 +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:1722640118.1244946.1455032435939.JavaMail.yahoo@mail.yahoo.com" target="_blank" href="mailto:1722640118.1244946.1455032435939.JavaMail.yahoo@mail.yahoo.com">1722640118.1244946.1455032435939.JavaMail.yahoo@mail.yahoo.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Thanks.I need to retrieve the time when the recordings occure and I don't see it. I get the Fs but no more.I am using this code :<br>
cfg = [];cfg.trl = [1 1000000 0];%cfg.trl = [100001 2000000 0];%cfg.trialdef.triallength = 5;cfg.dataset =fileName; %'For leila.edf';cfg= ft_definetrial( cfg );cfg.continuous = 'yes';<br>
datastr = ft_preprocessing(cfg);data=datastr.trial{1,1};chanls=datastr.label;Fs=datastr.fsample;<br>
and getting this?datastr =?<br>
? ? ? ? ? ?hdr: [1x1 struct]? ? ? ? ?label: {65x1 cell}? ? ? ? ? time: {[1x1000000 double]}? ? ? ? ?trial: {[65x1000000 double]}? ? ? ?fsample: 1024? ? sampleinfo: [1 1000000]? ? ? ? ? ?cfg: [1x1 struct]<br>
<br>
cfg =?<br>
? ? ? ? ? ? ? ? ? trl: [1 1000000 0]? ? ? ? ? ? ? dataset: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? trackconfig: 'off'? ? ? ? ? checkconfig: 'loose'? ? ? ? ? ? checksize: 100000? ? ? ? ?showcallinfo: 'yes'? ? ? ? ? ? ? ? debug: 'no'? ? outputfilepresent: 'overwrite'? ? ? ? trackcallinfo: 'yes'? ? ? ? trackdatainfo: 'no'? ? ? ? ? ? ?callinfo: [1x1 struct]? ? ? ? ? ? ? version: [1x1 struct]? ? ? ? ? ? ?datafile: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? ?headerfile: 'Event13_Seizure_triggered_by_cortical_stim_Segment_1.edf'? ? ? ? ? ?dataformat: 'edf'? ? ? ? ?headerformat: 'edf'? ? ? ? ? ? ? ? event: []? ? ? ? ? ?continuous: 'yes'<br>
<br>
?__________________________________________________ Leila Ayoubian, PhD.<br>
Institute of Psychiatry, Psychology and Neuroscience<br>
King's College London<br>
<br>
<br>
<br>
<br>
From: Arjen Stolk <<a rel="nofollow" ymailto="mailto:a.stolk8@gmail.com" target="_blank" href="mailto:a.stolk8@gmail.com">a.stolk8@gmail.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>
Sent: Tuesday, February 9, 2016 3:32 PM<br>
Subject: Re: [FieldTrip] importing large edf data<br>
<br>
Hi both,There might be information on the date and time of recording in the orig field of the header, if that's what you're looking for. Don't know the name of the subfield from the top of my head.Arjen<br><br></blockquote></div><br></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>