<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hey Cecilia,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I guess you could do that with a combination of 'ft_selectdata', and 'ft_math'.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Let's say you have datasets called 'stimlocked' and 'cuelocked'</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">You'd do something like:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">% cut out baseline from cuelocked<br>
</p>
<p style="margin-top:0;margin-bottom:0">cfg = [];</p>
<p style="margin-top:0;margin-bottom:0">cfg.latency = [-0.5 0]; % or whatever your baseline window is</p>
<p style="margin-top:0;margin-bottom:0">baseline = ft_selectdata(cfg, cuelocked);</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">% subtract baseline from stimlocked</p>
<p style="margin-top:0;margin-bottom:0">cfg = [];</p>
<p style="margin-top:0;margin-bottom:0">cfg.operation = 'subtract';</p>
<p style="margin-top:0;margin-bottom:0">baseline_corrected_stimlocked = ft_math(cfg, stimlocked, baseline);</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I <i>think</i> that ft_math allows you to input algebraic expressions too. So if you wanted to do, for example, a 'relchange' baseline correction you should substitute (something like)</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">cfg.operation = '(x1-x2)/x2';<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Best,</p>
<p style="margin-top:0;margin-bottom:0">Tom<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Mazzetti, C. (Cecilia) <C.Mazzetti@donders.ru.nl><br>
<b>Sent:</b> 01 November 2018 11:04:23<br>
<b>To:</b> fieldtrip@science.ru.nl<br>
<b>Subject:</b> [FieldTrip] baseline correcting data with baseline coming from a different grandaverage</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0px;
        margin-bottom:0px}
-->
</style>
<div dir="ltr" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear everyone,<br>
</p>
<p>I have some stimulus locked data which I have to baseline with respect to the same data but cue locked.<br>
</p>
<p>I was wondering whether there is a setting in fieldtrip which allows to do that (i.e. set the baseline timw window according to a different dataset, the cue-locked data) and applying it to the stimulus locked data.<br>
</p>
<p>Thanks in advance!<br>
</p>
<p><br>
</p>
<div id="x_Signature">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:'Segoe UI',Helvetica,Arial,sans-serif; background-color:rgb(255,255,255)">
<font face="arial,sans-serif"><font face="arial,helvetica,sans-serif">Best,</font></font></div>
<div style="font-family:'Segoe UI',Helvetica,Arial,sans-serif; background-color:rgb(255,255,255)">
<font face="arial,sans-serif"><font face="arial,helvetica,sans-serif">Cecilia</font></font></div>
<div style="font-family:'Segoe UI',Helvetica,Arial,sans-serif; background-color:rgb(255,255,255)">
<font face="arial,sans-serif"><font face="arial,helvetica,sans-serif"><b><br>
</b></font></font></div>
<div style="font-family:'Segoe UI',Helvetica,Arial,sans-serif; background-color:rgb(255,255,255)">
<font face="arial,sans-serif"><font face="arial,helvetica,sans-serif"><b><br>
</b></font></font></div>
<div style="font-family:'Segoe UI',Helvetica,Arial,sans-serif; background-color:rgb(255,255,255)">
<font face="arial,sans-serif"><font face="arial,helvetica,sans-serif"><b>Cecilia Mazzetti - </b></font><font face="arial,helvetica,sans-serif"><b>Ph.D. Candidate </b></font></font></div>
<div style="font-family:'Segoe UI',Helvetica,Arial,sans-serif; background-color:rgb(255,255,255)">
<span style="font-family:arial,helvetica,sans-serif">Donders Centre for Cognitive Neuroimaging, room 0.068 </span></div>
<div style="font-family:'Segoe UI',Helvetica,Arial,sans-serif; background-color:rgb(255,255,255)">
<font face="arial,sans-serif">
<div style="margin:0px"><font face="arial,helvetica,sans-serif">Kapittelweg 29 | </font><font face="arial,helvetica,sans-serif">6525 EN Nijmegen </font></div>
</font></div>
<div style="font-family:'Segoe UI',Helvetica,Arial,sans-serif; background-color:rgb(255,255,255)">
<font face="arial,sans-serif">
<div style="margin:0px"><br>
</div>
</font></div>
</div>
<div style="font-family:Tahoma; font-size:13px"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>