[FieldTrip] Issues with trial by trial bad channel rejection
Varghese Peter
V.Peter at westernsydney.edu.au
Thu Aug 18 05:10:11 CEST 2016
Dear fieldtrip community,
I have 128 channel EEG data collected from young infants in an ERP paradigm. Since the EEG data from young infants are noisier than adults, I tried to implement a trial by trial bad channel correction. If a trial has more than 20 bad channels, reject the trial altogether and if the number of bad channels are less than 20, interpolate the bad channels. I have implemented this using the following script. It seems to work, but when I load the file after this step, it takes a long time to load it (up to 20 minutes) and all subsequent processing takes very long time. Is there a way to fix this?
Thank you,
Varghese
indx=1;
BadChannelCriterion=100;
AllTrialsBadChannelLabels={};
datr={};
TrialNos=[];
for loop =1:length(I09_ADSStd_epochs2.trial),
AllTrialsBadchannelIndex = find(max(abs(I09_ADSStd_epochs2.trial{loop}),[],2)>BadChannelCriterion);
SingleTrialBadChannelLabels= I09_ADSStd_epochs2.label(AllTrialsBadchannelIndex );
AllTrialsBadChannelLabels= [AllTrialsBadChannelLabels; SingleTrialBadChannelLabels];
if length(find(max(abs(I09_ADSStd_epochs2.trial{loop}),[],2)>BadChannelCriterion))<20,
BadchannelIndex = find(max(abs(I09_ADSStd_epochs2.trial{loop}),[],2)>BadChannelCriterion);
BadchannelLabels=I09_ADSStd_epochs2.label(BadchannelIndex);
cfg = [];
cfg.layout= lay;
cfg.badchannel = BadchannelLabels;
cfg.method = 'spline';
cfg.neighbours = EEG_neighbours;
cfg.trials = loop;
datr{indx} = ft_channelrepair(cfg,I09_ADSStd_epochs2);
TrialNos(indx)=loop;
indx=indx+1;
end
end
cfg = [];
I09_ADSStd_epochs_clean = ft_appenddata(cfg, datr{:});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160818/b156bccb/attachment-0001.html>
More information about the fieldtrip
mailing list