[Eeglablist] save .edf file
Ramón Martinez
nucleuscub at gmail.com
Wed Jul 9 11:26:56 PDT 2014
Hi Chris,
I've been reading your post now and made some very basic testing of what
you describe. Basically, importing and EDF file to eeglab, and then loading
again the file after exporting it.. right?
Well.. this example works for me... let me know any thought about it.
Hope this helps,
Ramon
% Start EEGLAB
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
% Replace this fields with your path and filenames
datapath = '/home/ramon/WORK/EEGLab_bugfix/bug_1523/';
datafilename = '5038.edf';
datafile2save = 'test_export.edf';
% Import EDF using BIOSIG
EEG = pop_biosig([datapath datafilename]);
% Writing the data
pop_writeeeg(EEG, [datapath datafile2save], 'TYPE','EDF');
% Now importing again the saved file
EEG = pop_biosig([datapath datafile2save]);
% This works for me :)
On Wed, Jul 9, 2014 at 9:47 AM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu>
wrote:
> Thanks Chris, that's very good to know. I'll let our developer know about
> it. Sorry for inconvenience and thank you for your help.
>
> Makoto
>
>
> On Wed, Jul 9, 2014 at 7:47 AM, Parker, Christopher <
> christopher.parker.10 at ucl.ac.uk> wrote:
>
>> Dear EEGLab users,
>>
>>
>> If you want to read/write EEG files to disk, you can use these
>> functions posted on Mathworks.
>>
>>
>>
>> http://www.mathworks.co.uk/matlabcentral/fileexchange/36530-read---write-edf+-files/content/lab_write_edf.m
>>
>>
>> The EEGLab writing functions don't work for me.
>>
>>
>> Chris
>>
>>
>>
>> ------------------------------
>> *From:* Makoto Miyakoshi <mmiyakoshi at ucsd.edu>
>> *Sent:* 08 July 2014 17:47
>> *To:* Parker, Christopher; Ramón Martinez
>> *Cc:* eeglablist at sccn.ucsd.edu
>> *Subject:* Re: [Eeglablist] save .edf file
>>
>> Dear Ramon,
>>
>> Here is a file I/O issue.
>>
>> Makoto
>>
>>
>> On Wed, Jul 2, 2014 at 4:05 PM, Parker, Christopher <
>> christopher.parker.10 at ucl.ac.uk> wrote:
>>
>>> Hi,
>>>
>>>
>>> Does anyone know how to save an eeglab structure as a .edf file in
>>> MATLAB? pop_export() doesn't seem to be working for me.
>>>
>>>
>>> I read my .edf file in to MATLAB using:
>>>
>>>
>>> a = pop_biosig(a_filename, 'importevent','off','importannot','off');
>>>
>>>
>>> I now want to make some change to the 'data' field (append data from
>>> another eeg structure) and then save the .edf file with a different
>>> filename.
>>>
>>>
>>> I tried "pop_export(a,'~/test.edf')" which did save a.edf file in the
>>> appropriate place. But it then failed to read back in to MATLAB properly
>>> with pop_biosig(). The following error was displayed:
>>>
>>>
>>> Reading data in unknown format...
>>> Reference to non-existent field 'POS'.
>>>
>>> Error in sread (line 53)
>>> StartPos = HDR.FILE.POS/HDR.SampleRate;
>>>
>>> Error in pop_biosig>readfile (line 224)
>>> DAT=sread(dat, Inf);% this isn't transposed in original!!!!!!!!
>>>
>>> Error in pop_biosig (line 142)
>>> [dat DAT interval] = readfile(filename, g.channels, g.blockrange,
>>> g.memorymapped);
>>>
>>>
>>> I also tried it with an empty structure created by typing "eeglab" in
>>> to the command line. Again, the file saved but could not be read back in to
>>> MATLAB. This gave the error:
>>>
>>>
>>> Reference to non-existent field 'POS'.
>>>
>>> Error in sread (line 53)
>>> StartPos = HDR.FILE.POS/HDR.SampleRate;
>>>
>>> Error in pop_biosig>readfile (line 224)
>>> DAT=sread(dat, Inf);% this isn't transposed in original!!!!!!!!
>>>
>>> Error in pop_biosig (line 142)
>>> [dat DAT interval] = readfile(filename, g.channels, g.blockrange,
>>> g.memorymapped);
>>>
>>>
>>> The saved files also do not open in EDF Browser. Your help with this
>>> would be very much appreciated.
>>>
>>>
>>> Thanks,
>>>
>>> Chris
>>>
>>> _______________________________________________
>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> To unsubscribe, send an empty email to
>>> 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
>>>
>>
>>
>>
>> --
>> Makoto Miyakoshi
>> Swartz Center for Computational Neuroscience
>> Institute for Neural Computation, University of California San Diego
>>
>
>
>
> --
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20140709/67baba29/attachment.html>
More information about the eeglablist
mailing list