[FieldTrip] ft_combineplanar after ft_channelrepair

Murphy, Kelly (Research Student) murphyk5 at aston.ac.uk
Mon Mar 7 22:56:10 CET 2016


Hi Victoria,

I don’t know if this will address your problem; but I think it might depend on the order of your pipeline because if you use PCA at any point before interpolating, you will be reducing the dimensionality of your data; and interpolation (and presumably combining gradiometers) relies on the data from neighbouring channels to be linearly related.

In my pipeline, I’ve visually rejected trials and channels, then run ICA, then interpolated; I don’t know if that would address your issues?

Hope you get it sorted

Kelly

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of victoria schroeder
Sent: 07 March 2016 20:47
To: FieldTrip discussion list
Subject: [FieldTrip] ft_combineplanar after ft_channelrepair

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/3bb885ae/attachment-0002.html>


More information about the fieldtrip mailing list