[FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources

Stan van Pelt s.vanpelt at fcdonders.ru.nl
Mon Nov 3 12:35:55 CET 2014

Hi Emma,

Try using data{i}.avg.pow instead of data{i}.pow.avg

(or use cfg.funparameter    = 'pow.avg' instead of cfg.funparameter    = 



From: fieldtrip-bounces at science.ru.nl 
[mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Emma Holmes
Sent: maandag 3 november 2014 12:04
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on 
EEG sources

Hi Nietzsche,

That's much clearer--thanks for your help. It seems as though I should have 
entered my sources estimates into data.pow.avg rather than data.avg.

However, I am still getting an error.

My data is structured:
data = <20x1 cell>                                % one cell array for each 
participant, n=20
data{i}.pos = [902629x3  double]            % x,y,z positions
data{i}.dim = [91 109 91]
data{i}.time = [1 x 11 double]                 % vector of time points
data{i}.pow.avg = [902629 x 11 double]    % source estimates

When I try:
     grandavgA = ft_sourcegrandaverage(cfg, data{:});

I get the error message:

     ??? Error using ==> ft_checkdata>fixsource at 1259
     the input does not contain an avg or trial field

     Error in ==> ft_checkdata at 650
       data = fixsource(data, 'type', sourcerepresentation);

     Error in ==> ft_sourcegrandaverage at 107
       varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 
'feedback', 'no',
       'inside', 'logical', 'sourcerepresentation', 'new');

It appears as though the function is searching for a data{i}.avg or 
data{i}.trial field. What data should these fields contain?

The wiki (http://fieldtrip.fcdonders.nl/reference/ft_datatype_source) seems 
to state that these are "historical" fields, although I have updated to 
fieldtrip-20141030 (the same error also occurs with older versions)



On 31 October 2014 16:02, Lam, N.H.L. (Nietzsche) <n.lam at fcdonders.ru.nl> 
> Hi Emma,
> In this part:
> ??? Undefined function or method 'fieldnames' for input arguments of >type 
> 'double'.
> Error in ==> parameterselection at 47
>     tmp = fieldnames(data.avg);
> it says that the function 'fieldnames' doesn't know how to deal with data 
> that is of the type
> double.  This is because fieldnames expects your data to be in the format 
> of a struct.  I'm
> guessing there was just an error in your implementation because from your 
> message you
> understood that "input data to ft_sourcegrandaverage contains a cell array 
> of structures -- ones
> for each participant.  Furthermore, you need to put your source estimates 
> in data.pow.avg.
> Based on your description, you might try something like this (but it's not 
> guaranteed to work
> because I'm not entirely sure about the details of your data)
> data.pos = [902629x3  double]
> data.dim = [91 109 91]
> data.time = [1 x Z double]       %   vector of time points
> data.pow.avg = [902629 x time points]   %   source estimates (or 
> potentially voxel x frequency
> x time points, depending on your data).
> As a side note, the size of your data will be quite taxing on 
> computational memory so you
> might also want to consider using a lower spatial resolution.
> Finally, in the future, when describing your data, it would be best to 
> show the structure of your
> data as shown in matlab (as done above), because this makes it easier for 
> everyone else to
> see what you've done.  Please check this FAQ for more details 
> http://fieldtrip.fcdonders.nl/ 
> <http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_communityhttp:/fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community>
> faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/ 
> <http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_communityhttp:/fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community>
> how_to_ask_good_questions_to_the_community 
> <http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_communityhttp:/fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community>
> Best,
> Nietzsche

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

More information about the fieldtrip mailing list