<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:1598100855;
        mso-list-type:hybrid;
        mso-list-template-ids:937043366 -1 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l0:level1
        {mso-level-text:"\(%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:1656570425;
        mso-list-type:hybrid;
        mso-list-template-ids:-1401802918 -1 67895299 67895301 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l1: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 l1: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 l1: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 l1: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 l1: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 l1: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 l1: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 l1: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 l1: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><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:"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:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        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:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1598100855;
        mso-list-type:hybrid;
        mso-list-template-ids:937043366 -1 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l0:level1
        {mso-level-text:"\(%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:2079589643;
        mso-list-template-ids:914231948;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Dear Stephen, </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is my script : </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>%segmentation</p><p class=MsoNormal>seg_window=[0.1 1]; % in seconds %preStim/postStim</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>%config</p><p class=MsoNormal>cfg= [];</p><p class=MsoNormal>cfg.dataset = filename_Data;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>%% *********** TRIAL DEFINITION PART *********** (that works )</p><p class=MsoNormal>[…]</p><p class=MsoNormal>cfg = ft_definetrial(cfg);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% ***********  Re-References *********** (that also works )</p><p class=MsoNormal>cfg.reref = 'yes';</p><p class=MsoNormal>cfg.refchannel = {'EXG3', 'EXG4'};% electrode 131/132 // cell-array with new EEG reference channel(s), this can be 'all' for a common average reference</p><p class=MsoNormal>cfg.refmethod     = 'avg'; % 'avg', 'median', or 'bipolar' for bipolar derivation of sequential channels (default = 'avg') </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>data_Raw = ft_preprocessing(cfg);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>%% *********** Baseline ***********</p><p class=MsoNormal>cfg.demean = 'yes';</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>cfg1=cfg;</p><p class=MsoNormal>cfg1.baselinewindow = [-seg_window(1) 0 ];</p><p class=MsoNormal>cfg2=cfg;</p><p class=MsoNormal>cfg2.baselinewindow = [0 0.1];</p><p class=MsoNormal>cfg3=cfg;</p><p class=MsoNormal>cfg3.baselinewindow = 'all';</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>data1 = ft_preprocessing(cfg1);</p><p class=MsoNormal>data2 = ft_preprocessing(cfg2);</p><p class=MsoNormal>data3 = ft_preprocessing(cfg3);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><ul style='margin-top:0cm' type=disc><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo2'>I’ve attached the figure with the results.</li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>PS : In fact I made a mistake in my previous email : the result wasn’t the same when the Baseline window was ‘all’.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Let me know if you need more informations. </p><p class=MsoNormal>Thanks for your help.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Marion</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:stephen.whitmarsh@gmail.com">Stephen Whitmarsh</a><br><b>Envoyé le :</b>jeudi 17 janvier 2019 11:51<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><br /><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Dear Marion,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>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?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Cheers,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Stephen<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> <b>On Behalf Of </b>Marion Vincent<br><b>Sent:</b> Thursday, January 17, 2019 10:37 AM<br><b>To:</b> fieldtrip@science.ru.nl<br><b>Subject:</b> [FieldTrip] Baseline removal errors in trials preprocessing<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=FR>Dear FIeldtrip users, <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I’m new in using Fieldtrip for EEG processing and I’ve encountred some issues while removing the Baseline of my trials. <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I’m working on EEG signals recorded with the BioSemi system.  My pre-processing method is : <o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo3'><![if !supportLists]><span lang=FR><span style='mso-list:Ignore'>(1)<span style='font:7.0pt "Times New Roman"'>    </span></span></span><![endif]><span lang=FR>Re-referecing the channels (necessary with BioSemi)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo3'><![if !supportLists]><span lang=FR><span style='mso-list:Ignore'>(2)<span style='font:7.0pt "Times New Roman"'>    </span></span></span><![endif]><span lang=FR>Trial definition<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo3'><![if !supportLists]><span lang=FR><span style='mso-list:Ignore'>(3)<span style='font:7.0pt "Times New Roman"'>    </span></span></span><![endif]><span lang=FR>Baseline removal<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I’ve read on the documentation that ft_preprocessing xcan have several cfg parameter for the Baseline removal :<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>% cfg.demean  = 'yes';%'no' or 'yes', whether to apply baseline correction (default = 'no')<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>% cfg.baselinewindow = 'all';%[begin end] ;%in seconds, the default is the complete trial (default = 'all')<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>% cfg.detrend       = 'no'; %'no' or 'yes', remove linear trend from the data (done per trial) (default = 'no')<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I wanted to remove a Baseline defined as the average of a given window preceeding my stimulus onset. <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I tried to use : cfg.baselinewindow = [-0.5 0 ]; cfg.baselinewindow = [0 0.1] or the default window .<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>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. <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>Do you have any advice ?<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>Thanks ! <o:p></o:p></span></p><p class=MsoNormal><span lang=FR>Marion<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><b><span lang=FR style='color:#2F5597'>Marion VINCENT</span></b><span lang=FR style='color:black'><br>Eng., PhD , CNRS Research Engineer<br><br></span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p></div></body></html></body>