[FieldTrip] ft_combineplanar after ft_channelrepair
victoria schroeder
vic.schroeder2 at gmail.com
Mon Mar 7 21:47:07 CET 2016
Hey Fieldtrip users,
I am working with neuromag data 306 channels. I would like to interpolate
channels using ft_channelrepair. Afterwards it would be good to combine the
gradiometers to create planar gradients. However, unfortunately i get an
error message when trying to use ft_combineplanar when i have used
ft_channelrepair. Without using ft_channelrepair things work well. Can
these two functions not be used on the same data? (See the code and the
error message below)
Thank you a lot
Victoria
%prepare neighbours
cfg_neighb = [];
cfg_neighb.feedback = 'yes';
cfg_neighb.method = 'triangulation';
cfg_neighb.layout = 'neuromag306all.lay';
neighbours = ft_prepare_neighbours(cfg_neighb, dat_orig);
% Interpolate and put into new data structure
cfg = [];
cfg.badchannel = { 'MEG1122', 'MEG1312','MEG1411'};
cfg.layout = 'neuromag306all.lay';
cfg.method = 'nearest';
cfg.neighbours = neighbours;
Chan_clean = ft_channelrepair(cfg,data_orig);
data=Chan_clean;
%time frequency analysis
cfg = [];
cfg.output = 'pow';
cfg.channel = 'MEGGRAD';
cfg.method = 'mtmconvol';
cfg.taper = 'hanning';
cfg.foi = [2:2:30];
cfg.toi = [-1.3:0.05:1];
cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5;
cfg.keeptrials = 'yes';
cfg.trials = find(data.trialinfo(:,1) == 64 | data.trialinfo(:,1) == 128);
freq = ft_freqanalysis(cfg, data);
%time frequency baselined
cfg=[];
cfg.baseline = [-0.5 0];
cfg.baselinetype = 'absolute';
Base = ft_freqbaseline(cfg, freq);
%Combine planar
Comb = ft_combineplanar([],Base);
Error!
Reference to non-existent field 'chanori'.
Error in ft_combineplanar (line 293)
newgrad.chanori = data.grad.chanori(sel,:);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160307/6b1a2bce/attachment-0001.html>
More information about the fieldtrip
mailing list