Back to the main page.

Bug 3188 - ft_connectivityanalysis inconsistent output for powcorr_ortho

Reported 2016-10-22 16:26:00 +0200
Modified 2016-11-29 09:00:06 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on:
See also:

Jens Klinzing - 2016-10-22 16:26:37 +0200

When calling ft_connectivityanalysis with method = 'powcorr_ortho' the output is different in many ways from the output when using 'coh' or 'plv' (I didnt test any other methods). This leads to problems when analyzing the output further, for example because getdimord does not recognize the output's dimensions ('unknown_unknown') when calling ft_sourceparcellate. Example output for methods coh, plv, and powcorr_ortho: source_coh = dim: [18 21 18] inside: [3294x1 double] pos: [6804x3 double] outside: [3510x1 double] cohspctrm: [6804x6804 double] dimord: 'pos_pos_freq' freq: 7.9828 cfg: [1x1 struct] source_plv = dim: [18 21 18] inside: [3294x1 double] pos: [6804x3 double] outside: [3510x1 double] plvspctrm: [6804x6804 double] dimord: 'pos_pos_freq' freq: 7.9828 cfg: [1x1 struct] source_pco = dim: [18 21 18] inside: [6804x1 logical] pos: [6804x3 double] powcorrspctrm: [3294x3294 double] dimord: '{pos}_ori' cfg: [1x1 struct] Note that the dimord and the inside/outside description is different as well as a missing freq field. Also the spectrum is given for all locations in the first two cases and only for inside locations in the last case. The inside description should probably be logical in all cases. The actual structures, the data used to produce them, and the code for the connectivityanalysis is here: cfg = []; cfg.method = 'coh'; cfg.complex = 'absimag'; source_coh = ft_connectivityanalysis(cfg, source); cfg = []; cfg.method = 'plv'; source_plv = ft_connectivityanalysis(cfg, source); cfg = []; cfg.method = 'powcorr_ortho'; source_pco = ft_connectivityanalysis(cfg, source);

Jan-Mathijs Schoffelen - 2016-10-24 10:35:34 +0200

I have created some test data (based on the source.mat variable only, to keep the file size manageable on /home/common/fieldtrip/data/test/bug3188.mat). With a reduced number of inside voxels, I could reproduce: -the old-style inside/outside indexing for the 'coh' method -the inconsistent data representation for 'powcorr_ortho' I fixed this issues in a separate branch and will initiate a pull request shortly.

Jan-Mathijs Schoffelen - 2016-10-24 13:50:17 +0200

I pull requested the changes. All seems to work fine regarding this issue

Jens Klinzing - 2016-10-24 14:16:27 +0200

(In reply to Jan-Mathijs Schoffelen from comment #2) Perfect, also ft_sourceparcellate deals with the output properly now. Thanks!