<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Dear FieldTrippers,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I head a similar problem with interpolating missing channels from a CTF275 system. Since I couldn't find a final answer on the mailing list, I thought I'd share my solution. Specifically, giving both a cfg.layout and a cfg.neighbours input into ft_channelrepair avoids ft_fetch_sens getting the grad structure from the data (from which the channels that were not recorded are missing). With this setting, the sensors that are needed are defined based on the layout from the fieldtrip/templates directory, which is complete.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Happy interpolating! </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><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;">cfg = [];</div><div id="bloop_customfont" style="margin: 0px;"> cfg.layout = 'CTF275';</div><div id="bloop_customfont" style="margin: 0px;"> cfg.method = 'template';</div><div id="bloop_customfont" style="margin: 0px;"> neighbours = ft_prepare_neighbours(cfg);</div><div id="bloop_customfont" style="margin: 0px;"> </div><div id="bloop_customfont" style="margin: 0px;"> cfg = [];</div><div id="bloop_customfont" style="margin: 0px;"> cfg.neighbours = neighbours;</div><div id="bloop_customfont" style="margin: 0px;"> cfg.method = 'spline'; % spline can handle missing grad struct</div><div id="bloop_customfont" style="margin: 0px;"> cfg.layout = 'CTF275'; % use this rather than grad structure to find sens info</div><div id="bloop_customfont" style="margin: 0px;"> </div><div id="bloop_customfont" style="margin: 0px;"> % find missing channels in this dataset</div><div id="bloop_customfont" style="margin: 0px;"> cfg.missingchannel = {neighbours((~ismember({neighbours(:).label}, data.label))).label};</div><div id="bloop_customfont" style="margin: 0px;"> data = ft_channelrepair(cfg,data);</div><div id="bloop_customfont" style="margin: 0px;"> assert(length(data.label) == 275, 'CTF275 not completely interpolated!');</div></div> <br> <div id="bloop_sign_1460144218025488896" 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> <div class="airmail_ext_on" style="color:black"><br>From: <span style="color:black">Linsey Roijendijk</span> <a href="mailto:l.roijendijk@donders.ru.nl"><l.roijendijk@donders.ru.nl></a><br>Reply: <span style="color:black">FieldTrip discussion list</span> <a href="mailto:fieldtrip@science.ru.nl"><fieldtrip@science.ru.nl></a><br>Date: <span style="color:black">20 December 2012 at 18:44:31</span><br>To: <span style="color:black">FieldTrip discussion list</span> <a href="mailto:fieldtrip@science.ru.nl"><fieldtrip@science.ru.nl></a><br>Subject: <span style="color:black"> Re: [FieldTrip] ft_channelrepair with channel absent from data <br></span></div><br> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div><div>





<title></title>



Correction: I made a mistake in my e-mail, I meant the spherical
spline interpolation method, because that's the one Jorn said
should work.
<div><br>
<div>
<div>On Dec 20, 2012, at 6:31 PM, Linsey Roijendijk <<a href="mailto:l.roijendijk@donders.ru.nl">l.roijendijk@donders.ru.nl</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div>Hi all,</div>
<div><br></div>
<div>I have also been trying to reinterpolate MEG channels that
were never recorded with the nearest neighbour interpolation
method, however when calling the method (in the same way Tom also
used it) the function seems to do something, however it did not
interpolate the missing sensors. </div>
<div>There were still 273 sensors instead of 275.  Do I need
to give along a special cfg.grad or do something else?</div>
<div><br></div>
<div>Thanks in advance,</div>
<div><br></div>
<div>Linsey</div>
<div><br></div>
<br>
<div>
<div>On Nov 26, 2012, at 10:45 AM, Jörn M. Horschig <<a href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>>
wrote:q</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hey Tom,<br>
<br></div>
<blockquote cite="mid:50B23369.5020105@fcdonders.ru.nl" type="cite"><br>
I guess I have several questions all at once:<br>
1) Is it actually possible to reinterpolate MEG channels that were
never recorded - eg because the channels were deactivated when the
acquisition took place?<br></blockquote>
<br>
Should work, but only with the SSI (=spherical spline
interpolation) method. For the nearest neighbour interpolation, the
function constructs a list of neuighbouring and constructs a
weighted average. The function, however, wants to weigh each sensor
according to its distance from the sensor to be reconstructed. That
information can only be found in the grad structure, but in the
grad structure there are only sensors which were recorded, thus the
distance from a missing sensor cannot be measured because its
position is missing in the grad structure. SSI should work though,
cause it relies on a different rationale.<br>
<br>
<br>
<blockquote cite="mid:50B23369.5020105@fcdonders.ru.nl" type="cite">2) What might be causing the error I'm
seeing?<br></blockquote>
<br>
Since you have 301 channels rather than 275, my suspicion is that
you include reference gradiometers. This should not fail in
principle, though... maybe I can drop by your office to check it
out? Got some time right now?<br>
<br>
<blockquote cite="mid:50B23369.5020105@fcdonders.ru.nl" type="cite">3) Where is ft_fetch_sens?<br></blockquote>
<br>
It's a private function, can be found in FieldTrip/private. You
have to cd to that directory in order for Matlab to find it (the
idea behind private function is that there are only visible for
higher-level function and 'hidden' for all other functions).<br>
<br>
Best,<br>
Jörn<br>
<br>
<br>
<blockquote cite="mid:50B23369.5020105@fcdonders.ru.nl" type="cite"><br>
Thanks for help with any of the above!<br>
Best,<br>
Tom<br>
<pre class="moz-signature" cols="72">--  
Tom Marshall, MSc.
Neuronal Oscillations Group, Donders Centre for Cognitive Neuroimaging
tel: +31(0)243668487
email: <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:t.marshall@fcdonders.ru.nl">t.marshall@fcdonders.ru.nl</a>
postal: PO Box 9101, 6500HB, Nijmegen, The Netherlands
visiting: Kapittelweg 29, 6525EN, Nijmegen, The Netherlands
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
fieldtrip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a>
<a class="moz-txt-link-freetext" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a>
</pre></blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--  
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour  
Centre for Cognitive Neuroimaging
Radboud University Nijmegen  
Neuronal Oscillations Group
FieldTrip Development Team

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>
Tel:    +31-(0)24-36-68493
Web: <a class="moz-txt-link-freetext" href="http://www.ru.nl/donders">http://www.ru.nl/donders</a>

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands
</pre></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></blockquote>
</div>
<br>
<div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;">--</span></div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><br></span></div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;">Linsey Roijendijk
MSc.</span></div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;">Donders Institute
for Brain, Cognition and Behaviour<br>
Centre for Neuroscience<br>
dept. of Biophysics<br>
Radboud University Nijmegen<br>
Montessorilaan 3, Room B.02.34<br>
P.O.Box 9104<br>
6500 HE Nijmegen<br>
The Netherlands<br>
Tel: +31(0)24 3612616<br>
<a href="mailto:L.Roijendijk@donders.ru.nl">L.Roijendijk@donders.ru.nl</a></span></div>
</div>
</div>
</div>
</div>
</div>
<br></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote>
</div>
<br>
<div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;">
--</span></div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;">
<br></span></div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;">
Linsey Roijendijk MSc.</span></div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;">
Donders Institute for Brain, Cognition and Behaviour<br>
Centre for Neuroscience<br>
dept. of Biophysics<br>
Radboud University Nijmegen<br>
Montessorilaan 3, Room B.02.34<br>
P.O.Box 9104<br>
6500 HE Nijmegen<br>
The Netherlands<br>
Tel: +31(0)24 3612616<br>
<a href="mailto:L.Roijendijk@donders.ru.nl">L.Roijendijk@donders.ru.nl</a></span></div>
</div>
</div>
</div>
</div>
</div>
<br></div>


_______________________________________________
<br>fieldtrip mailing list
<br>fieldtrip@donders.ru.nl
<br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div></div></span></blockquote></body></html>