Thanks, JM. That seems to solve it. Bug submitted: <a href="http://bugzilla.fcdonders.nl/show_bug.cgi?id=1409">http://bugzilla.fcdonders.nl/show_bug.cgi?id=1409</a><div><br></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>

<br><div class="gmail_quote">On Fri, Apr 6, 2012 at 12:50 PM, jan-mathijs schoffelen <span dir="ltr"><<a href="mailto:jan.schoffelen@donders.ru.nl">jan.schoffelen@donders.ru.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">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" target="_blank">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><div class="h5"><div>On Apr 6, 2012, at 8:05 PM, Matt Mollison wrote:</div><br></div></div><blockquote type="cite"><div><div class="h5">

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></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></blockquote>

</div><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<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" target="_blank">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: <a href="tel:%2B31-24-3614793" value="+31243614793" target="_blank">+31-24-3614793</a></div>

</div></span></div></span></div></span></div></span></div></span></span>
</div>
<br></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>