Undefined function or variable "sens"

Vladimir Litvak v.litvak at ION.UCL.AC.UK
Wed Jul 9 11:23:37 CEST 2008


Ah, I think I see what's happening. There was also a fix in statistics_wrapper:

% Revision 1.45  2008/04/09 14:14:09  roboos
% only make neighbours if clustering is required

Both problematic versions mentioned before are prior to this date. So
you should update to the latest version as I suggested before.

Vladimir


On Wed, Jul 9, 2008 at 10:17 AM, Vladimir Litvak <v.litvak at ion.ucl.ac.uk> wrote:
> Then perhaps Robert should look into it. If you look at
> statistics_wrapper line 229 it says:
>
>  if ~isfield(cfg,'neighbours') && isfield(cfg, 'correctm') &&
> strcmp(cfg.correctm, 'cluster')
>    cfg.neighbours = neighbourselection(cfg,varargin{1});
>  end
>
>
> Thus neighbourselection should not be called with the settings you
> specified. Perhaps try putting a breakpoint there and see what
> happens.
>
> Best,
>
> Vladimir
>
>
>
> On Wed, Jul 9, 2008 at 8:38 AM, Thomas Dijkman
> <t.b.dijkman at student.utwente.nl> wrote:
>> This script that causes this error on Arjen's computer was written by me, and the strange part is that it worked perfectly on my computer, but caused the error on Arjen's computer. I just looked into the matter you brought up, the MCP correction, but my script does not specify it. You have to explicitly add the option in cfg.correctm for it to be used. And since the default option for cfg.correctm = 'no', I don't understand the reason for this error. The fact that it is solved by adding a 2D layout file, means that somehow freqstatistics is in fact using MCP correction, even though it is not specified to do this. Both computers run the same Matlab version (R2007B, 7.5.0), and I was using fieldtrip 20080519 until I updated it to 20080708 this morning. The script still runs fine on my PC.
>>
>> Regards,
>>
>> Thomas Dijkman
>>
>>
>> -----Oorspronkelijk bericht-----
>> Van: FieldTrip discussion list namens Vladimir Litvak
>> Verzonden: di 8-7-2008 18:16
>> Aan: FIELDTRIP at NIC.SURFNET.NL
>> Onderwerp: Re: [FIELDTRIP] Undefined function or variable "sens"
>>
>> The fact that you get this error indicates that somewhere you
>> specified correction for multiple comparisons using clustering. If you
>> want to get clusters on the scalp then you do use neighbour relations
>> even if you don't call neighbourselection explicitly. It will be
>> called by freqstatistics. Freqstatistics assumes that you do use scalp
>> clustering unless you specify otherwise. So if you don't say that you
>> don't want scalp clustering and don't provide any way to determine
>> neighbour relations, there is an error. So depending on what you
>> really want you should do one of three things:
>>
>> 1) If you do not want to use clustering at all specify a different way
>> of MCP correction (like 'max').
>>
>> 1) If you do want to have scalp clusters then provide the layout as
>> you are doing now.
>>
>> 2) If you want to have clusters but only in time-frequency and not in
>> space put an empty neighbourhood structure in your cfg. Like (assuming
>> that cfg.channel is a list of your labels).
>>
>> cfg.neighbours = struct([]);
>> for chan=1:length(cfg.channel)
>>    cfg.neighbours{chan}.label = cfg.channel{chan};
>>    cfg.neighbours{chan}.neighblabel = {};
>> end
>>
>> Not that in this case you will still have MCP correction over
>> channels, so if you have more channels you loose power. So just
>> include the channels you really want to test.
>>
>> Best,
>>
>> Vladimir
>>
>>
>> On Tue, Jul 8, 2008 at 4:36 PM, A. Stolk <A.Stolk at ewi.utwente.nl> wrote:
>>> Thank you for your reply. I got the errors both in fieldtrip-20080325 and in fieldtrip-20080408. I'm not intending to use any neighbour relations, just frequency statistics. Adding my own EEG.lay solved the problem.
>>>
>>> Regards,
>>>
>>> Arjen
>>>
>>> ________________________________
>>>
>>> Van: FieldTrip discussion list namens Vladimir Litvak
>>> Verzonden: di 7/8/2008 5:24
>>> Aan: FIELDTRIP at NIC.SURFNET.NL
>>> Onderwerp: Re: [FIELDTRIP] Undefined function or variable "sens"
>>>
>>>
>>>
>>> I don't think it's a matter of 'light', but it might be a matter of a
>>> different FT version. If you look in neighbourselection.m there is a
>>> comment
>>>
>>> % Revision 1.8  2007/05/14 08:26:31  roboos
>>> % added option to construct neighbours from 2-D layout
>>>
>>> So if you FT dates prior to that date, it cannot determine neighbour
>>> relations based on 2D layout. Update your FT and see if it solves the
>>> problem. Without layout and without 3D electrode positions it won't
>>> work and rightly so. With layout it should work if your FT is up to
>>> date.
>>>
>>> Best,
>>>
>>> Vladimir
>>>
>>>
>>>
>>> On Tue, Jul 8, 2008 at 10:46 AM, A. Stolk <A.Stolk at ewi.utwente.nl> wrote:
>>>> If I add my own EEG.lay, the function does work well. If I leave it out, it does give the errors mentioned below. This problem is somehow absent in the 'light' fieldtrip edition installed on another computer.
>>>>
>>>> Regards,
>>>>
>>>> Arjen Stolk
>>>>
>>>> ________________________________
>>>>
>>>> Van: FieldTrip discussion list namens A. Stolk
>>>> Verzonden: di 7/8/2008 10:36
>>>> Aan: FIELDTRIP at NIC.SURFNET.NL
>>>> Onderwerp: Re: [FIELDTRIP] Undefined function or variable "sens"
>>>>
>>>>
>>>>
>>>> Thank you for your quick reply. I indeed do use a self-made EEG.lay, but am not using the neighbourselection.m.
>>>> I do manage to get my script to work on another computer, but somehow not on this one.
>>>>
>>>> ________________________________
>>>>
>>>> Van: FieldTrip discussion list namens Vladimir Litvak
>>>> Verzonden: do 7/3/2008 5:10
>>>> Aan: FIELDTRIP at NIC.SURFNET.NL
>>>> Onderwerp: Re: [FIELDTRIP] Undefined function or variable "sens"
>>>>
>>>>
>>>>
>>>> Do you actually have electrode positions somewhere in your data? They
>>>> are not usually supposed to get there by themselves so unless you
>>>> somehow got them there (like read in a file with sensor positions),
>>>> they are indeed missing. For statistics you don't actually need sensor
>>>> positions You can specify the neighborhood relations 'by hand' instead
>>>> of calling neighbourselection.
>>>>
>>>> Best,
>>>>
>>>> Vladimir
>>>>
>>>> On Thu, Jul 3, 2008 at 3:05 PM, A. Stolk <A.Stolk at ewi.utwente.nl> wrote:
>>>>> Dear fieldtrippers,
>>>>>
>>>>> While performing statitstical analysis on time-frequency EEG data, I get the following error:
>>>>>
>>>>> ??? Undefined function or variable "sens".
>>>>> Error in ==> neighbourselection at 106
>>>>> if ~isstruct(sens)
>>>>> Error in ==> statistics_wrapper at 226
>>>>>    cfg.neighbours = neighbourselection(cfg,varargin{1});
>>>>> Error in ==> freqstatistics at 132
>>>>> [stat] = statistics_wrapper(cfg, varargin{:});
>>>>> Error in ==> fieldtripstatanalyse at 70
>>>>> [stat] = freqstatistics(cfg, stimulusFFT, baselineFFT);
>>>>>
>>>>> The neighbourselection function tells:
>>>>>
>>>>> if ~isstruct(sens)
>>>>>
>>>>> error('Did not find gradiometer or electrode information.');
>>>>>
>>>>>
>>>>>
>>>>> which gets its data by:
>>>>>
>>>>> % Revision 1.6 2006/07/12 14:14:59 roboos
>>>>>
>>>>> % get sens from data.grad/elec
>>>>>
>>>>>
>>>>>
>>>>> I get this error on several matlab and fieldtrip versions. Any suggestions how to solve this?
>>>>>
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Arjen Stolk
>>>>>
>>>>>
>>>>>
>>>>> ----------------------------------
>>>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
>>>>>
>>>>>
>>>>
>>>> ----------------------------------
>>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
>>>>
>>>> ----------------------------------
>>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
>>>>
>>>> ----------------------------------
>>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
>>>>
>>>>
>>>
>>> ----------------------------------
>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
>>>
>>> ----------------------------------
>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
>>>
>>>
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
>>
>>
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.



More information about the fieldtrip mailing list