Computing connectivity in electrophysiological data

FieldTrip has a consistent set of low-level functions for the computation of connectivity, i.e. estimating a bivariate or multivariate quantity from electrophysiological data, both on the sensor level and on the source level.

The objective of supplying these low-level functions as a separate module/toolbox are to

  1. facilitate the reuse of these functions in other open-source projects (e.g. EEGLAB, SPM)
  2. facilitate the implementation and support for new inverse methods, esp. for external users/contributors
  3. facilitate the implementation of advanced features

The low-level functions are in the connectivity module, which is released together with FieldTrip but can also be downloaded here as a separate toolbox.

Please note that if you are an end-user interested in analyzing experimental EEG/MEG/ECoG data, you will probably will want to use the high-level FieldTrip functions. The functions such as ft_preprocessing, ft_timelockanalysis, ft_sourceanalysis, ft_mvaranalysis, ft_freqanalysis, ft_connectivityanalysis and ft_networkanalysis provide a user-friendly interface that take care of all relevant analysis steps and the data bookkeeping.

Supported connectivity metrics

  1. coherence
  2. correlation
  3. directed transfer function
  4. granger causality, spectrally resolved
  5. imaginary part of coherency
  6. instantaneous causality
  7. pairwise phase consistency
  8. partial coherence
  9. partial correlation
  10. partial directed coherence
  11. phase locking value
  12. phase slope index
  13. total interdependence
  14. weighted phase lag index

Definition of the function-calls (API)

The functions should be called as

outputdata = ft_connectivity_bct(inputdata, 'key1', value1, 'key2', value2, ....);
outputdata = ft_connectivity_corr(inputdata, 'key1', value1, 'key2', value2, ....);
outputdata = ft_connectivity_dtf(inputdata, 'key1', value1, 'key2', value2, ....);
outputdata = ft_connectivity_ppc(inputdata, 'key1', value1, 'key2', value2, ....);
outputdata = ft_connectivity_psi(inputdata, 'key1', value1, 'key2', value2, ....);
outputdata = ft_connectivity_wpli(inputdata, 'key1', value1, 'key2', value2, ....);
outputdata = ft_connectivity_corr(inputdata, 'key1', value1, 'key2', value2, ....);
outputdata = ft_connectivity_corr(inputdata, 'key1', value1, 'key2', value2, ....);

The inputdata consists of a matrix of one of the following dimensionalities:

  1. Nrpt x Nchan x Nchan (x Nfreq) (x Ntime)
  2. Nrpt x Nchancmb (x Nfreq) (x Ntime)

where Nrpt can be singleton. Additional arguments come in key-value pairs and depend on the function and the required functionality. The current functions only take inputdata which is already in a bivariate representation. In FieldTrip this is ensured by the calling function ft_connectivityanalysis.

One exception to the API described above is:

outputdata = ft_connectivity_granger(H, Z, S, key1, value1, ...);

Spectrally resolved granger causality is a function of both the spectral transfer function (H) and the covariance of the noise (Z). For computational reasons, the cross-spectral density is also a required input argument for the function.

Related documentation

The literature references to the implemented methods are given here.

Tutorial material for connectivity analysis:

Recent changes to the code

2012-05-14 10:27  jansch

	* [r5777] ft_connectivity_hipp.m: enhancement - added a placeholder for Joerg Hipp's method
	  and changed some in the level of cfg options for doing conditional and blockwise Granger

2012-04-21 06:04  eelspa

	* [r5688] private/fixname.m: automatically synchronized identical files to revision 5687

2012-04-21 05:59  eelspa

	* [r5686] private/fixname.m: automatically synchronized identical files to revision 5685

2012-04-19 09:37  eelspa

	* [r5662] private/fixname.m: automatically synchronized identical files to revision 5661

2012-04-18 14:10  eelspa

	* [r5652] private/fixname.m: automatically synchronized identical files to revision 5651

2012-04-17 13:45  eelspa

	* [r5645] private/ft_progress.m: automatically synchronized identical files to revision 5644

2012-04-17 13:42  eelspa

	* [r5642] private/ft_progress.m: automatically synchronized identical files to revision 5641

2012-04-17 13:27  eelspa

	* [r5639] private/ft_progress.m: automatically synchronized identical files to revision 5638

2012-03-27 09:46  eelspa

	* [r5540] private/ft_getopt.mexw64, private/nansum.mexw64: automatically synchronized
	  identical files to revision 5539

2012-03-22 09:32  roboos

	* [r5512] private/ft_getopt.mexw32, private/nansum.mexw32: automatically synchronized
	  identical files to revision 5511

2012-03-10 21:25  roboos

	* [r5434] private/fixname.m: automatically synchronized identical files to revision 5433

2012-03-10 15:42  roboos

	* [r5432] private/warning_once.m: automatically synchronized identical files to revision
	  5431

2012-03-10 15:41  roboos

	* [r5431] private/fixname.m: enhancement - replaced the multiple occuring subfunction
	  fixname by a single one, see http://bugzilla.fcdonders.nl/show_bug.cgi?id=1273#c2

2012-03-05 14:01  roboos

	* [r5389] private/warning_once.m: automatically synchronized identical files to revision
	  5388

2012-01-05 09:05  eelspa

	* [r5096] private/ft_getopt.mexa64, private/ft_getopt.mexglx, private/ft_getopt.mexmaci,
	  private/ft_getopt.mexmaci64, private/ft_getopt.mexw32, private/ft_getopt.mexw64,
	  private/nansum.mexa64, private/nansum.mexmaci, private/nansum.mexmaci64,
	  private/nansum.mexw32, private/nansum.mexw64: setting svn:executable property on all MEX
	  files, properly this time I hope

2011-12-22 13:40  borreu

	* [r5076] private/ft_getopt.m: automatically synchronized identical files to revision 5075

2011-12-21 13:58  roboos

	* [r5065] private/ft_getopt.m, private/ft_getopt.mexglx: automatically synchronized
	  identical files to revision 5064

2011-12-20 14:03  jansch

	* [r5058] private/ft_getopt.mexmaci, private/ft_getopt.mexmaci64: automatically synchronized
	  identical files to revision 5057

2011-12-20 13:48  eelspa

	* [r5056] private/ft_getopt.m, private/ft_getopt.mexa64, private/ft_getopt.mexw32,
	  private/ft_getopt.mexw64: automatically synchronized identical files to revision 5055

2011-11-30 18:09  jansch

	* [r4909] ft_connectivity_bct.m: enhancement - moved code from which the BCT-toolbox is
	  called to a subfunction in ft_networkanalysis. Removed ft_connectivity_bct from repository

2011-11-30 14:20  jansch

	* [r4892] ft_connectivity_bct.m, private/warning_once.m: enhancement - made first
	  implementation of ft_networkanalysis by moving relevant functionality from
	  ft_connectivityanalysis to this new function. Functionality can now be expanded

2011-11-16 09:26  jansch

	* [r4747] ft_connectivity_csd2transfer.m, private/sfactorization_wilson.m,
	  private/sfactorization_wilson2x2.m: enhancement - further change of organization of the
	  code. Moved the low-level spectral factorization function into connectivity/private

2011-11-16 09:04  jansch

	* [r4745] ft_connectivity_csd2transfer.m, private/blockwise_conditionalgranger.m,
	  private/det2x2.m, private/inv2x2.m, private/mtimes2x2.m, private/sandwich2x2.m:
	  enhancement - documentation update, moved csd2transfer from private into
	  connectivity-module and renamed into ft_connectivity_csd2transfer. moved the dependent
	  XXX2x2 functions to connectivity/private

2011-10-29 10:10  roboos

	* [r4624] README, ft_connectivity_bct.m, ft_connectivity_ppc.m, ft_connectivity_wpli.m,
	  private/ft_getopt.mexa64, private/ft_getopt.mexglx, private/ft_getopt.mexmaci,
	  private/ft_getopt.mexmaci64, private/ft_getopt.mexw32, private/ft_getopt.mexw64,
	  private/ft_progress.m, private/keyval.m, private/nansum.mexa64, private/nansum.mexmaci,
	  private/nansum.mexmaci64, private/nansum.mexw32, private/nansum.mexw64: cleaned up the svn
	  properties according to development/svn on the wiki
	  this ensures that m files are not executable and that Rev and Id are correctly replaced

2011-10-24 12:48  jansch

	* [r4570] ft_connectivity_granger.m: bugfix - also correctly deal (i.e. remove from the
	  output) with auto-combinations in the context of instantaneous causality and total
	  interdependence. fixed incorrect computation of instantaneous causality when using
	  linearly indexed spectra

2011-10-21 10:01  jansch

	* [r4545] ft_connectivity_granger.m: enhancement - bivariate granger causality should only
	  output the cross-pairs, and not the auto-pairs

2011-10-11 07:52  jansch

	* [r4420] ft_connectivity_granger.m: enhancement - further cleanup of code. implemented
	  key-value pairs for ft_connectivity_granger for consistency with other connectivity
	  functions

2011-10-09 10:52  roboos

	* [r4394] private/ft_getopt.m, private/ft_getopt.mexa64, private/ft_getopt.mexglx,
	  private/ft_getopt.mexmaci, private/ft_getopt.mexmaci64, private/ft_getopt.mexw32,
	  private/ft_getopt.mexw64: restructuring - added the ft_getopt m and mex files to the
	  private directories of the modules, see bug #502

2011-10-09 09:19  roboos

	* [r4387] ft_connectivity_corr.m, ft_connectivity_dtf.m, ft_connectivity_pdc.m,
	  ft_connectivity_ppc.m, ft_connectivity_psi.m, ft_connectivity_wpli.m: restructuring - use
	  ft_getopt instead of keyval, see http://bugzilla.fcdonders.nl/show_bug.cgi?id=502

2011-10-07 15:37  jansch

	* [r4381] ft_connectivity_granger.m: enhancement - cleaned up some code

2011-10-07 11:23  jansch

	* [r4378] ft_connectivity_corr.m: documentation change - updated help

2011-10-07 08:53  jorhor

	* [r4374] private/nansum.mexw64: automatically synchronized identical files to revision 4373

2011-10-06 14:53  jansch

	* [r4368] README: enhancement - included README file for connectivity toolbox

2011-09-21 11:33  jansch

	* [r4256] private/nansum.mexmaci, private/nansum.mexw32, private/nansum.mexw64: enhancement
	  - svn-copied compiled nanXXX functions to the relevant locations

2011-09-21 11:26  jansch

	* [r4255] private/nansum.mexa64, private/nansum.mexmaci64: automatically synchronized
	  identical files to revision 4254

2011-09-19 09:58  jansch

	* [r4245] ft_connectivity_granger.m: enhancement - moved functionality for instantaneous
	  causality and total interdependence into ft_connectivity_granger and updated test script

2011-08-24 10:13  jansch

	* [r4004] private/nansum.mexa64, private/nansum.mexmaci64: enhancement - copied mex-files
	  for nansum into connectivity/private

2011-07-09 18:03  jansch

	* [r3815] ft_connectivity_corr.m: enhancement - changed pinv into regular inv (under
	  assumption of well-conditioned matrices) for partialisation

2011-07-08 07:48  jansch

	* [r3804] ft_connectivity_corr.m: bugfix - fixed some issues related to previous commit
	  (didn't properly check)

2011-07-08 07:42  jansch

	* [r3803] ft_connectivity_corr.m: enhancement - improved nan support

2011-07-07 12:47  marvin

	* [r3797] ft_connectivity_corr.m: fixednormalization by n in case of nans

2011-07-06 18:58  roboos

	* [r3783] test: enhancement - added test directory for fieldtrip main and standard modules

2011-07-02 18:23  marvin

	* [r3765] ft_connectivity_wpli.m: removed bug at the last line with n

2011-07-02 18:03  marvin

	* [r3764] ft_connectivity_wpli.m: bug in case of no trials

2011-07-02 17:13  marvin

	* [r3763] ft_connectivity_wpli.m: some comments

2011-07-02 17:10  marvin

	* [r3762] ft_connectivity_corr.m: some nan support and comments

2011-07-02 17:09  marvin

	* [r3761] ft_connectivity_psi.m: added some explanation on how to interpret the sign

2011-07-02 16:27  marvin

	* [r3759] ft_connectivity_psi.m: added nan support

2011-07-02 16:18  marvin

	* [r3758] ft_connectivity_wpli.m: some more nan support

2011-07-02 16:16  marvin

	* [r3757] ft_connectivity_wpli.m: some more nan support

2011-07-02 02:58  marvin

	* [r3756] ft_connectivity_wpli.m: put in support for nans in combination with jackkniving

2011-06-14 18:59  jansch

	* [r3686] ft_connectivity_granger.m: enhancement - speed up re-indexing in the case of
	  linearly indexed spectra

2011-06-14 18:58  jansch

	* [r3685] ft_connectivity_dtf.m, ft_connectivity_pdc.m: enhancement - #740 consistent
	  interpretation of dtf and pdc with respect to granger. row -> column for 'chan_chan_xxx'
	  dimord. disabled linear indexing for dtf

2011-06-06 12:23  jansch

	* [r3625] ft_connectivity_bct.m: first implementation, supporting degree and clustering_coef

2011-04-05 14:36  roboos

	* [r3292] ft_connectivity_corr.m, ft_connectivity_dtf.m, ft_connectivity_pdc.m,
	  ft_connectivity_ppc.m, ft_connectivity_psi.m, ft_connectivity_wpli.m: enhancement -
	  changed all keyval(key,varargin{:}) into keyval(key,varargin), which makes it compatible
	  with the mexfile implementation of keyval

2011-02-17 07:02  marvin

	* [r2900] ft_connectivity_wpli.m: improved comments and cleaned up code

2011-02-17 06:45  marvin

	* [r2899] ft_connectivity_ppc.m: improved help

2011-02-17 06:39  marvin

	* [r2898] ft_connectivity_ppc.m: removed some unnecessary brackets

2011-02-17 06:27  marvin

	* [r2897] ft_connectivity_ppc.m: fixed bug in jacknife

2011-02-17 06:27  marvin

	* [r2896] ft_connectivity_wpli.m: fixed bug in jacknife of wpli_debiased

2011-02-16 11:05  marvin

	* [r2889] ft_connectivity_ppc.m: initial commit

2011-02-16 09:43  roboos

	* [r2887] ft_connectivity_wpli.m: moved ft_connectivity_wpli to the connectivity directory

2011-02-16 09:41  roboos

	* [r2885] private/ft_progress.m, private/keyval.m: svn propset svn:keyword "Id Rev" xxx.m

2011-02-12 17:51  roboos

	* [r2861] private/ft_progress.m, private/keyval.m: set the property "autosync" on all files
	  that are copies of the previous file externals

2011-02-12 17:49  roboos

	* [r2860] private/ft_progress.m, private/keyval.m: replaced all old file externals with a
	  copy of the oiriginal file

2011-02-12 17:19  roboos

	* [r2859] private: deleted all svn:external properties
	  preparing a new implementation of the replicated files using an svn hook

2011-02-03 20:45  roboos

	* [r2799] private: assigned the new file externals, first only in connectivity for testing

2011-02-03 12:01  roboos

	* [r2788] private/labelcmb2indx.m: removed all actual occurences of *.m files that are used
	  elsewhere as externals
	  the files have been moved to the branches/externals and all svn:externals will have to be
	  reset to use that location

2011-02-03 10:48  roboos

	* [r2781] private/blockwise_conditionalgranger.m: cleanup of the special properties of all
	  files, such as execute property, eol-style and keywords

2011-02-03 09:44  jansch

	* [r2779] oldstuff.m, univariate2bivariate.m: cleaned up connectivity directory, removed
	  'oldstuff' from repository and moved univariate2bivariate tie fieldtrip/private

2011-01-28 09:42  roboos

	* [r2688] ft_connectivity_pdc.m, ft_connectivity_psi.m: changed compat/progress into
	  ft_progress for two functions in the connectivity directory

2010-12-14 09:46  jansch

	* [r2399] univariate2bivariate.m: made some changes to support source level pow-pow
	  correlations

2010-11-30 11:08  jansch

	* [r2230] private/blockwise_conditionalgranger.m: added this function temporarily to provide
	  users with feedback regarding the absence of this functionality in the release version of
	  FieldTrip

2010-11-27 11:55  roboos

	* [r2212] ft_connectivity_corr.m, ft_connectivity_dtf.m, ft_connectivity_granger.m,
	  ft_connectivity_pdc.m, ft_connectivity_psi.m, oldstuff.m, private/labelcmb2indx.m,
	  univariate2bivariate.m: fixed the svn properties (eol-style, executable, keywords) on many
	  *.m files

2010-11-23 11:17  jansch

	* [r2164] ft_connectivity_corr.m, univariate2bivariate.m: fixed typos (thanks to Arjen)

2010-11-17 08:27  jansch

	* [r2116] univariate2bivariate.m: commented out subfunction labelcmb2indx

2010-11-17 08:22  jansch

	* [r2115] private, private/labelcmb2indx.m: added private directory containing
	  labelcmb2indx.m to connectivity module

2010-11-08 10:31  vlalit

	* [r2081] ft_connectivity_corr.m, univariate2bivariate.m: More prefix fixes

2010-10-27 14:28  craric

	* [r1988] ft_connectivity_granger.m: additional functionality for linear-indexed
	  time-frequency data

2010-09-17 15:05  jansch

	* [r1704] univariate2bivariate.m: moved subfunction of ft_connectivityanalysis to a
	  (temporary) function in connectivity module. changed input arguments into key-value pairs

2010-08-23 07:12  jansch

	* [r1539] ft_connectivity_dtf.m: changed input variable from cfg and data matrix into data
	  matrix and key-value pairs.

2010-08-23 07:11  jansch

	* [r1538] ft_connectivity_pdc.m: changed input variable from cfg and data matrix into data
	  matrix and key-value pairs

2010-08-23 07:10  jansch

	* [r1537] ft_connectivity_corr.m, ft_connectivity_psi.m: added some documentation and
	  removed dependency on variable hasrpt. this will be handled by ft_connectivityanalysis.m

2010-07-26 11:28  jansch

	* [r1455] ft_connectivity_corr.m: fixed some typos with respect to handling of hasjack
	  keyval-pair (reported by Nic)

2010-07-14 10:19  jansch

	* [r1409] ft_connectivity_corr.m: fixed small bug related to faulty conversion of cfg into
	  keyvals

2010-07-12 14:25  jansch

	* [r1397] ., ft_connectivity_corr.m, ft_connectivity_dtf.m, ft_connectivity_granger.m,
	  ft_connectivity_pdc.m, ft_connectivity_psi.m, oldstuff.m: first commit, no functional
	  change
development/connectivity.txt · Last modified: 2011/12/16 11:22 by robert

You are here: startdevelopmentconnectivity
This DokuWiki features an Anymorphic Webdesign theme, customised by Eelke Spaak and Stephen Whitmarsh.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0