[FieldTrip] Undefined function or variable "lab"

Poljac, E. (Ervin) ervin.poljac at donders.ru.nl
Fri Jul 31 14:00:26 CEST 2015


Anyone an idea of what might be wrong here?
Much appreciated,
Ervin
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Poljac, E. (Ervin) [ervin.poljac at donders.ru.nl]
Sent: Monday, July 27, 2015 1:54 PM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] Undefined function or variable "lab"

Hello fieldtrippers,

I am trying to prepare my EEG data for analysis. Among others, I identify bad channels and try to repair them. However, there is this annoying error:

Undefined function or variable "lab".

Error in channelposition (line 314)
n   = size(lab,2);

Error in ft_datatype_sens (line 329)
        [chanpos, chanori, lab] = channelposition(sens);

Error in ft_datatype_raw (line 146)
      data.elec = ft_datatype_sens(data.elec);

Error in ft_checkdata (line 225)
  data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo);

Error in ft_channelrepair (line 102)
data = ft_checkdata(data, 'datatype', 'raw', 'feedback', 'yes');

In the debug mode I see that the variable 'sens' has a correct value, the bad channel seems to be identified, but then for some reason, lab is not filled. I am copy-pasting that part of my code below.
I hope someone has experience with this and how to solve it. Some of my colleagues use an older fieldtrip version that works (so, no error there), and I compared the filein s ft_checkdata, ft_datatype_sens and ft_datatype_sens, they are different, but it is not obvious to me what exactly is new, causing the error.

Many thanks,
Ervin

My code:

%% channel rejection, identifying bad channels for target condition
cfg=[];
cfg.method = 'mtmfft';
cfg.output = 'pow';
cfg.taper  = 'hanning';
cfg.foi = [50];% frequency band - foilim or just foi??
rejectedData=ft_freqanalysis(cfg,dataTarget);

idx=unique([find(rejectedData.powspctrm>0.5*10^4)]); %this threshold might change for each recording
neighbours=open('/Users/Ervin/Documents/MATLAB/biosemi64_neighb.mat');
neighbours=neighbours.neighbours;
cfg = [];
cfg.channel  = rejectedData.label;
cfg.layout = 'biosemi64.lay';
cfg.feedback = 'yes';
lay = ft_prepare_layout(cfg);

if ~isempty(idx)
badchannels=cell(numel(idx),1);
[badchannels{1:numel(idx),1}] = deal(rejectedData.label{idx});

% Interpolation for rejected channels
cfg=[];
cfg.layout=lay;
cfg.badchannel=badchannels;
dataTarget.elec.label = dataTarget.label;
dataTarget.elec.pnt = lay.pos;
cfg.neighbours=neighbours;
dataTargetRepaired=ft_channelrepair(cfg, dataTarget);
end

--
Ervin Poljac, PhD
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognition (DCC)
Radboud University Nijmegen
Room B.00.78A Montessorilaan 3 6500 HE Nijmegen
T. 024 36 15457
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150731/4580d88c/attachment-0002.html>


More information about the fieldtrip mailing list