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

Emma Holmes eh776 at york.ac.uk
Fri Oct 31 14:45:04 CET 2014

Dear Eelke,

Thanks for your comment--a relevant suggestion. However, the fieldnames()
command is present in my version of MATLAB when I type "help fieldnames".
Therefore, I suspect my problem arises not because the function is
unavailable, but because the input to the function is incorrect.

The documentation states that the input to fieldnames() should be a
However, if data.avg should be a structure, this seems to conflict with
other fieldtrip data types involving data.avg.

I suspect that I should not input the source matrix to the data.avg field.
However, I am unsure into which field it should go... Is there anyone who
could help me?


On 31 October 2014 13:29, Eelke Spaak <eelke.spaak at donders.ru.nl> wrote:
> Dear Emma,
> I've not read your full post, but can say this about the latter part:
> fieldnames() should be a builtin MATLAB command. Most likely your
> version of MATLAB is too old; could you try using a more recent
> version? Typically we try to support versions up to 5 years old for
> use with FieldTrip.
> Hope that helps,
> Best,
> Eelke

On 31 October 2014 13:19, Emma Holmes <eh776 at york.ac.uk
<http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>> wrote:
>* Dear all,
*>>* I am trying to perform spatio-temporal cluster statistics to the sources of
*>* an EEG dataset, which I localised using the SPM8 toolbox.
*>* For each participant (averaged across trials), I have a .nii image
*>* containing the source reconstruction for each of two conditions at multiple
*>* different time points. Each nifti file contains a matrix of 91 x 109 x 91,
*>* which corresponds to the source estimates at each voxel.
*>* My aim is to identify sources of activity that span large clusters of voxels
*>* and/or time points, similar to what I have done previously with the scalp
*>* data.
*>>* I understand that the function 'ft_sourcestatistics' should be able to
*>* achieve this with the data output from the function 'ft_sourcegrandaverage'.
*>* However, I am having difficulty structuring the data from the nifti files in
*>* a format that can be successfully input to 'ft_sourcegrandaverage'.
*>>* The data that I am trying to input to 'ft_sourcegrandaverage' contains a
*>* cell array of structures--one for each participant.
*>* As far as I understand from the documentation, each structure should contain
*>* a 'pos' field, which specifies the [x y z] co-ordinates for each position in
*>* the matrix (in my case, a matrix of size 91*109*91 x 3).
*>* I have also included a 'time' field, containing a vector of the time points
*>* to which each .nii image corresponds and a 'dim' field containing the vector
*>* [91 109 91].
*>>* Could you please let me know whether or not this is correct and in which
*>* field(s) I should subsequently add the source reconstruction estimates at
*>* each time point.
*>* So far, I have tried including an 'avg' field with the data at each time
*>* point (91 x 109 x 91 x ntps).
*>* However, when I do so, I get the following error:
*>>* ??? Undefined function or method 'fieldnames' for input arguments of type
*>* 'double'.
*>>* Error in ==> parameterselection at 47
*>*     tmp = fieldnames(data.avg);
*>>* Error in ==> ft_checkdata at 578
*>*   param = setdiff(parameterselection('all', data), exclude);
*>>* Error in ==> ft_sourcegrandaverage at 81
*>*   varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'},
*>* 'feedback', 'no',
*>*   'inside', 'logical', 'sourcerepresentation', 'new');
*>>* I am using matlab version (R2008b) and fieldtrip-20140415
*>* (although I have also tried other fieldtrip versions).
*>>* Any help would be greatly appreciated.
*>>* Best wishes,
*>* Emma*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141031/8a3f0df3/attachment-0002.html>

More information about the fieldtrip mailing list