<div>Thank you very much for confirming the problem, Don, I appreciate it, :)</div>
<div> </div>
<div class="gmail_quote">Jim</div>
<div class="gmail_quote"> </div>
<div class="gmail_quote">On Thu, Jul 7, 2011 at 4:30 PM, Rojas, Don <span dir="ltr"><<a href="mailto:Don.Rojas@ucdenver.edu" target="_blank">Don.Rojas@ucdenver.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="WORD-WRAP: break-word">Jim,
<div><br></div>
<div>All I can do is confirm that this issue exists for our 4D data as well, although we don't use the ft_channelrepair function. The same 4 quite distant channels (one had been deleted in the dataset I had handy) were chosen for repair when I ran this on one of our datasets (also a 248 channel 4D system). I agree the choice doesn't make any sense given the 3 cm distance you define. A quick look at the critical calculation in ft_channelrepair, line 109 distance = ... is correct given the inputs. So I wonder if the issue is with the actual channel indices used rather than the calculation, but I don't have time to track that down. All I can say is that for the distance you specify, channels A235, A216, A199, A215 would be much closer to A234 than those that are selected via the channel repair function. Channel A8 is in fact nearly 21 cm away from channel A234 in the array, based on examination of the data read in from Eugene Kronberg's pdf4D matlab object code, which I think was originally the basis for the FieldTrip 4D reader function.</div>
<div><br></div>
<div>Best,</div>
<div><br></div>
<div>Don Rojas</div>
<div><br></div>
<div><br></div>
<div>
<div>
<div>
<div></div>
<div>
<div>On Jul 7, 2011, at 1:26 PM, Jim Li wrote:</div><br></div></div>
<blockquote type="cite">
<div>
<div></div>
<div>
<div>Dear Fieldtrip developer,</div>
<div> </div>
<div>Can anybody help me with this channel-repair issue I've been having? I can provide the raw data if you need. I really want to solve the problem, you know.</div>
<div> </div>
<div>Thanks a lot,</div>
<div> </div>
<div>Jim<br><br></div>
<div class="gmail_quote">On Thu, Jul 7, 2011 at 2:22 PM, Jim Li <span dir="ltr"><<a href="mailto:megjim1@gmail.com" target="_blank">megjim1@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi Odelia,</div>
<div> </div>
<div>Yes, I downloaded the latest version of Fieldtrip and tried your suggestion "cfg.neighbourdist = 0.03", but it still weirdly uses the far-away channels like A121 to do the channel-repair for A234 (these two channels are 24.1172cm apart!). Here is the detail:</div>
<div> </div>
<div>---------------------------</div>
<div>
<div>cfg = [];<br>cfg.dataset = 'e,rfhp0.1Hz'; </div>
<div>cfg.trialdef.eventtype = 'TRIGGER';<br>cfg.trialdef.eventvalue = 320; </div></div>
<div>
<div>cfg.trialdef.prestim = 1;<br>cfg.trialdef.poststim = 1;<br>cfg = ft_definetrial(cfg);<br></div>cfg.blc = 'yes'; % do baseline correction with the complete trial
<div><br>cfg.blcwindow = [-1 0];<br>cfg.channel = {'MEG'};<br>raw_DATA = ft_preprocessing(cfg);</div></div>
<div> </div>
<div> </div>
<div>cfg = [];<br>cfg.badchannel = {'A234'}; <br>cfg.neighbourdist = 0.03;
<div><br>[raw_DATA] = ft_channelrepair(cfg, raw_DATA)</div></div>
<div> </div>
<div>---------------------------------------------------------------------</div>
<div> </div>
<div>And here is the outcome: -----------------------------</div>
<div>
<div><br>the input is raw data with 248 channels and 201 trials<br>repairing channel A234<br> using neighbour A121<br> using neighbour A143<br></div> using neighbour A173<br> using neighbour A8
<div><br>repairing bad channels for trial 1<br>repairing bad channels for trial 2<br>repairing bad channels for trial 3<br></div>repairing bad channels for trial 4<br>repairing bad channels for trial 5<br>repairing bad channels for trial 6<br>
repairing bad channels for trial 7<br>repairing bad channels for trial 8<br>repairing bad channels for trial 9<br>repairing bad channels for trial 10</div>
<div>....</div>
<div> </div>
<div>-------------------------</div>
<div> </div>
<div>Thank you.</div>
<div> </div><font color="#888888">
<div>Jim<br></div></font></blockquote></div></div></div>_______________________________________________
<div><br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl" target="_blank">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></div>
</blockquote></div><br>
<div><span style="WORD-SPACING: 0px; FONT: medium Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate"><span style="WORD-SPACING: 0px; FONT: medium Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate">
<div style="WORD-WRAP: break-word">-----------------------<br>Don Rojas, Ph.D.<br>Associate Professor of Psychiatry<br>U. of Colorado Denver Anschutz Medical Campus<br>Director, UCD Magnetoencephalography Lab<br>13001 E. 17th Pl F546<br>
Aurora, CO 80045<br><a href="tel:303-724-4994" target="_blank" value="+13037244994">303-724-4994</a></div></span></span></div><br></div></div><br>_______________________________________________<br>fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">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>