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

Emma Holmes eh776 at york.ac.uk
Mon Nov 3 12:04:17 CET 2014


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)

Best,
Emma



On 31 October 2014 16:02, Lam, N.H.L. (Nietzsche) <n.lam at fcdonders.ru.nl>
wrote:
> 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/6483e267/attachment.html>


More information about the fieldtrip mailing list