<html xmlns:v="urn:schemas-microsoft-com:vml" 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:"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:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
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.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Good point Julian. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I though that cfg1, cfg2, and cfg3 were never used, but see I was wrong.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Back to my own cfg’s now…<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Cheers,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Stephen<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> fieldtrip <fieldtrip-bounces@science.ru.nl> <b>On Behalf Of </b>Julian Keil<br><b>Sent:</b> Thursday, January 17, 2019 2:38 PM<br><b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br><b>Subject:</b> Re: [FieldTrip] Baseline removal errors in trials preprocessing<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Dear Marion,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>when you state: <o:p></o:p></p></div><div><p class=MsoNormal>seg_window=[0.1 1]; % in seconds %preStim/postStim<o:p></o:p></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?<o:p></o:p></p></div><div><p class=MsoNormal>In that case, there is no data to use prior to 0.1 later on.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>So, these two statements:<o:p></o:p></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];<o:p></o:p></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.<o:p></o:p></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]<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Hope that helps,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Julian<o:p></o:p></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:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><p class=MsoNormal>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><o:p></o:p></p></blockquote></div></div></body></html>