[FieldTrip] Adjsting Emotive EEG data to FieldTrip data structure

Stephen Politzer-Ahles stephen.politzer-ahles at ling-phil.ox.ac.uk
Mon Dec 21 12:35:23 CET 2015


Hello Senaka,

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.

Best,
Steve



---
Stephen Politzer-Ahles
University of Oxford
Language and Brain Lab
Faculty of Linguistics, Phonetics & Philology
http://users.ox.ac.uk/~cpgl0080/



>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 20 Dec 2015 17:21:47 +0530
> From: Senaka Amarakeerthi <senakahks at gmail.com>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] Adjsting Emotive EEG data to FieldTrip data
>         structure.
> Message-ID:
>         <CA+si8qkXe5W7J=
> J-1ensqWCTreAGdsHovwSavJA5sAG6i1nDGg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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
> >
>
> ------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151221/1a3435c0/attachment-0001.html>


More information about the fieldtrip mailing list