[FieldTrip] Reference to non-existent field 'mom' in ft_connectivityanalysis

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Wed May 15 10:35:29 CEST 2019


Hi Davide,

Indeed:

1) The ‘dics’ method does not allow for keeping of the mom. This is because the FT implementation tries to stay close to Joachim’s original description in his 2001 PNAS paper, where all computations ‘under the hood’, and intermediate single trial fourier coefficients are not explicitly made available.

2) If the input data does not contain the fourier coefficients, no mom can be computed. This is because the mom for a frequency domain beamformer is obtained by left multiplication of the spatial filter with the nchan x ntaper fourier matrix (for the frequency bin of interest).

Ergo,

only ‘pcc’ in combination with ‘fourier’ will return data that can be fed into ft_connectivityanalysis in the way that is currently supported.

So far so good.

I agree that the documentation (in the help function, as well as in the form of a FAQ or example on the website) can be improved. Also, it might be useful to implement some informed error handling.

Please feel free to contribute to the project along those lines. Both code and website changes work through a pull request on github.

Best wishes and keep up the good work,

Jan-Mathijs





On 14 May 2019, at 15:27, Davide Sometti <davide.sometti-1 at studenti.unitn.it<mailto:davide.sometti-1 at studenti.unitn.it>> wrote:

Dear community,
I’m trying to perform connectivity analysis (Matlab 2018b, FieldTrip 2018-12-11), in order to obtain the absolute part of the imaginary coherence. Here are the steps that I’ve used in order to perform it.
1-     First I performed the frequency analysis, on the single condition (not showed), and on all the conditions together
cfg = [];
cfg.channel    = chn;
cfg.method     = 'mtmfft';
cfg.output     = 'powandcsd';
cfg.taper      = 'dpss';
cfg.keeptrials ='no';
cfg.keeptapers ='no';
cfg.tapsmofrq  = 3;
cfg.foi        = [6; 11; 16; 21; 26; 40];
data_freq_all  = ft_freqanalysis(cfg, data_reject_all);

2-     I computed the beamformer filters based on the entire data
cfg=[];
cfg.method='dics';
cfg.frequency=6;
cfg.grid=lf;
cfg.grid.pos=pos;
cfg.grid.tri=tri;
cfg.headmodel=hdm;
cfg.senstype     = 'meg';
cfg.dics.projectnoise = 'yes';
cfg.dics.lambda       = '5%';
cfg.dics.keepfilter   = 'yes';
cfg.dics.realfilter   = 'yes';
cfg.dics.keepcsd       = 'yes';
cfg.dics.keepmom       = 'yes';
cfg.dics.fixedori     = 'yes';
sourceAll = ft_sourceanalysis(cfg,data_all);

3-     I've then performed the source analysis on each of the four conditions, using the precomputed filter
cfg.grid.filter=sourceAll.avg.filter;

source_pre_incl=ft_sourceanalysis(cfg,data_pre_incl);
source_pre_excl=ft_sourceanalysis(cfg,data_pre_excl);
source_post_incl=ft_sourceanalysis(cfg,data_post_incl);
source_post_excl=ft_sourceanalysis(cfg,data_post_excl);

4-     Finally I’ve performed the connectivity analysis





cfg=[];
cfg.method  ='coh';
cfg.complex = 'absimag';
source_conn = ft_connectivityanalysis(cfg, source_pre_incl);

When I try to run the connectivity analysis I get this error, and I cannot go further in the analysis.

Reference to non-existent field 'mom'.

Error in univariate2bivariate (line 225)
      sizmom = size(data.mom{data.inside(1)});

Error in ft_connectivityanalysis (line 449)
        [data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm', dtype, 'cmb', cfg.refindx, 'keeprpt', 0);


I’ve tried different solution, changing output for the frequency analysis and method for the beamforming, like follow:

'fourier' - 'pcc'
'powandcsd' - 'pcc'
'fourier' - 'dics'
The combination fourier and pcc was the only one that worked, among the 4, the others always gave me the same error, as above. I’m wondering why even if I’ve specified cfg.keepmom=’yes’, this one is not present in the structure after the source analysis.
Anyone that could help me?
Davide S.
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190515/19b946f1/attachment-0002.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list