[FieldTrip] Adjsting Emotive EEG data to FieldTrip data structure.
Senaka Amarakeerthi
senakahks at gmail.com
Sun Dec 20 12:51:47 CET 2015
Dear all,
I am new to FieldTrip and trying to process offline Emotive Epoc EEG data.
The file I am trying to process is a single trial.
The code I tried is:
%% import data from testbench emotiv edf file
[hdr, data_eeg] = edfread('emotive.edf');
%% Rearrange data to match FieldTrip Format
% Remove unnecessary columns
data.trial = data_eeg([3:16,39], : );
% Cell-array containing strings, Nchan X 1
% Based on https://emotiv.com/forum/forum14/topic1817/messages/
data.label = {'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6' 'F4'
'F8' 'AF4' 'MARKER'};
% Sampling frequency in Hz, single number
data.fsample = 128;
% Setting time
[x, filelength] = size(data.trial);
data.time{1} = [1:filelength]./data.fsample;
%% Using the rearranged data
% Set the trial column name and event value (what you enter to the last
column.
% here enter number 1 as the marker)
cfg.trialdef.eventtype = 'MARKER';
cfg.trialdef.eventvalue = 1;
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
%% Preprocessing
cfg = [];
cfg.channel = 'AF3';
cfg.lpfilter = 'yes';
cfg.hpfilter = 'yes';
cfg.bsfilter = 'yes';
cfg.lpfreq = 100;
cfg.hpfreq = 10;
cfg.bsfreq = [59 61];
cfg.lpfiltord = 4;
cfg.hpfiltord = 4;
cfg.bpfiltord = 4;
cfg.lpfilttype = 'but';
cfg.hpfilttype = 'but';
ecog = ft_preprocessing(cfg,data);
When I run the script. I am getting the following error.
Error in ft_trialfun_general (line 78)
hdr = ft_read_header(cfg.headerfile, 'headerformat',
cfg.headerformat);
Do I need to set the header structure as well? Can somebody help me to get
this fixed. I am reading the documentation but it seems start is bit hard!
Appreciate your support
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151220/7c7feda3/attachment-0001.html>
More information about the fieldtrip
mailing list