[FieldTrip] segmenting after ICA on continuous data

Julian Keil julian.keil at gmail.com
Thu Feb 4 17:32:28 CET 2016


Dear Giuseppe,

in your trial-definition step you state:

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);

So, in your call to ft_definetrial, you are not using your cfg-structure.
Instead, you overwrite your cfg-structure with the output of the (incorrectly called) ft_definetrial.

Here's what you could do instead:
Use your cfg from above with cfg.dataset = subj; in your call to ft_definetrial (e.g. cfg = ft_definetrial(cfg)).
This gives you the cfg.trl-field with your trial definition.
In the next step, you could use ft_redefinetrial to actually split up your (already cleaned) data.

Check this tutorial for more info: http://www.fieldtriptoolbox.org/tutorial/continuous

Good luck,

Julian


********************
Dr. Julian Keil

AG Multisensorische Integration
Psychiatrische Universitätsklinik
der Charité im St. Hedwig-Krankenhaus
Große Hamburger Straße 5-11, Raum A007
10115 Berlin

Telefon: +49-30-2311-1879
Fax:        +49-30-2311-2209
http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration

Am 04.02.2016 um 17:13 schrieb Giuseppe Spinelli:

> 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/
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160204/883dc926/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160204/883dc926/attachment-0002.sig>


More information about the fieldtrip mailing list