<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Giuseppe,<div><br></div><div>in your trial-definition step you state:</div><div><br></div><div><div>cfg = [];</div><div><div>cfg.continuous = 'no';</div><div>cfg.trailfun = 'ft_trialfun_general';</div><div>cfg.trialdef.eventtype = 'stimtype';</div><div>cfg.trialdef.eventvalue = 8</div><div>cfg.trialdef.prestim = 1;<br></div><div>cfg.trialdef.poststim = 4;</div><div>cfg = ft_definetrial(data_clean);<br></div><div>segmented = ft_preprocessing(cfg, data_clean);</div></div><div><br></div><div>So, in your call to ft_definetrial, you are not using your cfg-structure. </div><div>Instead, you overwrite your cfg-structure with the output of the (incorrectly called) ft_definetrial.</div><div><br></div><div>Here's what you could do instead:</div><div>Use your cfg from above with cfg.dataset = subj; in your call to ft_definetrial (e.g. cfg = ft_definetrial(cfg)).</div><div>This gives you the cfg.trl-field with your trial definition.</div><div>In the next step, you could use ft_redefinetrial to actually split up your (already cleaned) data.</div><div><br></div><div>Check this tutorial for more info: <a href="http://www.fieldtriptoolbox.org/tutorial/continuous">http://www.fieldtriptoolbox.org/tutorial/continuous</a></div><div><br></div><div>Good luck,</div><div><br></div><div>Julian</div><div><br></div><div><br></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; ">********************</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b>Dr. Julian Keil</b></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b><br></b></div>AG Multisensorische Integration<br>Psychiatrische Universitätsklinik<br>der Charité im St. Hedwig-Krankenhaus<br>Große Hamburger Straße 5-11, Raum A007<br>10115 Berlin</div><div><br>Telefon: +49-30-2311-1879<br>Fax:        +49-30-2311-2209 </div><div><a href="http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration">http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration</a></div></span>
</div>
<br><div><div>Am 04.02.2016 um 17:13 schrieb Giuseppe Spinelli:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Dear Fieldtrippers<div><br><div>I am analyzing a .cnt EEG dataset from a Neuroscan amplifier with an hardware bandpass filter of 0.05-200 Hz.</div><div>I am having some troubles with segmentation after performing ICA on continuous the continuous EEG trace.</div><div><br></div><div>Here you find the pipeline I used:</div><div><br></div><div>%% reading the dataset:</div><div>subj = 'C:\data\S01.cnt';<br></div><div><div>cfg = [];<br></div><div>cfg.headerfile =  subj;</div><div>cfg.datafile = subj; </div><div>cfg.continuous = 'yes';</div><div>data_cont = ft_preprocessing(cfg);<br></div><div><br></div></div><div>%% running ICA and cleaning data</div><div>cfg = [];</div><div>cfg.method = 'runica';</div><div>comp = componentanalysis(cfg, data_cont);</div><div><br></div><div><div>cfg = [];<br></div><div>cfg.component = [1:62];</div><div>cfg.layout = 'C:\data\mylayout1010.lay';</div><div>cfg.comment = 'no';</div><div>ft_topoplotIC(cfg, comp);</div><div><br></div><div>cfg          = [];</div><div>cfg.channel  = [1 3 8];</div><div>cfg.viewmode = 'component';</div><div>cfg.layout = 'C:\data\mylayout1010.lay';</div><div>ft_databrowser(cfg, comp);</div></div><div><br></div><div><div>cfg           = [];</div><div>cfg.component = [1 3];</div><div>data_clean    = ft_rejectcomponent(cfg, comp, data_cont);</div></div><div><br></div><div>Now, in order to segment data I did: </div><div><br></div><div>cfg = [];</div><div><div>cfg.continuous = 'no';</div><div>cfg.trailfun = 'ft_trialfun_general';</div><div>cfg.trialdef.eventtype = 'stimtype';</div><div>cfg.trialdef.eventvalue = 8</div><div>cfg.trialdef.prestim = 1;<br></div><div>cfg.trialdef.poststim = 4;</div><div>cfg = ft_definetrial(data_clean);<br></div><div>segmented = ft_preprocessing(cfg, data_clean);</div></div><div><br></div><div>but, the Command Window retured me with the following error:</div><div><br></div><div><div><font color="#ff0000">Reference to non-existent field 'headerfile'.</font></div><div><span style="background-color:rgb(238,238,238)"><font color="#ff0000"><br></font></span></div><div><font color="#ff0000" style="background-color:rgb(243,243,243)">Error in ft_trialfun_general (line 78)</font></div><div><font color="#ff0000" style="background-color:rgb(243,243,243)">hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);</font></div><div><font color="#ff0000" style="background-color:rgb(243,243,243)"><br></font></div><div><font color="#ff0000" style="background-color:rgb(243,243,243)">Error in ft_definetrial (line 174)</font></div><div><font color="#ff0000" style="background-color:rgb(243,243,243)">    [trl, event] = feval(cfg.trialfun, cfg);</font></div></div><div><font color="#ff0000" style="background-color:rgb(243,243,243)"><br></font></div><div><font color="#ff0000" style="background-color:rgb(243,243,243)"><br></font></div><div>I cannot get why both the headerfile and the dataset file are needed to be specified again.</div><div>Could someone help me to figure it out?<br></div><div><br></div><div>Many thanks in advance,</div><div><br></div><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font face="tahoma, sans-serif" size="2">Giuseppe Spinelli</font></div><div dir="ltr"><font size="1" face="tahoma, sans-serif"><br></font></div><div dir="ltr"><font size="1" face="tahoma, sans-serif">Ph.D. student in Cognitive Social and Affective Neuroscience</font></div><div dir="ltr"><div><div><font size="1" face="tahoma, sans-serif"><br></font></div><div><font size="1" face="tahoma, sans-serif">Department of Psychology, Sapienza University of Rome<br></font></div><div><font size="1" face="tahoma, sans-serif">via dei Marsi 78, 00185 - Rome</font></div><div><font size="1" face="tahoma, sans-serif">Phone/Fax: +39 06-49917635 </font></div><div><font size="1" face="tahoma, sans-serif"><br></font></div><div><div><font size="1" face="tahoma, sans-serif">IRCCS Fondazione Santa Lucia</font></div><div><font size="1" face="tahoma, sans-serif">via Ardeatina 306, 00179 - Rome</font></div><div><font size="1" face="tahoma, sans-serif">Phone: +39 06 5150 1108</font></div></div><div><font size="1" face="tahoma, sans-serif"><br></font></div><div><font size="1" face="tahoma, sans-serif">@: <a href="mailto:giuseppe.spinelli@uniroma1.it" target="_blank">giuseppe.spinelli@uniroma1.it</a><br></font></div></div><div><a href="http://agliotilab.org/" target="_blank"><font size="1" face="tahoma, sans-serif">http://agliotilab.org/</font></a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div></div>
_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br></div></body></html>