[FieldTrip] Undefined function or variable "lab"

Poljac, E. (Ervin) ervin.poljac at donders.ru.nl
Thu Aug 6 23:59:16 CEST 2015


Hi Jan-Mathijs,

Thanks for your answer, one of my colleagues indeed suggested that I should look at data.elec.label and it seems that there are two additional labels ('COMNT' and 'SCALE'. ), so after removing them, the ft_channelrepair function worked.

Regards,
Ervin

--
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
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl]
Sent: Monday, August 03, 2015 9:56 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Undefined function or variable "lab"

Hi Ervin,

Given the information provided, it’s still hard to tell what might be going on. What version of FieldTrip are you using, and what does dataTarget.elec look like? What do your colleagues have to say about this? (The reason for the last question is, that they most likely have most hands-on experience with the quirks of the particular dataformat you are working with, and thus will be able to provide more specific input than the people who occasionally read posts on this list).
Also, the statement that an ‘older version of fieldtrip works’ is quite unspecific (e.g. are your colleagues using a 2009-version of the code, or a more recent one :o)? Is there code totally unmodified, or did they made some code changes in order for it to work?), so I don’t think that this is going to bring you close to a solution. Yet, I think it is good diagnostic information to know that somewhere in the past ‘it’ seemed to work, either with or without local changes. Would it make sense for you to team up with your colleagues to find on what’s going on?

Best,
Jan-Mathijs



Jan-Mathijs Schoffelen, MD PhD, Senior researcher

Max Planck Institute for Psycholinguistics
Donders Centre for Cognitive Neuroimaging

E-mail: j.schoffelen at donders.ru.nl<mailto:j.schoffelen at donders.ru.nl>
Telephone: +31-24-3614793

http://www.hettaligebrein.nl
http://www.fieldtriptoolbox.org




On Jul 31, 2015, at 2:00 PM, Poljac, E. (Ervin) <ervin.poljac at donders.ru.nl<mailto:ervin.poljac at donders.ru.nl>> wrote:

Anyone an idea of what might be wrong here?
Much appreciated,
Ervin
________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Poljac, E. (Ervin) [ervin.poljac at donders.ru.nl<mailto:ervin.poljac at donders.ru.nl>]
Sent: Monday, July 27, 2015 1:54 PM
To: fieldtrip at science.ru.nl<mailto: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
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150806/526b5d12/attachment-0002.html>


More information about the fieldtrip mailing list