[FieldTrip] Only 1 and Inf as output of ft_connectivityanalysis

"Jörn M. Horschig" jm.horschig at donders.ru.nl
Fri May 3 08:32:30 CEST 2013


Dear Lucia,

could you try whether the error persists with a recent version? If it 
does, could you go test whether this code gives the same error:

/
% ************* code starts here /
/%dummy data
cfg             = [];
cfg.ntrials     = 500;
cfg.triallength = 1;
cfg.fsample     = 200;
cfg.nsignal     = 3;
cfg.method      = 'ar';
cfg.params(:,:,1) = [ 0.8 0   0;
                       0   0.9 0.5;
                       0.4 0   0.5];
cfg.params(:,:,2) = [-0.5    0  0;
                         0 -0.8  0;
                         0    0 -0.2];
cfg.noisecov      = [0.3 0 0;
                        0 1 0;
                        0 0 0.2];

data            = ft_connectivitysimulation(cfg);


% freqanalysis
cfgf           = [];
cfgf.method    = 'mtmfft';
cfgf.output    = 'fourier';
cfgf.tapsmofrq = 2;
freq           = ft_freqanalysis(cfgf, data);

% connectivityanalysis
cfgc           = [];
cfgc.method    = 'coh';
c1             = ft_connectivityanalysis(cfgc, freq);

c1.cohspctrm//
% ************* code ends here
/
The code snippet above is part of our test suite for making sure that 
everything works fine. If it does work for you, but does not with your 
own data instead of simulated data, the error must be somewhere in your 
data, e.g. powspctrm consists of nans or 0s etc. Anyway, I assume that 
it will all work fine if you use an updated version of FieldTrip.

Best,
Jörn


On 5/3/2013 12:56 AM, Lucia Melloni wrote:
> Hi Jan-Mathijs,
> still the same result with the code that you suggested.
>
> selection fourierspctrm along dimension 2
> averaging crsspctrm over rpt
> removing dimension rpt from crsspctrm
> Warning: PROGRESS is only a compatibility wrapper, which will soon be 
> removed. Please instead call FT_PROGRESS.
> > In progress at 16
>   In ft_connectivity_corr at 87
>   In ft_connectivityanalysis at 524
> Warning: PROGRESS is only a compatibility wrapper, which will soon be 
> removed. Please instead call FT_PROGRESS.
> > In progress at 16
>   In ft_connectivity_corr at 89
>   In ft_connectivityanalysis at 524
> Warning: PROGRESS is only a compatibility wrapper, which will soon be 
> removed. Please instead call FT_PROGRESS.
> > In progress at 16
>   In ft_connectivity_corr at 106
>   In ft_connectivityanalysis at 524
> the call to "ft_connectivityanalysis" took 0 seconds
>
>
> Lucia
>
> -- 
> Lucia.
>
>
> On Thu, May 2, 2013 at 3:12 PM, jan-mathijs schoffelen 
> <jan.schoffelen at donders.ru.nl <mailto:jan.schoffelen at donders.ru.nl>> 
> wrote:
>
>     Hi Lucia,
>
>     The warnings indicate that you are dividing by zero. Are you sure
>     that your cfg is correct?
>
>     Please try
>
>     cfg = [];
>     cfg.method = 'coh';
>     coh = ft_connectivityanalysis(cfg, freq);
>
>     This should work.
>
>     Best,
>     Jan-Mathijs
>
>     On May 2, 2013, at 6:56 PM, Lucia Melloni wrote:
>
>>     Hi jan-mathijs
>>
>>     Unfortunately I get the same result whether or not I remove the
>>     mean.
>>     Best,
>>     -- Lucía
>>
>>     On May 2, 2013, at 9:57 AM, jan-mathijs schoffelen
>>     <jan.schoffelen at donders.ru.nl
>>     <mailto:jan.schoffelen at donders.ru.nl>> wrote:
>>
>>>     Hi Lucia,
>>>
>>>     Could you remove cfg.removemean = 'yes' and try again?
>>>
>>>     Best,
>>>
>>>     Jan-Mathijs
>>>
>>>     On Apr 29, 2013, at 2:38 AM, Lucia Melloni wrote:
>>>
>>>>     Hi!
>>>>     I am trying to calculate coherence using
>>>>     ft_connectivityanalysis, but
>>>>     I am getting only ones and infinity as output in cohspctrm with
>>>>     all of
>>>>     my data sets.
>>>>
>>>>     I first run ft_freqanalysis with
>>>>     cfg.method = 'mtmfft';
>>>>     cfg.taper = 'dpss';
>>>>     cfg.output = 'fourier';
>>>>     cfg.foilim = [1 45];
>>>>     cfg.tapsmofrq = 1;
>>>>     cfg.keeptrials = 'yes';
>>>>     cfg.keeptapers = 'yes';
>>>>     freq = ft_freqanalysis(cfg, data);
>>>>
>>>>     Whether I do or I do not specify cfg.channel and cfg.channelcmb
>>>>     here
>>>>     does not seem to make a difference for my problem later on. The
>>>>     spectra look absolutely fine.
>>>>
>>>>     I then run ft_connectivityanalysis with
>>>>     cfg.method    = 'coh';
>>>>     cfg.removemean= 'yes';
>>>>     cfg.trials    = 'all';
>>>>     cfg.feedback  = 'yes';
>>>>     cfg.complex   = 'abs';
>>>>     coh           = ft_connectivityanalysis(cfg, freq);
>>>>
>>>>     The cohspctrm looks like this:
>>>>     val(:,:,1,1) =
>>>>
>>>>         1   Inf   Inf   Inf   Inf   Inf   Inf   Inf   Inf   Inf   Inf
>>>>     Inf   Inf   Inf (etc.)
>>>>
>>>>     I get the following warning during ft_connectivityanalysis
>>>>
>>>>     Warning: Divide by zero.
>>>>>     In ft_connectivity_corr at 103
>>>>      In ft_connectivityanalysis at 524
>>>>     Warning: Divide by zero.
>>>>>     In ft_connectivity_corr at 104
>>>>      In ft_connectivityanalysis at 524
>>>>
>>>>     The same happens if I try to calculate PLV through
>>>>     ft_connectivityanalysis.
>>>>     This is with Fieldtrip version 20130422 and 20130427, Matlab
>>>>     R2009a,
>>>>     Windows 7 (64bit).
>>>>
>>>>     Any advice?
>>>>     Thanks!
>>>>     Lucia
>>>>     _______________________________________________
>>>>     fieldtrip mailing list
>>>>     fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>>>>     http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>
>>>     Jan-Mathijs Schoffelen, MD PhD
>>>
>>>     Donders Institute for Brain, Cognition and Behaviour,
>>>     Centre for Cognitive Neuroimaging,
>>>     Radboud University Nijmegen, The Netherlands
>>>
>>>     Max Planck Institute for Psycholinguistics,
>>>     Nijmegen, The Netherlands
>>>
>>>     J.Schoffelen at donders.ru.nl <mailto:J.Schoffelen at donders.ru.nl>
>>>     Telephone: +31-24-3614793 <tel:%2B31-24-3614793>
>>>
>>>     http://www.hettaligebrein.nl <http://www.hettaligebrein.nl/>
>>>
>>>     _______________________________________________
>>>     fieldtrip mailing list
>>>     fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>>>     http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>     _______________________________________________
>>     fieldtrip mailing list
>>     fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>>     http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>     Jan-Mathijs Schoffelen, MD PhD
>
>     Donders Institute for Brain, Cognition and Behaviour,
>     Centre for Cognitive Neuroimaging,
>     Radboud University Nijmegen, The Netherlands
>
>     Max Planck Institute for Psycholinguistics,
>     Nijmegen, The Netherlands
>
>     J.Schoffelen at donders.ru.nl <mailto:J.Schoffelen at donders.ru.nl>
>     Telephone: +31-24-3614793 <tel:%2B31-24-3614793>
>
>     http://www.hettaligebrein.nl
>
>
>     _______________________________________________
>     fieldtrip mailing list
>     fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>     http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-- 
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group
FieldTrip Development Team

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: jm.horschig at donders.ru.nl
Tel:    +31-(0)24-36-68493
Web: http://www.ru.nl/donders

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130503/b84b92e0/attachment-0002.html>


More information about the fieldtrip mailing list