<div dir="ltr">Hey Fieldtrip users,<div><br></div><div>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)</div><div><br></div><div>Thank you a lot</div><div>Victoria</div><div><br></div><div><div>%prepare neighbours</div><div>cfg_neighb = [];</div><div>cfg_neighb.feedback = 'yes';</div><div>cfg_neighb.method = 'triangulation';</div><div>cfg_neighb.layout = 'neuromag306all.lay';</div><div>neighbours = ft_prepare_neighbours(cfg_neighb, dat_orig);</div><div><br></div><div>% Interpolate and put into new data structure</div><div>cfg = [];</div><div>cfg.badchannel = {  'MEG1122', 'MEG1312','MEG1411'};</div><div>cfg.layout = 'neuromag306all.lay';</div><div>cfg.method = 'nearest';</div><div>cfg.neighbours = neighbours;</div><div>Chan_clean = ft_channelrepair(cfg,data_orig);</div></div><div><br></div><div>data=Chan_clean;</div><div>%time frequency analysis</div><div><div>cfg = [];</div><div>cfg.output       = 'pow';</div><div>cfg.channel      = 'MEGGRAD';</div><div>cfg.method       = 'mtmconvol';</div><div>cfg.taper        = 'hanning';</div><div>cfg.foi          = [2:2:30];</div><div>cfg.toi          = [-1.3:0.05:1];  </div><div>cfg.t_ftimwin    = ones(length(cfg.foi),1).*0.5;   </div><div>cfg.keeptrials   = 'yes';</div><div>cfg.trials = find(data.trialinfo(:,1) == 64 | data.trialinfo(:,1) == 128);</div><div>freq = ft_freqanalysis(cfg, data); </div><div><br></div><div>%time frequency baselined</div><div>cfg=[];</div><div>cfg.baseline     = [-0.5 0];</div><div>cfg.baselinetype = 'absolute';</div><div>Base = ft_freqbaseline(cfg, freq);</div><div><br></div><div>%Combine planar</div><div>Comb  = ft_combineplanar([],Base);</div></div><div><br></div><div><br></div><div>Error!</div><div><div>Reference to non-existent field 'chanori'.</div><div><br></div><div>Error in ft_combineplanar (line 293)</div><div>  newgrad.chanori  = data.grad.chanori(sel,:);</div></div><div><br></div></div>