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

Lam, N.H.L. (Nietzsche) n.lam at fcdonders.ru.nl
Fri Oct 31 17:02:09 CET 2014


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/faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community

Best,
Nietzsche

From: Emma Holmes <eh776 at york.ac.uk<mailto:eh776 at york.ac.uk>>
Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources
Date: October 31, 2014 at 1:19:18 PM GMT+1
To: <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Reply-To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>

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 7.7.0.471 (R2008b) and fieldtrip-20140415 (although I have also tried other fieldtrip versions).

Any help would be greatly appreciated.

Best wishes,
Emma

_______________________________________________
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/20141031/2bf0d4cc/attachment.html>


More information about the fieldtrip mailing list