[FieldTrip] ft_channelrepair replaces channel data with NaNs after running PCA
Keith Doelling
kd889 at nyu.edu
Fri Feb 17 18:08:53 CET 2012
Hi guys,
I'm struggling with my attempts to interpolate channel data for some bad
channels. I put in the following code:
<code>
cfg=[];
cfg.badchannel = 15;
cfg.missingchannel = [];
cfg.neighbours = neighbours;
cfg.trials = 'all';
cleanchdata = ft_channelrepair(cfg,cleandata);
</code>
the function the displays the following:
"the input is raw data with 157 channels and 80 trials
repairing channel AG015
using neighbour AG010
using neighbour AG014
using neighbour AG062
using neighbour AG092"
suggesting that neighbours have been selected successfully.
but a call to chdata.trial(1){15,:) just returns a bunch of NaNs rather
than interpolated data I need.
I found another email thread similar to this but that solution doesn't seem
to apply to me as the neighbours seemed to have been selected successfully.
The other interesting caveat is that ft_channelrepair seems to work fine if
i run it without having run pca (to reject eyeblink and heartbeat
components) beforehand.
The code for the component analysis and the subsequent rejection are in
separate loops. The PCA is saved into a .mat file and then loaded again
when i'm ready to reject the bad components. But for simplicity's sake the
important code looks like this.
<code>
% principle component analysis run with 32 components
cfg = [];
cfg.channel = (1:157);
cfg.runica.pca=32;
pca_data = ft_componentanalysis(cfg,data);
% view components in order to select bad ones
cfg = [];
cfg.layout = layout; % specify the layout file that should be used for
plotting
cfg.viewmode = 'component';
ft_databrowser(cfg, pca_data);
waitfor(gcf);
% type bad components as user input
% for example: if runica002 and runica0003 should be rejected, type
"2,3" into the dialogue box
badcomps = inputdlg({'Bad Components:'});
badcomps = str2double(csv2cell(badcomps{1}));
% reject bad components
cfg = [];
cfg.component = badcomps;
cleandata = ft_rejectcomponent(cfg,pca_data);
</code>
the variable 'cleandata' i get out from this code is the same cleandata i
put in to ft_channelrepair.
Are there any ideas as to what I've done wrong here? Let me know if I need
to give you guys more information.
Thanks for your help,
Keith
--
Keith Doelling
Lab Manager and Research Assistant
David Poeppel Lab
New York University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120217/d9f6f517/attachment-0001.html>
More information about the fieldtrip
mailing list