[FieldTrip] ft_source2sparse usage for EEG data

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Sun May 8 08:27:51 CEST 2016


Hi Gina,

First of all: it is not possible to compute connectivity from data that contains just a single trial.
Second, it is not clear to me what kind of source reconstruction you have done, so it is difficult to comment here.
In general, although I haven’t tried this recently myself, the best chances of being successful with your approach would be in the following ‘pipeline’ (I only flash out the functions to be used + some small details regarding the settings):

0. start with your data in a fieldtrip structure containing multiple trials.
1. call ft_freqanalysis to get the spectral representation of the data. Use cfg.method = ‘mtmfft’, cfg.output = ‘fourier’
2. call ft_sourceanalysis, using a frequency domain beamformer to get the voxel-wise spectral representation of the data. Staying entirely within fieldtrip (i.e. without using some small hacks), you probably need the following: cfg.method = ‘pcc’ (this will give you the ‘mom’ in the appropriate shape, such that ft_connectivityanalysis may swallow it), cfg.pcc.fixedori = ‘yes’ (this gives a single orientation per voxel, i.e. a mom that is 1xobservations)
3. call ft_connectivityanalysis.

It could be that you have been doing all this already (since you mention the networkanalysis tutorial, where at first glance this procedure is followed), and in that case I would first address points 0 and 1 above.

Good luck,
Jan-Mathijs



> On 07 May 2016, at 19:34, gj <gina.joue at univr.it> wrote:
> 
> Hi,
> 
> Sorry about that!! Good to know...I follow the forum threaded, so I made the false assumption that others do the same and that given the volume of emails/info overload and overworked forum-answering Samaritans these days that it was better to be concise rather than reiterate previous info...I do fully appreciate that people are kindly answering forum questions completely out of their good will -- without which I would be (more) lost and tearing more of my hair out -- so I FULLY appreciate you guys and, contrary to the end effect, I really do make an effort to try and package my questions....
> 
> 
> To summarize, I am trying to use FieldTrip ver.20160309 to run a whole-brain network analysis on source level on a 2-sec continuous recording of EEG (preprocessed and averaged across all trials per condition per subject in another software -- I manually put the data in Fieldtrip format). Note that in trying to hack a way around the problem I've since reworked the data multiple times -- hence the numbers below are now not the same as what I previously posted, but the error is the same.
> 
> Following the tutorials (for MEG: http://www.fieldtriptoolbox.org/tutorial/networkanalysis), I first run ft_source2sparse to reduce the matrix to only voxels inside the skull:
> 
> 
>>> source_sparse = ft_source2sparse(source_proj);
> total number of dipoles        : 6804
> number of dipoles inside  brain: 3294
> number of dipoles outside brain: 3510
> 
> When I then try to run the connectivity analysis (ft_connectivityanalysis), regardless of which connectivity method (I've tried the various options), e.g.
> 
> 
> cfg=[];
> cfg.method  ='coh';
> cfg.complex = 'absimag';
> source_conn = ft_connectivityanalysis(cfg, source_sparse);
> 
> 
> I get the error:
> 
> ------------ error -----------
> Requested 23058x23058 (7.9GB) array exceeds maximum array size preference. Creation
> of arrays greater than this limit may take a long time and cause MATLAB to become
> unresponsive. See array size limit or preference panel for more information.
> 
> Error in univariate2bivariate (line 314)
>          data.crsspctrm = (transpose(mom)*conj(mom))./nrpt;
> 
> Error in ft_connectivityanalysis (line 434)
>        [data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm',
>        dtype, 'cmb', cfg.refindx, 'keeprpt', 0);
> ------------ end error -----------
> 
> 
> In univariate2bivariate(), it goes into "source moments are multivariate" with
> 
> size(data.mom,1) = 3294
> sizmom = [3, 7]
> 
> Does this mean there were 3 dominant orientations of the source reconstructed data? I had done the projection with the following call:
> 
> cfg = [];
> cfg.projectmom = 'yes';
> source_proj = ft_sourcedescriptives(cfg,source);
> 
> 
> At a loss -- not sure whether I set up something incorrectly? Thanks a mil in advance for any help or tips on where to troubleshoot!!!
> Gina
> 
> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip





More information about the fieldtrip mailing list