<.backtick {font-size: 16px;})>><abbr {font-weight: bold;})>> <em strong {font-weight: normal; font-style: normal; padding: 2px; border-radius: 5px; background-color: #EEE; color: #111;})>> = Connectivity = ''Authors: Hossein Shahabi, Raymundo Cassani, Takfarinas Medani, François Tadel'' Cognitive and perceptual functions are the result of coordinated activity of functionally specialized regions in the brain. [[http://www.scholarpedia.org/article/Brain_connectivity|Brain connectivity]] investigates how these different regions (or nodes) interact as a network, with the goal of having a better understanding of how the brain processes information. Depending on which connectivity characteristic is studied, a distinction is made between '''structural''' (fiber pathways), '''functional''' (non-directed statistical dependency) and '''effective''' (causal interaction) connectivity between regions. Effective connectivity is often referred as directed functional connectivity. In this tutorial we will see how to compute different connectivity metrics for non-directed and directed functional analyses in Brainstorm, first with simulated data and later with real data. <> == General considerations == === Definitions === Connectivity analyses are commonly performed by computing a bivariate connectivity metric for all the possible pairs of time series or signals. The result of such approach can be presented as a '''connectivity graph''' (left image), where each signal is represented as a node, and the value of the connectivity metric is the value of the edge between the corresponding nodes. This graph representation becomes overwhelming when too many nodes are considered, as such, the connectivity graph can be represented with its '''connectivity matrix''', aka adjacency matrix (right image). {{attachment:cnx_graph_matrix.png}} '''Sensors or sources:''' The signals used for the connectivity analysis can be derived from the '''sensor data''' (EEG/MEG signals) or from the reconstructed '''sources''' (voxels or scouts). '''Directed and non-directed:''' The direction of the interaction between signals (as statistical causation) can be measured with '''directed metrics'''. However, this is not possible with '''non-directed metrics''', as result, the connectivity metric "from Signal <> to Signal <> " is equal to the connectivity metric "from Signal <> to Signal <>". '''Recording condition:''' Connectivity analyses can be performed on resting-state (spontaneous) and event-related (trials) recordings, the appropriate connectivity method depends on the recording condition. '''Full network vs point-based connectivity:''' In '''full network''', the connectivity metric is computed for all the possible node pairs in the network (N×N approach), and gives as result a detailed connectivity graph. Alternatively, '''point-based''' analysis is performed solely between one node (aka seed) and the rest of the nodes in the network (1×N approach), this approach is faster to compute and is more useful when you are interested in the connectivity of a specific sensor or source. '''Temporal resolution:''' Connectivity analyses can be performed in two ways: static and dynamic. Time-varying networks can present the dynamics of brain networks. In contrast, the static graphs illustrate a general perspective of brain connectivity which is helpful in specific conditions. Users need to decide which type of network is more informative for their study. '''Time-frequency transformation:''' Several connectivity metrics rely on the [[Tutorials/TimeFrequency|time-frequency representation]] of the signals, which is obtained with approaches such as the short-time Fourier transform, Hilbert transform, and Morlet wavelet. === Sensor-level === The different connectivity metrics can be computed with '''sensor''' or '''source''' data. However, sensor connectivity analyses present two important limitations: 1. '''They are not interpretable''', as the relation between the estimated connectivity and the underlying neuroanatomy is not straightforward. 1. Sensor data is severely corrupted by effects of '''field spread''' and '''volume conduction'''. Due to these effects the activity of a single brain area could cause a spurious connectivity between MEG/EEG sensors. Despite these limitations, sensor connectivity analyses are commonly used. === Source-level === One approach to reduce the negative impact of field spread on connectivity analyses is to perform them at the source level. In addition, source connectivity analyses are '''interpretable''' as neuroanatomy is considered. As consequence, findings in the source level can be easily used in group studies using a normalization / registration. Regardless of the data, sensors or sources, it is highly recommended to '''have a clear hypothesis to test before starting the connectivity analysis'''. Although sensor- and source-level connectivity analyses use different assumptions, the outcomes regarding the topology of the underlying networks should be consistent ([[https://doi.org/10.1038/s41598-018-30869-w|Lai et al., 2018]]). '''Full resolution''' The number of sources can be in the order of '''tens of thousands''', making the full network analyses (N×N) impractical. With 15000 vertices on the cortex surface, a correlation matrix on a constrained source model would be 15000x15000x8 bytes = 1.6Gb, and a coherence matrix with 50 frequency points on an unconstrained source model would be 45000X45000x50 = 754 Gb, multiplied by the numbers of trials and subjects in the experiment. Such computations must be considered carefully as they can crash computers and fill hard drives quickly. '''Regions of interest''' A possible strategy to reduce the dimensionality of the source space is to group the sources in regions of interests (ROIs), aka [[Tutorials/Scouts|scouts]] in Brainstorm jargon. Therefore, the '''most critical step''' in performing a source-domain connectivity analysis is the definition of these ROIs, which is not a trivial procedure as it depends on the '''source estimation method''', '''experimental task''', and '''data available''' ([[https://doi.org/10.1002/hbm.20745|Schhoffen and Gross, 2009]]). Common approaches found in the literature to select the ROIs for connectivity analysis are: * '''A priori''': ROIs are selected based on a priori knowledge in a given experimental task. * '''Coherence with a no-neuronal signal''': ROIs that present a strong coherence with an external no-neuronal signal are selected. * '''Power maps''': ROIs showing the strongest activity in an experimental task or ROIs that present the strongest differences of activity between experimental conditions are selected. * '''Full connectome''': A set of ROIs covering the full brain, [[https://neuroimage.usc.edu/brainstorm/Tutorials/LabelFreeSurfer#Cortical_parcellations|a cortical parcellation]], is selected. In this selection approach, there are not any a priori assumptions or hypotheses. A fair choice for this set of ROIs is a parcellation based on anatomy, as in ([[https://doi.org/10.1038/nature18933|Glasser et al., 2016]]). Although this approach to select ROIs can be used for '''exploratory analyses''', it '''should not be taken as default for connectivity analyses'''. {{{#!wiki caution Being an '''exploratory analysis''', the full-brain connectivity analysis can help to get a better understanding of the acquired data, and to develop hypotheses to test. However its outcomes '''should not''' be considered conclusive, as they may be the result of circular analysis ([[https://doi.org/10.1038/nn.2303|Kriegeskorte et al., 2009]]). }}} The optimal selection of ROIs to perform source connectivity analysis is still an open question. == Requirements == Please note that this is an advanced tutorial, it assumes that that you have already followed all the [[http://neuroimage.usc.edu/brainstorm/Tutorials#Get_started|introduction tutorials]]. For readability, most of the interface details are omitted, you must be familiar with the Brainstorm software in order to reproduce the computations illustrated below. This tutorial is mostly based on simulated data, and independent from the other tutorials. Only one part at the end uses the results of the introduction tutorials (auditory oddball dataset), in order to illustrate how to apply the connectivity processes to real MEG recordings. Let's start by creating a new protocol in the Brainstorm database: * Select the menu File > Create new protocol > "'''TutorialConnectivity'''" and select the options: * '''Yes''', use protocol's default anatomy, * '''No''', use one channel file per condition. * Right-click on the TutorialConnectivity folder > New subject > Subject01<
><
> {{attachment:protocol_connect.gif}} == Simulated data == To compare different connectivity metrics, we use simulated data with known ground truth using a [[https://en.wikipedia.org/wiki/Brain_connectivity_estimators#Multivariate_Autoregressive_Model|multivariate autoregressive (MVAR)]] model. This model consist in three signals in a way that: * '''Signal 1''': Components at 10 and 25 Hz with a dominant peak at 25 Hz (beta band). * '''Signal 2''': Same components, but dominant peak is at 10 Hz (alpha band). * '''Signal 3''': Similar power for both components (10 and 25 Hz). * '''Signal 1>>Signal 3''': Signal 3 is influenced by Signal 1, with a peak at 25 Hz. Simulation process: * In the '''''Process1''''' tab, leave the file list empty and click on the button '''''[Run]''''' * Select process: '''''Simulate > Simulate AR signals'''''.<
><
> {{attachment:sim_process.gif}} Process options: * '''Subject name''': Target subject for the simulated signals. Select '''Subject01'''. * '''Condition name''': Target folder for the simulated signals. Set to '''Simulation'''. * '''Number of time samples''': Duration of signals, in samples. Set to '''12 000'''. * '''Sampling frequency''':''' ''' Fs for the simulated signals. Set to '''120 Hz'''. * '''Interaction specifications:''' Spectral parameters for the interaction between signals in the MVAR model, given as: '''From, To / Peak frequencies [Hz] / Peak relative magnitudes [0-1]'''<
> Set to: {{{ 1, 1 / 10, 25 / 0.3, 0.5 2, 2 / 10, 25 / 0.7, 0.3 3, 3 / 10, 25 / 0.2, 0.2 1, 3 / 25 / 0.1 }}} * '''View spectral metrics''': Display spectral metrics related to the MVAR process: transfer function, cross-spectral power density, [[#Coherence|magnitude square coherence]], [[https://en.wikipedia.org/wiki/Brain_connectivity_estimators#Directed_Transfer_Function|directed transfer function (DTF)]] and [[https://en.wikipedia.org/wiki/Brain_connectivity_estimators#Partial_Directed_Coherence|partial directed coherence (PDC)]]. The transfer function, <>, contains information about the relationships between signals and their spectral characteristics; it is non-symmetric, so it allows for finding causal dependencies. The auto-transfer function (diagonal elements in the image) correspond to the power spectrum of the signals. The off-diagonal terms represent the interactions between different signals. Here, we see the transfer function from signal 1 to signal 3. These transfer functions are our '''ground truth for connectivity values'''.<
><
> {{attachment:sim_ar_spectra_metrics.png||width="600"}} * '''Get coefficients matrix:''' Shows the coefficients related to the MVAR model. These coefficients can be used in the process '''''Simulate > Simulate AR signals (ARfit)''''' to simulate the same model.<
><
> {{attachment:sim_coef.gif}} Execution: * Click '''''Run''' ''to simulate the signals described by the MVAR model. <
><
> {{attachment:sim_db.gif}} * In the next sections we will compute different connectivity metrics for these simulated signals. As such, place the simulated data in the '''''Process1''''' tab, click on '''''[Run]''''' ( {{https://neuroimage.usc.edu/moin_static198/brainstorm1/img/iconRun.gif}} ) to open the [[Tutorials/PipelineEditor#Selecting_processes|Pipeline editor]], and select the connectivity metric.<
><
> {{attachment:sim_select.gif}} * This tutorial illustrates only the computation full connectivity graphs ('''''Process 1: NxN'''''). It is however possible to compute the connectivity between 1 signal and the other signals in the same file ('''''Process1: 1xN'''''), or between signals from two different files ('''Process2: AxB'''). These options will be illustrated at the end of the tutorial. Credits: * This process relies on the ARSIM function from the '''ARFit toolbox''': <
>https://github.com/tapios/arfit * Neumaier A, Schneider T<
>[[http://dx.doi.org/10.1145/382043.382304|Estimation of parameters and eigenmodes of multivariate autoregressive models]]<
>ACM Transactions on Mathematical Software, 2001 * Schneider T, Neumaier A<
>Algorithm 808: [[http://dx.doi.org/10.1145/382043.382316|ARfit – A Matlab package for the estimation of parameters and eigenmodes of multivariate autoregressive models]]<
>ACM Transactions on Mathematical Software, 2001 <
><
> == Correlation == [[https://en.wikipedia.org/wiki/Correlation_and_dependence|Correlation]] is a non-directed connectivity metric that can be used to show similarity, dependence or association among two random variables or signals. While this metric has been widely used in electrophysiology, it should not be considered the best technique to evaluate connectivity. Due to its nature, correlation fails to alleviate the problem of volume conduction and cannot explain the association in different frequency bands. However, it still can provide valuable information in case we deal with a few narrow-banded signals. === Process options === * Process '''''Connectivity > Correlation NxN''''':<
><
> {{attachment:gui_corr1n.png||width="400"}} * '''Time window:''' Segment of the signal used for the connectivity analysis. Select: All file. * '''Compute scalar product:''' If unchecked, the mean of the signals is subtracted before computing the correlation. Uncheck it. * '''Output options''': Select '''''Save individual results'''''. === Result visualization === * The results are stored as a N×N connectivity file, icon {{https://neuroimage.usc.edu/moin_static198/brainstorm1/img/iconConnectN.gif}} . Right-click to see its display options:<
><
> {{attachment:corr1n_file.gif}} * '''Display as graph''': Plots the connectivity graph using a [[https://en.wikipedia.org/wiki/Chord_diagram|chord diagram]] where the color of the edges shows the connectivity metric value. See the [[Tutorials/ConnectivityGraph|connectivity graph tutorial]] for a detailed explanation of the options of this visualization. * '''Display as image''': Plots the [[https://en.wikipedia.org/wiki/Adjacency_matrix|adjacency matrix]] for the connectivity file. * '''Display fibers''':Additional option available for source connectivity results when a '''fiber track''' surface is available, as shown [[#Tutorials.2FFiberConnectivity|here]]. <
><
> {{attachment:corr1n_graph.gif}} <
><
> {{attachment:corr1n_image.png}} Display options: * '''Diagonal values''': The value of the connectivity metric between a signal and itself is plotted as zero so that it doesn't force scaling the colormap to 1 if the other values are much smaller. * '''Labels''': Click on the figure to see the signal names and connectivity values as the image legend. In order to see the labels corresponding to each column and row: right-click on the figure > Figure > '''''Show labels'''''. If your signal names are very long, try the option '''''Use short labels'''''. * '''Colormap''': By default, the NxN colormap is configured to display the absolute values of the connectivity measures. As in the general case, correlation values can be positive or negative, you need to check this option carefully. If you expect to see '''negative values''', make sure to change the colormap configuration: right-click on the figure > Colormap > Uncheck '''''Absolute values'''''. <
><
> {{attachment:corr1n_image_relative.png}} <
><
> == Coherence == Coherency or complex coherence, <>, is a complex-valued metric that measures the linear relationship of two signals in the frequency domain. Its magnitude square coherence (MSC), <>, often referred to as coherence, measures the covariance of two signals in the frequency domain. For a pair of signals <> and <>, with spectra <> and <>, the MSC is defined as: . {{{#!latex \begin{eqnarray*} C_{xy}(f) &=& \frac{S_{xy}(f)}{\sqrt{ S_{xx}(f)S_{yy}(f)}}\\ |C_{xy}(f)|^2 &=& MSC(f) = \left(\frac{\left |S_{xy}(f) \right |}{\sqrt{ S_{xx}(f)S_{yy}(f) }}\right)^2 = \frac{\left |X(f)Y^*(f) \right |^{2}}{X(f)X^*(f)Y(f)Y^*(f)} \\ S_{xy}(f) &:& \textrm{Cross-spectrum} \\ S_{xx}(f) \quad \textrm{and} \quad S_{yy}(f) &:& \textrm{Auto-spectra or power spectral densities} \\ \end{eqnarray*} }}} Two related measures, which alleviate the problem of volume conduction, are '''imaginary coherence''' ([[https://doi.org/10.1016/j.clinph.2004.04.029|Nolte et al., 2004]]), <>, and the '''lagged coherence''' ([[https://arxiv.org/pdf/0706.1776|Pascual-Maqui, 2007]]), <>, which are defined as: . {{{#!latex \begin{eqnarray*} IC_{xy}(f) &=& \mathrm{Im} \left (C_{xy}(f) \right ) = \frac{\mathrm{Im} \left (S_{xy}(f) \right )}{\sqrt{ S_{xx}(f)S_{yy}(f) }} \\ LC_{xy}(f) &=& \frac{\mathrm{Im} \left (C_{xy}(f) \right )}{\sqrt{ 1 - \left [ \mathrm{Re}\left ( C_{xy}(f) \right ) \right ]^{2} }} = \frac{\mathrm{Im} \left (S_{xy}(f) \right )}{\sqrt{ S_{xx}(f)S_{yy}(f) - \left [ \mathrm{Re}\left ( S_{xy}(f) \right ) \right ]^{2} }} \\ \end{eqnarray*} }}} where <> and <> describe the imaginary and real parts of a complex number. To calculate coherence values in Brainstorm, select the process. === Process options === * Process '''''Connectivity > Coherence NxN''''':<
><
> {{attachment:gui_cohere1n.png||width="400"}} * '''Time window:''' Segment of the signal used for the connectivity analysis. Select '''All file'''. * '''Remove evoked response''': If checked, removes the average of all the files in input (the "trials") from each file, before computing the connectivity measure. Meaningful only in the context of ERP/ERF analyses. Uncheck it. * '''Process options:''' Different measures. Select: Magnitude squared coherence. * '''Window length:''' Duration in seconds for the [[https://neuroimage.usc.edu/brainstorm/Tutorials/ArtifactsFilter#Evaluation_of_the_noise_level|spectrum estimation]]. Set to: 1s. * '''Overlap:''' Percentage of overlap between consecutive windows. Set to: 50%. * '''Highest frequency''': After the computation, removes all the frequencies above this threshold, mostly for visualization purposes. It should be <= Fs/2. Set to: 60 Hz. * '''Output options''': Select: Save individual results. === Result visualization === Coherence is a function of frequency, as such, for each frequency point there is a connectivity graph and a connectivity matrix. Right-click on the coherence result file to see its display options: * '''Display as graph''': Plot the connectivity graph at a given frequency point. * '''Display as image''': Plot the connectivity matrix at a given frequency point. * '''Power spectrum''': Plot coherence as a function of frequency for all the possible node pairs. Open the 3 representations. These representations are linked such as by clicking on the spectral representation of the coherence, we change the frequency that is displayed in the connectivity graph and matrix. This frequency can be also changed in the Time panel. || {{attachment:res_cohere1n_a.png||width="350"}} || || {{attachment:res_cohere1n_a2.png||width="200"}} || || {{attachment:res_cohere1n_b.png||width="350"}} || || {{attachment:res_cohere1n_c.png||width="350"}} || In the same way, we can compute the other types of coherence. The figure below presents the spectra for the imaginary coherence (left) and the lagged coherence (right). Both, imaginary and lagged coherence aim to address the volume conduction problem, although they present small differences. || {{attachment:res_cohere1n_d.png||width="350"}} || || {{attachment:res_cohere1n_e.png||width="350"}} || <
><
> == Granger causality == Granger causality (GC) is a method of directed functional connectivity, which is base on the Wiener-Granger causality methodology. GC is a measure of linear dependence, which tests whether the prediction of signal <> (using a linear autoregressive model) is improved by adding signal <> (also using a linear autoregressive model). If this is true, signal <> has a Granger causal effect on the first signal. In other words, '''independent information''' of the past of signal <> improves the prediction of signal <> obtained with the past of signal <> alone. GC is nonnegative, and zero when there is no Granger causality. As only the past of the signals is considered, the GC metric is directional. The term '''independent''' is emphasized because it creates some interesting properties for GC, such as, that it's invariant under rescaling of <> and <>, as well as the addition of a multiple of <> to <>See [[GrangerCausality|Granger causality - mathematical background]] for a complete formulation of the method. {{{#!wiki note Despite the name, '''Granger causality indicates directionality but not true causality'''. <
> For example, if a variable <> is causing both <> and <>, but with a smaller delay for <> than for <>, then the GC measure between <> and <> would show a non-zero GC for <> --> <>, even though <> is not truly causing <> ([[https://doi.org/10.1016/j.neuroimage.2010.02.059|Bressler and Seth, 2011]]). }}} === Process options === * Process '''''Connectivity > Bivariate Granger causality NxN'''''<
><
> {{attachment:gui_granger1n.png||width="400"}} * '''Time window:''' Segment of the signal used for the connectivity analysis. Select '''All file'''. * '''Remove evoked response''': If checked, removes the average of all the files in input (the "trials") from each file, before computing the connectivity measure. Meaningful only in the context of ERP/ERF analyses. It is recommended by some authors as it meets the zero-mean stationarity requirement (improves stationarity of the system). However, the problem with this approach is that it does not account for trial-to-trial variability. For a discussion see ([[https://doi.org/10.1016/j.neuroimage.2008.03.025|Wang et al., 2008]]). '''Uncheck''' it. * '''Maximum Granger model order:''' The most common criteria used to define the order of the model are the [[https://en.wikipedia.org/wiki/Akaike_information_criterion|Akaike’s information]] criterion, the [[https://en.wikipedia.org/wiki/Bayesian_information_criterion|Bayesian-Schwartz’s criterion]], and the [[https://en.wikipedia.org/wiki/Hannan–Quinn_information_criterion|Hannan-Quinn criterion]]. Too low orders may lack the necessary details, while too big orders tend to create spurious values of connectivity. While our simulated signals were created with a model of 4, here we used as model order of '''6''' for a decent connectivity result. * '''Output options''': Select '''Save individual results'''. <
> === Result visualization === In the connectivity graph (left) the directionality is shown with an arrow head at the center for the arc connecting nodes. As GC metric is not symmetric, the connectivity matrix (right) is not symmetric. The upper right element of this matrix shows there is a signal flow from signal 1 to signal 3. || {{attachment:res_granger1n_a.png||width="350"}} || || {{attachment:res_granger1n_b.png||width="350"}} || <
><
> == Spectral Granger causality == GC lacks of resolution in the frequency domain, as such, the spectral Granger causality was developed ([[https://doi.org/10.1103/PhysRevLett.100.018701|Dhamala et al., 2008]]). === Process options === * Process: '''''Connectivity > Bivariate Granger causality NxN'''''. <
><
> {{attachment:gui_spgranger1n.png||width="400"}} <
><
>With respect to [[#Granger_causality|GC]], spectral GC presents two extra parameters: * '''Maximum frequency resolution''': Width of frequency bins in PSD estimation. Set to '''1 Hz'''. * '''Highest frequency''': After the computation, removes all the frequencies above this threshold, mostly for visualization purposes. It should be <= Fs/2. Set to: 60 Hz. === Result visualization === As with coherence, spectral GC can be plotted as a function of frequency. The plot below clearly shows a peak around 25 Hz for the interaction from signal 1 to signal 3, as expected. {{attachment:res_spgranger1n.png||width="300"}} <
><
> == Envelope correlation == In the [[Tutorials/TimeFrequency|time-frequency tutorial]] the Morlet wavelets and Hilbert transform were introduced as methods to decompose signals in the time-frequency (TF) domain. The result of this TF transformation can be seen as a set of narrowband complex signals, which are analytic signals. The [[https://en.wikipedia.org/wiki/Analytic_signal|analytic signal]], <>, is a complex signal uniquely associated to a real signal, <>, that has been useful in signal processing due to its characteristics, more specifically, its '''module''' <>, and '''phase''' <>, correspond to the '''instantaneous amplitude''' (or envelope) and '''instantaneous phase''' of the associated real signal <>. The real part of <> is its associated real signal <>, and the imaginary part is the Hilbert transform of the same real signal <>. . {{{#!latex \begin{eqnarray*} \tilde{x}(t)= x(t) + j\mathcal{H}\left\{ x(t) \right\} = a_{\tilde{x}}(t)e^{j\phi_{\tilde{x}}(t)} \\ \end{eqnarray*} }}} The instantaneous amplitude (or envelope) of these band analytic signals can be used to carry out pairwise connectivity analysis with metrics such as correlation and coherence (including lagged coherence). In computing the envelope correlation, an optional step is to orthogonalize the envelopes by removing their real part of coherence before the correlation ([[https://psycnet.apa.org/doi/10.1038/nn.3101|Hipp et al., 2012]]). This orthogonalization process alleviates the effect of volume conduction in MEG/EEG signals. === Process options === * Process: '''''Connectivity > Envelope Correlation N×N [2020]''''' <
><
> {{attachment:gui_henv1n_ha.png||width="400"}} * '''Time window:''' Segment of the signal used for the connectivity analysis. Select: All file. * '''Remove evoked response''': If checked, removes the average of all the files in input (the "trials") from each file, before computing the connectivity measure. Meaningful only in the context of ERP/ERF analyses. Uncheck it. * '''Time-frequency transformation method:''' Either '''Hilbert transform''' or '''Morlet wavelets'''. Each of this methods requires additional parameters that are found in an external panel that opens by clicking on '''''Edit'''''. See the [[Tutorials/TimeFrequency|time-frequency tutorial]]. In this example, the sampling frequency of the signals being 120Hz, make sure you remove the "gamma2" band.<
><
> {{attachment:gui_henv1n_hb.png||width="227",height="276"}} {{attachment:gui_henv1n_wb.png||width="385",height="401"}} * '''Signal splitting:''' This process has the capability of splitting the input data into several blocks for performing time-frequency transformation, and then merging them to build a single file. This feature helps to save a huge amount of memory and, at the same time, avoids breaking a long-time recording to short-time signals, which makes inconsistency in dynamic network representation of spontaneous data. The maximum number of blocks which can be specified is 20. Set to '''1'''. * '''Connectivity measure:''' This is the connectivity metric that will be used with the envelopes. Select '''Envelope correlation (orthogonalized)'''. * '''Time resolution:''' If Dynamic is selected, connectivity is saved for each window of analysis. If Static is selected, the connectivity results from all the windows are averaged. Select '''Dynamic'''. * '''Estimation window length''': Duration in milliseconds to compute the connectivity measure. Set to '''5000 ms''' * '''Sliding window overlap:''' Percentage of overlap between consecutive windows to compute the connectivity measure. Set to '''50%'''. * '''Use the parallel processing toolbox:''' Enables the use of the parallel processing toolbox in Matlab to accelerate the computational procedure. '''Uncheck''' it. * '''Output configuration:''' Generally, the above calculation results in a 4-D matrix, where dimensions represent channels (1st and 2nd dimensions), time points (3rd dimension), and frequency (4th dimension). In the case that we analyze event-related data, we have also several files (trials). However, due to the poor signal-to-noise ratio of a single trial, an individual realization of connectivity matrices for each of them is not in our interests. Consequently, we need to average connectivity matrices '''among all trials''' of a specific event. The second option of this part performs this averaging. === Result visualization === Similar to the results from coherence and spectral Granger causality, the envelope correlation can be plotted as a function of frequency, and as a function of time if the '''Time resolution''' option is set to '''Dynamic'''. Below, the results obtained with the Hilbert transform (left) and with Morlet wavelet (right) for the first 5-s window (top) and the 5-s last window (bottom). || {{attachment:res_henv1n_h.png||width="350"}} ||First 5-s window || {{attachment:res_henv1n_w.png||width="350"}} || || {{attachment:res_henv1n_h2.png||width="350"}} ||Last 5-s window || {{attachment:res_henv1n_w2.png||width="350"}} || == Phase locking value == An alternative class of connectivity metrics considers only the relative instantaneous phase between the two signals, i.e., phase-locking or synchronization ([[https://doi.org/10.1103/PhysRevLett.81.3291|Tass et al., 1998]]). Phase locking is a fundamental concept in dynamical systems that has been used in control systems (the phase-locked loop) and in the analysis of nonlinear, chaotic and non-stationary systems. Since the brain is a nonlinear dynamical system, phase locking is an appropriate approach to quantifying connectivity. A more pragmatic argument for its use in studies of LFPs, EEG, and MEG is that it is robust to fluctuations in amplitude that may contain less information about interactions than does the relative phase ([[https://doi.org/10.1002/(SICI)1097-0193(1999)8:4<194::AID-HBM4>3.0.CO;2-C|Lachaux et al., 1999]]; [[https://doi.org/10.1016/S0167-2789(00)00087-7|Mormann et al., 2000]]). The most commonly used phase connectivity metric is the phase-locking value (PLV), which is defined as the length of the average vector of many unit vectors whose phase angle corresponds to the phase difference between two signals ([[https://doi.org/10.1103/PhysRevLett.81.3291|Tass et al., 1998]]). If the distribution of the phase difference between the two signals is uniform, the length of such an average vector will be zero. Conversely, if the phases of the two signals are strongly coupled, the length of the average vector will approach unity. For event-related studies, we would expect the phase difference across trials to be uniform distributed unless the phase is locked to the stimulus. In that case, we may have nonuniform marginals which could in principle lead to indications of phase locking between two signals. Considering a pair of narrow-band analytic signals <> and <>, obtained from the TF transformation using the Hilbert transform: {{{#!latex \begin{eqnarray*} \mathrm{PLV} = \left | E\left [ e^{j\Delta \phi (t)} \right ] \right | \\ \end{eqnarray*} }}} with: {{{#!latex \begin{eqnarray*} \Delta \phi (t) = \phi_{\tilde{x}}(t) - \phi_{\tilde{y}}(t) = arg\left ( \frac{\tilde{x}(t)\tilde{y}^{*}(t)}{\left | \tilde{x}(t) \right |\left | \tilde{y}(t) \right |} \right ) \\ \end{eqnarray*} }}} {{attachment:plv.png}} === Process options === * Process: '''''Connectivity > Phase locking value NxN'''''<
><
> {{attachment:gui_plv1n.png||width="400"}} * '''Time window:''' Segment of the signal used for the connectivity analysis. Select '''All file'''. * '''Frequency bands:''' Used for the time-frequency transformation with the Hilbert transform method. See the [[Tutorials/TimeFrequency|time-frequency tutorial]]. In this example, the sampling frequency of the signals being 120Hz, make sure you remove the "gamma2" band. * '''Keep time information:''' Computes PLV across trials, thus the result is a PLV time series for each frequency band. * '''Measure:''' How the resulting vector is reported. Select '''''Magnitude'''''. * '''Output options''': Select '''Save individual results'''. <
> === Result visualization === PLV is frequency resolved, and it was computed for the delta, theta, alpha, beta and gamma bands. With the simulated data, we expect a higher PLV value in the beta band (15 to 29 Hz), between signal 1 and signal 3. This result is seen as a peak at 22 Hz (center of beta band) shown in PLV as a function of frequency. {{attachment:res_plv1n.png||width="350"}} == Phase transfer entropy == Phase transfer entropy (PTE) is a directed connectivity metric that quantifies the [[https://en.wikipedia.org/wiki/Transfer_entropy|transfer entropy]] (TE) between two instantaneous phase time series ([[https://doi.org/10.1016/j.neuroimage.2013.08.056|Lobier et al., 2014]]). Similar to [[#Granger_Causality|GC]], TE estimates whether including the past of both source and target time-series influences the ability to predict the future of the target time-series. In PTE, if a phase signal <> causes the signal <>, the [[http://www.scholarpedia.org/article/Mutual_information|mutual information]], between <> and the past of <> i.e. <> is larger than the mutual information of <>, the past of <> i.e. <> and <>. This relationship can be seen on the Venn diagram below, where <> and <>, indicate mutual information and the individual entropies respectively. Lastly, PTE cannot be negative, and its magnitude does not have a meaningful upper bound. {{attachment:pte.png}} === Process options === * Process: '''''Connectivity > Phase Transfer Entropy NxN'''''<
><
> {{attachment:gui_pte1n.png||width="400"}} * '''Time window:''' Segment of the signal used for the connectivity analysis. Select '''All file'''. * '''Frequency bands:''' Used for the time-frequency transformation with the Hilbert transform method. See the [[Tutorials/TimeFrequency|time-frequency tutorial]]. In this example, the sampling frequency of the signals being 120Hz, make sure you remove the "gamma2" band. * '''Return normalized phase transfer entropy:''' Divides the each directional PTE value between two signals by the sum of both directional PTE values for those two signals. === Result visualization === PTE was computed for the delta, theta, alpha, beta and gamma bands. With the simulated data, we expect a higher PTE value in the beta band, From signal 1 To signal 3, as PTE is directed metric. This is confirmed with a peak at 22 Hz (center of beta band) shown in PTE frequency representation. {{attachment:res_pte1n.png||width="350"}} . == Method selection and comparison == The following table list the available connectivity metrics in Brainstorm and their description. ||Metric ||Directionality ||Domain ||1×N ||N×N ||Time resolved ||Process ||Info || ||Correlation ||Non-directed ||Time ||✅ ||✅ ||✅ ||`bst_corrn.m` ||[[#Correlation|Link]] || ||Coherence ||Non-directed ||Frequency ||✅ ||✅ ||✅ ||`bst_cohn.m` ||[[#Coherence|Link]] || ||Granger causality ||Directed ||Time ||✅ ||✅ ||❌ ||`bst_granger.m` ||[[#Granger_Causality|Link]] || ||Spectral Granger causality ||Directed ||Frequency ||✅ ||✅ ||❌ ||`bst_granger_spectral.m` ||[[#Spectral_Granger_causality|Link]] || ||Envelope Correlation (2020) ||Non-directed ||T-F ||✅ ||✅ ||✅ ||`bst_henv.m` ||[[#Envelope_Correlation_.282020.29|Link]] || ||Phase locking value ||Non-directed ||Phase ||✅ ||✅ ||❌ ||`bst_connectivity.m` ||[[#Phase_locking_value|Link]] || ||Phase transfer entropy ||Directed ||Phase ||❌ ||✅ ||❌ ||`PhaseTE_MF.m` ||[[#Phase_transfer_entropy|Link]] || == Real data: Auditory dataset [TODO] == In this section we will use the results obtained in the introduction tutorials. The goal here is only to illustrate the interface of these tools on real data, as the results are not particularly interesting. The [[Tutorials/CorticomuscularCoherence|corticomuscular coherence tutorial]] provides more complete and meaninful guidelines for computing connectivity measures on real MEG recordings. Let's go back to our [[DatasetIntroduction|auditory oddball dataset]], available in the protocol '''TutorialIntroduction''' if you have followed the introduction tutorials. As the stimulus is played on both ears, we expect to observe highly correlated activity in the '''primary auditory cortices''', in both experimental conditions (standard and deviant beeps), around '''0''' to '''150 ms''' after the stimulus due to auditory evoked responses at 50 and 100 ms (M50, M100). --- TODO: * Add 1xN connectivity in sensor space * Add 1xN connectivity in source space (1 scout vs. full brain) * Add AxB connectivity: one sensor vs. the full brain * Use only single trials: why showing bad practice in the example? * Remove the p-value threshold<
> {{{#!wiki caution In the rest of this section, correlation is computed on the scouts time series of the average response for the standard and deviant conditions. On practice connectivity metrics are computed trial-wise and the results are aggregated. An example of this approach can be seen in the [[Tutorials/CorticomuscularCoherence|corticomuscular coherence tutorial]]. }}} In the [[Tutorials/Scouts#Other_regions_of_interest|Scouts tutorial]], we have created 4 scouts for these regions of interest: '''A1L''' and '''A1R''' for the left and right primary cortices respectively, '''IFGL''' for the left inferior frontal gyrus, and '''M1L''' for the left primary motor cortex. {{attachment:scouts_avg_rel.png}} Let's compute source-domain [[#Correlation|correlation]] for '''standard''' and '''deviant''' conditions for the Run #1: '''S01_AEF_20131218_01_600Hz_notch''' data. 1. Drag and drop the source files associated to the average standard response ('''Avg: standard (193 files)''') and the average deviant response ('''Avg: deviant (193 files)''') within the '''''Process1''''' tab, select the option 'source process' ( {{https://neuroimage.usc.edu/moin_static198/brainstorm1/img/iconResultList.gif}} ), and click on the '''''[Run]''''' button. 1. Add a the process, '''''Connectivity > Correlation NxN'''''. Set the time window from '''0 to 150 ms'''. Check the '''''Use scouts''''' option, and select '''User scouts''' as atlas in the drop menu. Set the '''''Scout function''''' to '''Mean''', for '''''When to apply the scout function''''' select '''Before'''. And select '''''Save individual results (one file per input)'''''. Finally click on '''''[Run]'''''. <
><
> 1. Display the connectivity matrices as '''Image''' (top) and as '''Graph''' (bottom). Adjust the colormaps to show signed values (no absolute), and set the a custom range from '''-0.8''' to '''0.8'''. Lastly, adjust the '''Intensity threshold''' for the graph to the maximum (around 0.7), so only the strongest correlations are kept, mainly, between scouts in the left and right auditory cortices. ||Standard || ||Deviant || || {{attachment:corr_0_150_std_intro.png||width="350"}} || || {{attachment:corr_0_150_dev_intro.png||width="350"}} || || {{attachment:corrg_0_150_std_intro.png||width="350"}} || || {{attachment:corrg_0_150_dev_intro.png||width="350"}} || In this early response period, we appreciate that the correlation matrices for the standard ann deviant response are quite similar, and the strongest correlation happens between the scouts on the primary auditory cortices; just as expected. == Unconstrained sources [TODO] == == Statistics [TODO] == Computing statistical thresholding of the connectivity matrices using non-parametric tests == TODO == * Discuss pValues computed for the various methods * How to choose the best parameters. ex : plv better with 100 samples & narrow bands * PTE option: '''Return normalized phase transfer entropy:''' THIS NEEDS TO BE CLARIFIED, SEE: https://neuroimage.usc.edu/forums/t/confusing-values-of-normalized-pte/32069 * Envelope correlation: * Write process_henv1.m (1xN) and process_henv2.m (AxB) * Remove old processes: Amplitude envelope correlation * Test scout/before: https://neuroimage.usc.edu/forums/t/problem-with-time-dynamic-envelope-correlation/21542/6 == On the hard drive == The connectivity files are extension of the time-frequency failes, therefore their file names start with '''''timefreq_''''', followed by '''''connect1''''' (1xN) or '''''connectn''''' (NxN or AxB), the connectivity method and a time stamp. ''Example: timefreq_connectn_corr_220120_1350.mat''. Right click on of the first connectivity file computed here > File > '''View file contents'''. {{attachment:file_connect.gif}} The data structure is the same as for the [[https://neuroimage.usc.edu/brainstorm/Tutorials/TimeFrequency#On_the_hard_drive|time-frequency files]]. Only the fields that some specificity related with the connectivity analysis are documented here. * '''TF''': [Nsignals x Ntime x Nfreq] matrix containing all the values of the time-frequency decomposition. * '''RefRowNames''': Used only for connectivity matrices. * '''RowNames''': [1 x Nsignals] Cell array of strings that describes each row of the TF matrix. In this specific case, it would be the list of all the MEG sensor names. But it could also be a list of names of scouts or clusters. == Additional documentation == ==== Related tutorials ==== * [[https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence|Corticomuscular coherence]] * [[https://neuroimage.usc.edu/brainstorm/Tutorials/ConnectivityGraph|Connectivity Graphs]] * [[https://neuroimage.usc.edu/brainstorm/Tutorials/FiberConnectivity|Virtual fibers for connectivity]] * [[https://neuroimage.usc.edu/brainstorm/GrangerCausality|Granger causality]] ==== Articles ==== * Nolte G, Bai O, Wheaton L, Mari Z, Vorbach S, Hallett M. <
> [[https://doi.org/10.1016/j.clinph.2004.04.029|Identifying true brain interaction from EEG data using the imaginary part of coherency]]. <
> Clinical Neurophysiology. 2004 Oct;115(10):2292–307. * Pascual-Marqui RD. <
> [[https://arxiv.org/pdf/0706.1776|Coherence and phase synchronization: generalization to pairs of multivariate time series, and removal of zero-lag contributions.]] <
> arXiv preprint arXiv:0706.1776. 2007 Jun 12. * Bressler SL, Seth AK. <
> [[https://doi.org/10.1016/j.neuroimage.2010.02.059|Wiener–Granger causality: a well established methodology.]] <
> Neuroimage. 2011 Sep 15;58(2):323-9. * Dhamala M, Rangarajan G, Ding M. <
> [[https://doi.org/10.1103/PhysRevLett.100.018701|Estimating Granger causality from Fourier and wavelet transforms of time series data.]] <
> Physical review letters. 2008 Jan 10;100(1):018701. * Hipp JF, Hawellek DJ, Corbetta M, Siegel M, Engel AK. <
> [[https://doi.org/10.1038/nn.3101|Large-scale cortical correlation structure of spontaneous oscillatory activity.]] <
> Nature neuroscience. 2012 Jun;15(6):884-90. * Tass P, Rosenblum MG, Weule J, Kurths J, Pikovsky A, Volkmann J, et al. <
> [[https://doi.org/10.1103/PhysRevLett.81.3291|Detection of n : m Phase Locking from Noisy Data: Application to Magnetoencephalography.]] <
> Phys Rev Lett. 1998 Oct 12;81(15):3291–4. * Lobier M, Siebenhühner F, Palva S, Palva JM. <
> [[https://doi.org/10.1016/j.neuroimage.2013.08.056|Phase transfer entropy: a novel phase-based measure for directed connectivity in networks coupled by oscillatory interactions.]] <
> Neuroimage. 2014 Jan 15;85:853-72. * Barzegaran E, Knyazeva MG. <
> [[https://doi.org/10.1371/journal.pone.0181105|Functional connectivity analysis in EEG source space: The choice of method]] <
> Ward LM, editor. PLOS ONE. 2017 Jul 20;12(7):e0181105. * Lai M, Demuru M, Hillebrand A, Fraschini M. <
> [[https://doi.org/10.1038/s41598-018-30869-w|A comparison between scalp- and source-reconstructed EEG networks.]] <
> Sci Rep. 2018 Dec;8(1):12269. * Schoffelen J-M, Gross J. <
> [[https://doi.org/10.1002/hbm.20745|Source connectivity analysis with MEG and EEG.]] <
> Hum Brain Mapp. 2009 Jun;30(6):1857–65. * Kriegeskorte N, Simmons WK, Bellgowan PSF, Baker CI. <
> [[https://doi.org/10.1038/nn.2303|Circular analysis in systems neuroscience: the dangers of double dipping.]] <
> Nat Neurosci. 2009 May;12(5):535–40. ==== Forum discussions ==== * Connectivity matrix storage:[[http://neuroimage.usc.edu/forums/showthread.php?1796-How-the-Corr-matix-is-saved|http://neuroimage.usc.edu/forums/showthread.php?1796]] * Comparing coherence values: http://neuroimage.usc.edu/forums/showthread.php?1556 * Reading NxN PLV matrix: http://neuroimage.usc.edu/forums/t/pte-how-is-the-connectivity-matrix-stored/4618/2 * Export multiple PLV matrices: https://neuroimage.usc.edu/forums/t/export-multiple-plv-matrices/2014/4 * Scout function and connectivity: http://neuroimage.usc.edu/forums/showthread.php?2843 * Unconstrained sources and connectivity: http://neuroimage.usc.edu/forums/t/problem-with-surfaces-vs-volumes/3261 * Unconstrained / PCA: https://neuroimage.usc.edu/forums/t/functional-connectivity-unconstrained-sources-and-pca/30486/4 * Diagonal values: http://neuroimage.usc.edu/forums/t/choosing-scout-function-before-or-after/2454/2 * Connectivity pipeline: https://neuroimage.usc.edu/forums/t/help-for-connectivity-pipeline/12558/4 * Ongoing developments: https://neuroimage.usc.edu/forums/t/connectivity-tutorial-and-methods-development-on-bst/12223/3 * Granger causality: https://neuroimage.usc.edu/forums/t/is-granger-causality-analysis-a-linear-operation/12506/12 * Amplitude Envelope Correlation: * https://neuroimage.usc.edu/forums/t/problem-with-time-dynamic-envelope-correlation/21542/9 * https://github.com/brainstorm-tools/brainstorm3/issues/142 * Coherence on single trials: https://neuroimage.usc.edu/forums/t/difference-between-averaging-coherence-and-concatenate/22726/4 <)>> <> <>