<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1825317491;
mso-list-type:hybrid;
mso-list-template-ids:-1924625790 -1 67895299 67895301 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0F0;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style></head><body lang=FR link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Dear Julian, </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b>seg_window=[0.1 1]; % in seconds %preStim/postStim<o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p><p class=MsoNormal><b>Does that mean, you segment your data to 0.1 s to 1 s after the stimulus?<o:p></o:p></b></p><p class=MsoNormal><b>In that case, there is no data to use prior to 0.1 later on.<o:p></o:p></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The seg_window I used was to defined the trials (prestim to poststim interval).</p><p class=MsoNormal>Then in my one trial definition function I define my trial as the interval [t0-preStim ; t0+postStim], with t0 the stimulus onset.</p><ul style='margin-top:0cm' type=disc><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>My trial goes from 0.1s before t0 to 1 s after.</li></ul><p class=MsoNormal>That is why the preStim value is positive in seg_window.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b>So, these two statements:<o:p></o:p></b></p><p class=MsoNormal><b>cfg1=cfg;<br>cfg1.baselinewindow = [-seg_window(1) 0 ];<br>cfg2=cfg;<br>cfg2.baselinewindow = [0 0.1];<o:p></o:p></b></p><p class=MsoNormal><b>are basically identical, as the interval -0.1 to 0 (cfg1) and 0 to 0.1 (cfg2) will both contain no data.<o:p></o:p></b></p><p class=MsoNormal><b>Please double check this with the seg_window set to [-0.1 1]<o:p></o:p></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think I might not understood how to pass the time interval in the cfg.baselinewindow.</p><p class=MsoNormal>For me as I stated [ - seg_window(1) ; 0], in had in mind to take the interval [ - 0.1 ; 0] before the stimulus onset (at t0=0) . </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span style='color:#2F5597'>Marion VINCENT</span></b><span style='color:black'><br>Eng., PhD , CNRS Research Engineer<br><b>Tel</b>: +33 607 59 46 76<br><br>Laboratoire SCALab UMR CNRS 9193<br>Université Lille 3<br>BP 60149<br>59653 Villeneuve d'Ascq Cedex<br><i>http://scalab.cnrs.fr</i><br>--------------------------------------------<br>L’Imaginarium / SCV-IrDIVE Equipex<br>99a Boulevard Descat<br>59200 Tourcoing<br><i>http://www.irdive.fr</i>/</span><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>De : </b><a href="mailto:julian.keil@gmail.com">Julian Keil</a><br><b>Envoyé le :</b>jeudi 17 janvier 2019 14:57<br><b>À : </b><a href="mailto:fieldtrip@science.ru.nl">FieldTrip discussion list</a><br><b>Objet :</b>Re: [FieldTrip] Baseline removal errors in trials preprocessing</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Dear Marion,</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>when you state: </p></div><div><p class=MsoNormal>seg_window=[0.1 1]; % in seconds %preStim/postStim</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Does that mean, you segment your data to 0.1 s to 1 s after the stimulus?</p></div><div><p class=MsoNormal>In that case, there is no data to use prior to 0.1 later on.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>So, these two statements:</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>cfg1=cfg;<br>cfg1.baselinewindow = [-seg_window(1) 0 ];<br>cfg2=cfg;<br>cfg2.baselinewindow = [0 0.1];</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>are basically identical, as the interval -0.1 to 0 (cfg1) and 0 to 0.1 (cfg2) will both contain no data.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Please double check this with the seg_window set to [-0.1 1]</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Hope that helps,</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Julian</p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Thu, Jan 17, 2019 at 2:29 PM Marion Vincent <<a href="mailto:marion.vincent@univ-lille.fr">marion.vincent@univ-lille.fr</a>> wrote:</p></div></div><p class=MsoNormal style='margin-left:4.8pt'>Dear Stephen,<br>Here is my script:<br>%segmentation<br>seg_window=[0.1 1]; % in seconds %preStim/postStim<br>%config<br>cfg= [];<br>cfg.dataset = filename_Data;<br>%% *********** TRIAL DEFINITION PART *********** (that works)<br>[…]<br>cfg = ft_definetrial(cfg);<br>% *********** Re-References *********** (that also works)<br>cfg.reref = 'yes';<br>cfg.refchannel = {'EXG3', 'EXG4'};% electrode 131/132 // cell-array with new EEG reference channel(s), this can be 'all' for a common average reference<br>cfg.refmethod = 'avg'; % 'avg', 'median', or 'bipolar' for bipolar derivation of sequential channels (default = 'avg')<br>data_Raw = ft_preprocessing(cfg);<br>%% *********** Baseline ***********<br>cfg.demean = 'yes';<br>cfg1=cfg;<br>cfg1.baselinewindow = [-seg_window(1) 0 ];<br>cfg2=cfg;<br>cfg2.baselinewindow = [0 0.1];<br>cfg3=cfg;<br>cfg3.baselinewindow = 'all';<br>data1 = ft_preprocessing(cfg1);<br>data2 = ft_preprocessing(cfg2);<br>data3 = ft_preprocessing(cfg3);<br>I’ve attached the figure with the results.<br>PS: In fact I made a mistake in my previous email: the result wasn’t the same when the Baseline window was ‘all’.<br>Let me know if you need more informations.<br>Thanks for your help.<br>Marion<br>Marion VINCENT<br>Eng., PhD , CNRS Research Engineer<br>Tel: +33 607 59 46 76<br>Laboratoire SCALab UMR CNRS 9193<br>Université Lille 3<br>BP 60149<br>59653 Villeneuve d'Ascq Cedex<br><a href="http://scalab.cnrs.fr" target="_blank">http://scalab.cnrs.fr</a><br>--------------------------------------------<br>L’Imaginarium / SCV-IrDIVE Equipex<br>99a Boulevard Descat<br>59200 Tourcoing<br><a href="http://www.irdive.fr/" target="_blank">http://www.irdive.fr/</a><br>De: Stephen Whitmarsh<br>Envoyé le:jeudi 17 janvier 2019 11:51<br>À: 'FieldTrip discussion list'<br>Objet:Re: [FieldTrip] Baseline removal errors in trials preprocessing<br><br><br>Dear Marion,<br><br><br><br>It sounds it might indeed be something as simple as a typo. Could you paste the part of your script – from baseline removal to plotting (where you don’t see a difference) - so we can take a look?<br><br><br><br>Cheers,<br><br>Stephen<br><br><br><br>From: fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>> On Behalf Of Marion Vincent<br>Sent: Thursday, January 17, 2019 10:37 AM<br>To: <a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a><br>Subject: [FieldTrip] Baseline removal errors in trials preprocessing<br><br><br><br>Dear FIeldtrip users, <br><br><br><br>I’m new in using Fieldtrip for EEG processing and I’ve encountred some issues while removing the Baseline of my trials. <br><br><br><br>I’m working on EEG signals recorded with the BioSemi system. My pre-processing method is : <br><br>(1) Re-referecing the channels (necessary with BioSemi)<br><br>(2) Trial definition<br><br>(3) Baseline removal<br><br><br><br>I’ve read on the documentation that ft_preprocessing xcan have several cfg parameter for the Baseline removal :<br><br><br><br>% cfg.demean = 'yes';%'no' or 'yes', whether to apply baseline correction (default = 'no')<br><br>% cfg.baselinewindow = 'all';%[begin end] ;%in seconds, the default is the complete trial (default = 'all')<br><br>% cfg.detrend = 'no'; %'no' or 'yes', remove linear trend from the data (done per trial) (default = 'no')<br><br><br><br>I wanted to remove a Baseline defined as the average of a given window preceeding my stimulus onset. <br><br><br><br>I tried to use : cfg.baselinewindow = [-0.5 0 ]; cfg.baselinewindow = [0 0.1] or the default window .<br><br>But the problem is that I always have the same result, no matter the window I use : the first point of my trial is put to zero and substracted to all my trial. <br><br><br><br>I’m sure I’m doing something wrong (and that the answer is very simple), but I can’t manage to understand what is the issue.<br><br><br><br>Do you have any advice ?<br><br><br><br>Thanks ! <br><br>Marion<br><br><br><br>Marion VINCENT<br>Eng., PhD , CNRS Research Engineer<br><br><br><br><br><br><br><br>_______________________________________________<br>fieldtrip mailing list<br><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br><a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>_______________________________________________<br>fieldtrip mailing list<br><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br><a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>