<div dir="ltr"><div><div><div>Hello Senaka,<br><br></div>I think you might be making your life more difficult by trying to directly call edfread(), which is a low-level function. Have you tried just using ft_preprocessing(), the high-level wrapper function, as described in the tutorial on the fieldtrip wiki? In my experience, this function reads EDF data straightforwardly.<br><br></div>Best,<br></div>Steve<br><div><div><div><div><div class="gmail_extra"><br clear="all"><div><div class="gmail_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 href="http://users.ox.ac.uk/~cpgl0080/" target="_blank">http://users.ox.ac.uk/~cpgl0080/</a></span></div></div></div></div></div></div></div>
<br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sun, 20 Dec 2015 17:21:47 +0530<br>
From: Senaka Amarakeerthi <<a href="mailto:senakahks@gmail.com">senakahks@gmail.com</a>><br>
To: <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data<br>
structure.<br>
Message-ID:<br>
<CA+si8qkXe5W7J=<a href="mailto:J-1ensqWCTreAGdsHovwSavJA5sAG6i1nDGg@mail.gmail.com">J-1ensqWCTreAGdsHovwSavJA5sAG6i1nDGg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear all,<br>
<br>
I am new to FieldTrip and trying to process offline Emotive Epoc EEG data.<br>
The file I am trying to process is a single trial.<br>
<br>
The code I tried is:<br>
<br>
%% import data from testbench emotiv edf file<br>
<br>
[hdr, data_eeg] = edfread('emotive.edf');<br>
<br>
<br>
<br>
%% Rearrange data to match FieldTrip Format<br>
<br>
% Remove unnecessary columns<br>
<br>
data.trial = data_eeg([3:16,39], : );<br>
<br>
<br>
<br>
<br>
<br>
% Cell-array containing strings, Nchan X 1<br>
<br>
% Based on <a href="https://emotiv.com/forum/forum14/topic1817/messages/" rel="noreferrer" target="_blank">https://emotiv.com/forum/forum14/topic1817/messages/</a><br>
<br>
data.label = {'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6' 'F4'<br>
'F8' 'AF4' 'MARKER'};<br>
<br>
<br>
<br>
% Sampling frequency in Hz, single number<br>
<br>
data.fsample = 128;<br>
<br>
<br>
<br>
% Setting time<br>
<br>
[x, filelength] = size(data.trial);<br>
<br>
data.time{1} = [1:filelength]./data.fsample;<br>
<br>
%% Using the rearranged data<br>
<br>
<br>
<br>
<br>
<br>
% Set the trial column name and event value (what you enter to the last<br>
column.<br>
<br>
% here enter number 1 as the marker)<br>
<br>
cfg.trialdef.eventtype = 'MARKER';<br>
<br>
cfg.trialdef.eventvalue = 1;<br>
<br>
cfg.trialdef.eventtype = '?';<br>
<br>
ft_definetrial(cfg);<br>
<br>
<br>
%% Preprocessing<br>
<br>
cfg = [];<br>
<br>
cfg.channel = 'AF3';<br>
<br>
cfg.lpfilter = 'yes';<br>
<br>
cfg.hpfilter = 'yes';<br>
<br>
cfg.bsfilter = 'yes';<br>
<br>
cfg.lpfreq = 100;<br>
<br>
cfg.hpfreq = 10;<br>
<br>
cfg.bsfreq = [59 61];<br>
<br>
cfg.lpfiltord = 4;<br>
<br>
cfg.hpfiltord = 4;<br>
<br>
cfg.bpfiltord = 4;<br>
<br>
cfg.lpfilttype = 'but';<br>
<br>
cfg.hpfilttype = 'but';<br>
<br>
ecog = ft_preprocessing(cfg,data);<br>
<br>
<br>
When I run the script. I am getting the following error.<br>
<br>
Error in ft_trialfun_general (line 78)<br>
hdr = ft_read_header(cfg.headerfile, 'headerformat',<br>
cfg.headerformat);<br>
<br>
Do I need to set the header structure as well? Can somebody help me to get<br>
this fixed. I am reading the documentation but it seems start is bit hard!<br>
<br>
Appreciate your support<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151220/7c7feda3/attachment-0001.html" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151220/7c7feda3/attachment-0001.html</a>><br>
<br>
------------------------------<br></blockquote><div> </div></div></div></div></div></div></div></div>