[FieldTrip] segmenting after ICA on continuous data

Giuseppe Spinelli giuseppespinelli88 at gmail.com
Thu Feb 4 17:13:33 CET 2016


Dear Fieldtrippers

I am analyzing a .cnt EEG dataset from a Neuroscan amplifier with an
hardware bandpass filter of 0.05-200 Hz.
I am having some troubles with segmentation after performing ICA on
continuous the continuous EEG trace.

Here you find the pipeline I used:

%% reading the dataset:
subj = 'C:\data\S01.cnt';
cfg = [];
cfg.headerfile =  subj;
cfg.datafile = subj;
cfg.continuous = 'yes';
data_cont = ft_preprocessing(cfg);

%% running ICA and cleaning data
cfg = [];
cfg.method = 'runica';
comp = componentanalysis(cfg, data_cont);

cfg = [];
cfg.component = [1:62];
cfg.layout = 'C:\data\mylayout1010.lay';
cfg.comment = 'no';
ft_topoplotIC(cfg, comp);

cfg          = [];
cfg.channel  = [1 3 8];
cfg.viewmode = 'component';
cfg.layout = 'C:\data\mylayout1010.lay';
ft_databrowser(cfg, comp);

cfg           = [];
cfg.component = [1 3];
data_clean    = ft_rejectcomponent(cfg, comp, data_cont);

Now, in order to segment data I did:

cfg = [];
cfg.continuous = 'no';
cfg.trailfun = 'ft_trialfun_general';
cfg.trialdef.eventtype = 'stimtype';
cfg.trialdef.eventvalue = 8
cfg.trialdef.prestim = 1;
cfg.trialdef.poststim = 4;
cfg = ft_definetrial(data_clean);
segmented = ft_preprocessing(cfg, data_clean);

but, the Command Window retured me with the following error:

Reference to non-existent field 'headerfile'.

Error in ft_trialfun_general (line 78)
hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);

Error in ft_definetrial (line 174)
    [trl, event] = feval(cfg.trialfun, cfg);


I cannot get why both the headerfile and the dataset file are needed to be
specified again.
Could someone help me to figure it out?

Many thanks in advance,

Giuseppe Spinelli

Ph.D. student in Cognitive Social and Affective Neuroscience

Department of Psychology, Sapienza University of Rome
via dei Marsi 78, 00185 - Rome
Phone/Fax: +39 06-49917635

IRCCS Fondazione Santa Lucia
via Ardeatina 306, 00179 - Rome
Phone: +39 06 5150 1108

@: giuseppe.spinelli at uniroma1.it
http://agliotilab.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160204/2a964c76/attachment-0001.html>


More information about the fieldtrip mailing list