<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Matt,<div><br></div><div>It seems you have stumbled on some code that is still a bit under development, and apparently not really stable.</div><div><br></div><div>ft_selectdata should be able to do the trick for you, but I suspect a bug in ft_selectdata_new, so I'd try ft_selectdata_old instead.</div><div><br></div><div>To achieve this, you need to do something like this:</div><div><br></div><div>selchan = ft_channelselection({'all' '-E59'}, data.label);</div><div>data = ft_selectdata(data, 'channel', selchan); % notice the function's input now with key-value pairs, rather than a cfg.</div><div><br></div><div>We hope to find some time to improve the ft_selectdata_new soon. For the time being, could you file a bug on this issue on our bugzilla website? (<a href="http://www.bugzilla.fcdonders.nl">www.bugzilla.fcdonders.nl</a>)</div><div><br></div><div>Cheers,</div><div><br></div><div>JM</div><div><br></div><div><br><div><div>On Apr 6, 2012, at 8:05 PM, Matt Mollison wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Dear FieldTrippers,<div><br></div><div>I'm using fieldtrip-20120405. I'm trying to remove a "bad" channel from a subject's processed data (output of ft_timelockanalysis and ft_freqanalysis). I've found the function ft_selectdata (which runs ft_selectdata_new), but when I define my cfg to remove the bad channel (cfg.channels={'all','-E59'}) and use the function, it also removes the dimord field which subsequent ft_* functions need (e.g., ft_multiplotER, ft_timelockgrandaverage).</div>
<div><br></div><div>I could manually remove the channel, but I was hoping for a ft_* function that would modify the label field automatically. Manually replacing the channel with NaNs does not seem to be a solution because when I use ft_singleplotER to plot data from a ROI (i.e., multiple channels in a region) that includes this now-all-NaNs channel, nothing gets plotted (meaning a mean, and not a nanmean, function gets used to average over the ROI), so I fear the same thing will happen with other functions (e.g., ft_timelockstatistics). I also know I can use ft_rejectvisual early on in my processing, but I don't want to re-process my data (and I'm not currently using FT for artifact detection).</div>
<div><br></div><div>So my question is: what's the best FieldTrip function-based way to remove a channel?</div><div><br></div><div>Thanks,</div><div>Matt</div><div><br></div><div>--<br>
Univ. of Colorado at Boulder<br>Dept. of Psychology and Neuroscience<br><a href="mailto:matthew.mollison@colorado.edu" target="_blank">matthew.mollison@colorado.edu</a><br><a href="http://psych.colorado.edu/~mollison/" target="_blank">http://psych.colorado.edu/~mollison/</a><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>
<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: -webkit-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 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: -webkit-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; "><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: -webkit-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; "><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-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; "><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-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; "><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-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; 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; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Jan-Mathijs Schoffelen, MD PhD </div><div><br></div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><br></div><div>Max Planck Institute for Psycholinguistics,</div><div>Nijmegen, The Netherlands</div><div><br></div><div><a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: +31-24-3614793</div></div></span></div></span></div></span></div></span></div></span></span>
</div>
<br></div></body></html>