<div dir="ltr"><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">Thanks for your answer Haiteng.</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif"><br></div>
<div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">To share our findings on this topic:</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">
After some more debugging, we realized that it could indeed be the ICA function that inserts NaNs into the grad info.</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">
It seems ft_denoise_synthetic only changes the grad info for some reference channels...</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">
We now use Haiteng's trick of replacing the post-ICA grad info, with the post-denoise grad info, however, it feels somewhat dangerous to perform such "dirty" fixes, since that grad info is probably removed for a certain reason. We are oblivious to its impact subsequent steps like planar transform and source reconstruction.</div>
<div class="gmail_default" style="font-family:'trebuchet ms',sans-serif"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">In addition, we dug up the following page on the FieldTrip wiki which explains the denoising.</div>
<div class="gmail_default" style="font-family:'trebuchet ms',sans-serif"><a href="http://fieldtrip.fcdonders.nl/faq/how_does_the_ctf_higher-order_gradiometer_work">http://fieldtrip.fcdonders.nl/faq/how_does_the_ctf_higher-order_gradiometer_work</a><br>
</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">Thanks!</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">
<br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">Cheers,</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif">Alexander</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Jul 7, 2013 at 8:17 PM, Haiteng Jiang <span dir="ltr"><<a href="mailto:haiteng.jiang@gmail.com" target="_blank">haiteng.jiang@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Alexander,<div> I am not clear about what's ft_denoise_synthetic doing. However , I don't have such problem when I use . The reason you get 'mismatching number of channels' probably because you specify cfg.channel ='MEG' instead of including all channels. My FT code is something like this:</div>
<div><br></div><div><div> % reading </div><div> cfg = [];</div><div> cfg.dataset = dataset;</div><div> cfg.trialdef.eventtype = ''; </div><div> cfg.trialdef.eventvalue = ; </div>
<div> cfg.continuous = 'yes'; </div><div> cfg.channel= 'all'; </div><div> cfg.trialdef.prestim = ;</div><div> cfg.trialdef.poststim = ;</div><div> cfg = ft_definetrial(cfg); </div>
<div> trl = cfg.trl; </div><div> cfg.detrend ='yes';</div><div> cfg.demean = 'yes'; </div><div> data= ft_preprocessing(cfg); </div><div> cfg.gradient = 'G3BR';</div>
<div> data= ft_denoise_synthetic(cfg,data); </div></div><div><br></div><div>In my pipeline , the grad changes into NAN only after I run I ICA to remove artifacts . I replace this grad with previous good gradient information and assume it is fine for the latter source reconstruction. Hope this helps.</div>
<div> Best,</div><div> Haiteng <div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
<br>
Message: 2<br>
Date: Fri, 5 Jul 2013 09:38:55 +0200<br>
From: Alexander Backus <<a href="mailto:a.backus@donders.ru.nl" target="_blank">a.backus@donders.ru.nl</a>><br>
To: <a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a><br>
Subject: [FieldTrip] why does ft_denoise_synthetic inserts NaNs in<br>
grad fields<br>
Message-ID:<br>
<<a href="mailto:CAEfPLbcMKmSkhak0cqQHNp-Lye8xhLJKjauN4GWupBCdVBA6cQ@mail.gmail.com" target="_blank">CAEfPLbcMKmSkhak0cqQHNp-Lye8xhLJKjauN4GWupBCdVBA6cQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<div class="im"><br>
<br>
Hi,<br>
<br>
When I use ft_denoise_synthetic on my preprocessed CTF275 MEG data to<br>
covert to 3rd order gradient, it replaces the values in data.grad.chanpos<br>
and data.grad.chanori with NaNs.<br>
<br>
I assume this is done because they are no longer valid.<br>
When digging into the low-level code I found something about mismatching<br>
number of channels.<br>
<br>
Anyway, when I want to subsequently covert to planar gradient (does this<br>
actually makes sense?) or create a source model, I need these grad values.<br>
<br>
I have two questions:<br>
<br>
1) What does ft_denoise_synthetic exactly do (in non-math terms) and why<br>
are NaNs inserted in the grad subfields?<br>
<br>
2) Can I still use the data for planar gradient conversion or source<br>
modeling by using the earlier stored old gradient info (pre<br>
ft_denoise_synthetic) or is this ill-advised and is there a more wise<br>
course of action?<br>
<br>
Thanks in advance,<br>
Best,<br>
Alexander Backus<br>
</div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div><font face="arial, helvetica, sans-serif">Haiteng Jiang</font></div><div><font face="arial, helvetica, sans-serif">PhD candidate</font></div><div>
<font face="arial, helvetica, sans-serif">Neuronal Oscillations Group</font></div><div class="im">
<div><font face="arial, helvetica, sans-serif">Donders Institute for Brain, Cognition and Behaviour</font></div><div><font face="arial, helvetica, sans-serif">Centre for Cognitive Neuroimaging</font></div><div><font face="arial, helvetica, sans-serif">Radboud University Nijmegen</font></div>
<div><span style="line-height:18px"><font face="arial, helvetica, sans-serif"><br></font></span></div></div><div><span style="line-height:18px"><font face="arial, helvetica, sans-serif">Visiting address</font></span></div>
<div><div style="text-align:left"><div><span style="line-height:18px"><font face="arial, helvetica, sans-serif">Room 2.32</font></span></div><div><span style="line-height:18px"><font face="arial, helvetica, sans-serif">Donders Centre for Cognitive Neuroimaging</font></span></div>
<div><span style="line-height:18px"><font face="arial, helvetica, sans-serif">Kapittelweg 29</font></span></div><div><span style="line-height:18px"><font face="arial, helvetica, sans-serif">6525 EN Nijmegen</font></span></div>
<div><span style="line-height:18px"><font face="arial, helvetica, sans-serif">the Netherlands</font></span></div><div><span style="line-height:18px"><font face="arial, helvetica, sans-serif"><br></font></span></div></div>
</div><div><font face="arial, helvetica, sans-serif"> Tel.: <a href="tel:%2B31%20%280%29243668291" value="+31243668291" target="_blank">+31 (0)243668291</a></font></div></div><div><font face="arial, helvetica, sans-serif"> Web: <a href="https://sites.google.com/site/haitengjiang/" target="_blank">https://sites.google.com/site/haitengjiang/</a></font></div>
</div></div></div>
<br>_______________________________________________<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" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div><br clear="all"><div><br></div>-- <br><font style="font-family:trebuchet ms,sans-serif;color:rgb(102,102,102)" color="#888888"><span style="color:rgb(0,0,0)">Alexander R. Backus</span>, MSc<br>
<span style="color:rgb(102,102,102)">PhD Candidate at the </span></font><font style="font-family:trebuchet ms,sans-serif;color:rgb(102,102,102)" color="#888888">Donders Institute for Brain, Cognition and Behaviour</font><font style="font-family:trebuchet ms,sans-serif;color:rgb(102,102,102)"><br>
Centre for Cognitive Neuroimaging</font><font style="font-family:trebuchet ms,sans-serif;color:rgb(102,102,102)" color="#888888"><br>Radboud University Nijmegen<br>
</font><div style="font-family:trebuchet ms,sans-serif;color:rgb(102,102,102)"><span style="font-family:trebuchet ms,sans-serif;color:rgb(102,102,102)">Memory and Space Research Group<br><a style="color:rgb(102,102,102)" href="http://www.doellerlab.com" target="_blank">www.doellerlab.com</a><br>
</span><font><br>P.O. Box 9101, NL-6500 HB Nijmegen </font><font style="font-family:trebuchet ms,sans-serif">, The Netherlands</font><font><br>
</font></div><font style="font-family:trebuchet ms,sans-serif;color:rgb(102,102,102)" color="#888888">Telephone:</font><font style="font-family:trebuchet ms,sans-serif;color:rgb(102,102,102)" color="#888888"><font style="font-family:trebuchet ms,sans-serif;color:rgb(153,153,153)"> </font></font><span style="color:rgb(102,102,102);font-family:trebuchet ms,sans-serif"><a value="+31243610754">+31(0)24 36 10754</a></span><font style="font-family:trebuchet ms,sans-serif" color="#888888"><br>
</font>