<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><div id="bloop_customfont" style="margin:0px">Dear FieldTrippers,</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">I'm using ft_megrealign after timelocking my data for each participant and recording, and before appending these different recording sessions (and subsequently taking grand averages over subjects). Since the experiment consisted of different sessions a few weeks apart, I'd like to minimise noise due to differences in head position (we used online head localisation, but this did not work very well for all participants when coming back a few weeks later. </div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">After making the headmodel (and ensuring it's aligned with the gradiometers), this works quite well:</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px"><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier;color:rgb(37,153,45)">% realign to template sensor positions</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier">cfg = [];</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier;color:rgb(37,153,45)"><span style="color:rgb(0,0,0)">cfg.template = {</span><span style="color:rgb(178,69,243)">'ctf275.mat'</span><span style="color:rgb(0,0,0)">}; </span></p><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier">cfg.headmodel = headmodel;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier"> </p><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier;color:rgb(37,153,45)">% For a realistic single-shell volume conduction model based on the brain surface, you</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier;color:rgb(37,153,45)">% should probably use an inward shift of about 1 cm.</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier">cfg.inwardshift = 1;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:Courier">cfg.feedback = <span style="color:rgb(178,69,243)">'no'</span>;</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:Courier"><span style="font-size:10px">data2</span><span style="font-size:10px"> </span> <span style="font-size:10px">= ft_megrealign(cfg, data);</span></p><div><br></div></div><div>However, when looking into the ft_megrealign function I found that there is the option of doing this per trial based on the CTF coil positions (rather than once based on the gradiometer definition at the beginning of the run). This seems sensible for participants who moved quite a bit during a recording. However, CTF does not originally output the {'nasX';'nasY';'nasZ';'lpaX';'lpaY';'lpaZ';'rpaX';'rpaY';'rpaZ'} that the function looks for. </div><div><br></div><div>In ft_headmovement (and also buried somewhere in the CTF documentation), I could find</div><div><div>% HLC0011 HLC0012 HLC0013 x, y, z coordinates of nasion-coil in m.</div><div>% HLC0021 HLC0022 HLC0023 x, y, z coordinates of lpa-coil in m.</div><div>% HLC0031 HLC0032 HLC0033 x, y, z coordinates of rpa-coil in m.</div></div><div><br></div><div>So it seems reasonable to simply rename these to the channel names that ft_megrealign is looking for. When doing this, realignment indeed happens at the single trial level. However, I wanted to check if there is a reason for using the nasX nasY... channel names rather than the original HLC0011.. ones? Can I rename them while keeping the rest of the HLC channels (of which there are 24) the same? I can't think of a reason why this would cause any issues, but since I could not find the 'per-trial' option documented I thought I'd check what the rationale behind using per-trial or per-run is. </div><div><br></div><div>Thanks!</div><div>Cheers,</div></div><br><div id="bloop_sign_1464083664919589888" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px"><div>— </div><div><span style="font-family:'helvetica Neue',helvetica">Anne E. Urai, MSc</span></div><div><span style="font-family:'helvetica Neue',helvetica">PhD student | Institut für Neurophysiologie und Pathophysiologie </span></div><div><span style="font-family:'helvetica Neue',helvetica">Universitätsklinikum Hamburg-Eppendorf | </span><span style="font-family:'helvetica Neue',helvetica">Martinistrasse 52, 20246 | Hamburg, Germany </span></div><div><span style="font-family:'helvetica Neue',helvetica"><a href="http://www.anneurai.net">www.anneurai.net</a> / </span><a href="https://twitter.com/AnneEUrai"><span style="font-family:'helvetica Neue',helvetica">@AnneEUrai</span></a></div></div></div></body></html>