Skip to content

Connectivity

Connectivity analysis asks whether two brain regions are communicating—not just whether they’re both active, but whether their electrical oscillations show a consistent phase relationship that suggests coordinated function. This is a fundamentally different question from spectral power (how much energy is in each frequency band) and requires different methods, different assumptions, and different cautions.

The analysis display page describes how to read the connectivity visualizations. This page describes how the connectivity values are computed—the algorithms, the parameters, and the trade-offs behind each choice.

The pipeline uses the debiased weighted Phase Lag Index (dwPLI) as its primary connectivity metric. Understanding why requires understanding the central problem of scalp EEG connectivity: volume conduction.

When a cortical source generates an electrical field, that field propagates through cerebrospinal fluid, skull, and scalp to arrive at multiple electrodes simultaneously—with zero time delay. This instantaneous spreading creates correlated signals at electrodes that aren’t measuring communicating brain regions. Traditional coherence captures all phase relationships, including these zero-lag correlations, and therefore cannot distinguish genuine inter-regional communication from volume conduction artifact.

dwPLI solves this by ignoring zero-lag relationships entirely. It considers only lagged phase differences—cases where the oscillations at two electrodes are consistently offset in time. The logic is that genuine neural communication takes time to propagate (axonal conduction velocity is finite), so real connectivity should show a consistent phase lag. Volume conduction arrives instantaneously (zero lag) and is therefore excluded.

The “weighted” part means that phase offsets near zero are down-weighted, reducing sensitivity to noise around the zero-lag boundary. The “debiased” part corrects for sample-size bias that can inflate PLI estimates with short data segments. Together, these refinements make dwPLI the most robust phase-based connectivity metric available for clinical scalp EEG.

Coherence (magnitude-squared coherence) is the most familiar connectivity metric in clinical EEG. The Coherence Workstation computes coherence—it’s available in the analysis and is used for validation against EEGLAB—but it is not the primary metric because it cannot distinguish genuine connectivity from volume conduction.

Phase Locking Value (PLV) captures phase consistency without regard to amplitude, which is useful in some research contexts. But like coherence, PLV is sensitive to zero-lag relationships and therefore to volume conduction. It also has no debiasing, making it sensitive to epoch count.

Imaginary coherence (imCoh) is another volume-conduction-robust metric—it captures only the imaginary part of the cross-spectrum, which by definition excludes zero-lag contributions. The pipeline computes imaginary coherence as a complementary metric. It’s theoretically similar to dwPLI but handles differently in edge cases. Both are available in the output; dwPLI is the default for clinical display.

The configuration specifies all three methods:

connectivity:
methods: [dwpli, coh, imcoh]

Connectivity estimation requires dividing the continuous signal into epochs and computing cross-spectral statistics across those epochs. The epoch parameters determine both the frequency resolution and the statistical stability of the estimates:

connectivity:
epoch_length: 2.0
epoch_overlap: 0.0
min_epochs: 30
max_epochs: 120

Epoch length: 2.0 seconds. This is a trade-off between frequency resolution and stationarity. Longer epochs provide finer frequency resolution (a 4-second epoch resolves 0.25 Hz steps, vs. 0.5 Hz for a 2-second epoch) but assume stationarity over the entire epoch—an assumption that becomes less valid as the window grows. Two seconds is a reasonable compromise: it provides 0.5 Hz resolution, which is sufficient to resolve the clinical frequency bands, while staying within the range where resting EEG is approximately stationary.

No overlap (epoch_overlap: 0.0). Overlapping epochs increase the effective number of estimates but introduce statistical dependence between adjacent epochs. For dwPLI, which involves surrogate testing with strict independence assumptions, non-overlapping epochs are more conservative and produce more reliable significance estimates.

Minimum 30 epochs. Connectivity estimates are unstable with few epochs—the phase relationship between two channels needs enough samples to distinguish a consistent pattern from random fluctuation. Thirty non-overlapping 2-second epochs require 60 seconds of clean data. If the recording has fewer than 30 clean epochs after artifact rejection, the connectivity stage is skipped for that condition rather than producing unreliable results.

Maximum 120 epochs. This caps computation time and memory usage. For a 5-minute recording with 80% clean data, you’d get approximately 120 epochs—right at the cap. The cap prevents excessively long recordings from consuming unreasonable resources without proportional improvement in estimate quality.

Rather than reporting connectivity between all 171 electrode pairs (19 × 18 / 2), the pipeline organizes electrodes into 9 functional hubs based on anatomical location:

HubLabelElectrodesFunctional Role
Frontal midlineF_midFzExecutive / attention
Frontal leftF_LFp1, F3, F7Left executive
Frontal rightF_RFp2, F4, F8Right executive
Central midlineC_midCz, C3, C4Sensorimotor
Temporal leftT_LT3, T5Language / auditory
Temporal rightT_RT4, T6Spatial / auditory
Parietal midlineP_midPz, P3, P4Integrative
Occipital leftO_LO1Visual left
Occipital rightO_RO2Visual right

Hub-level connectivity is the mean dwPLI across all electrode pairs between two hubs. This reduces the 171-pair matrix to a 36-pair hub matrix (9 × 8 / 2), which is clinically interpretable without sacrificing the essential connectivity structure. The hub assignment follows standard functional neuroanatomy and is consistent across subjects.

How do you know if a connectivity value is “real”? A dwPLI value of 0.15 might reflect genuine phase coupling, or it might be a statistical fluctuation from random data. The pipeline answers this question with surrogate significance testing:

connectivity:
surrogate:
enabled: true
n_surrogates: 200
method: phase_randomize
alpha: 0.05
fdr_correction: true

The procedure is straightforward. For each pair of channels, the pipeline creates 200 surrogate datasets by randomly shuffling the phase spectrum of one channel (destroying any genuine phase relationship) while preserving the amplitude spectrum (maintaining the same spectral power). dwPLI is computed for each surrogate, creating a null distribution of connectivity values that would be expected by chance. The real dwPLI value is then compared against this null distribution—if it exceeds the 95th percentile (alpha = 0.05), the connection is considered statistically significant.

FDR correction (Benjamini-Hochberg) adjusts for multiple comparisons. With 171 electrode pairs × 6 frequency bands = 1,026 tests, some would be significant by chance at p < 0.05. FDR correction controls the expected proportion of false discoveries, ensuring that the reported significant connections are unlikely to be spurious.

This approach replaces the arbitrary percentile thresholds that many connectivity pipelines use (e.g., “show the top 15% of connections”). Those thresholds have no statistical basis—they’re display parameters masquerading as significance criteria. Surrogate testing provides a principled statistical framework for deciding which connections to report.

In addition to within-band connectivity (alpha-to-alpha, theta-to-theta), the pipeline computes cross-frequency coupling (CFC)—specifically, theta-gamma phase-amplitude coupling:

connectivity:
cfc:
enabled: true
phase_band: [4, 8]
amp_band: [30, 45]
n_bins: 18

CFC measures whether the phase of theta oscillations (4–8 Hz) modulates the amplitude of gamma oscillations (30–45 Hz). This is computed using the Modulation Index (MI): the gamma amplitude signal is binned by theta phase (18 bins of 20° each), and the MI quantifies how non-uniform the amplitude distribution is across phase bins. A high MI means gamma power peaks at a specific phase of the theta cycle—evidence that the two frequency bands are functionally coupled.

Theta-gamma coupling is one of the most replicated findings in cognitive neuroscience. It’s associated with working memory maintenance, attention, and information integration. The coupling suggests that theta oscillations provide a temporal framework within which gamma bursts carry specific information content—a “letters within words” metaphor where theta provides the word structure and gamma provides the letter content.

From the dwPLI connectivity matrices, the pipeline computes four structural metrics that characterize the brain’s network organization:

Small-World Index (σ) measures whether the network has the characteristic architecture found in healthy neural networks—dense local clustering combined with efficient long-range communication. σ = (C/C_rand) / (L/L_rand), where C is the clustering coefficient and L is the average path length, each normalized to a random network of the same size. Values above 1.5 indicate robust small-world organization.

Network Segregation quantifies how well functional networks maintain their boundaries. Computed from the ratio of within-network to between-network connectivity using betweenness centrality for module detection. Higher values indicate well-differentiated networks with clear functional specialization.

Frequency Topology Consistency measures whether different frequency bands produce different connectivity layouts. Computed as the average Pearson correlation between dwPLI matrices across all band pairs. Low consistency (different topology per band) is healthy—it means each frequency band serves a distinct functional role with its own wiring pattern.

Hemispheric Balance Index captures the laterality of connectivity strength. Computed as a laterality index (−1 to +1) from the left vs. right within-hemisphere connectivity, plus the interhemispheric connectivity ratio. Values near zero indicate balanced organization.

These metrics are computed directly from the dwPLI matrices—no hidden assumptions, no black-box scoring. They’re deterministic structural descriptions of how this particular brain’s connectivity is organized.

When both resting-state and task-condition recordings are available, the pipeline computes a reconfiguration index for each frequency band: 1 minus the Pearson correlation between the resting and task dwPLI matrices. This measures how much the brain’s connectivity pattern changes between conditions.

Moderate reconfiguration (0.3–0.6) suggests healthy adaptive flexibility—the brain adjusts its network topology to meet task demands. Very low reconfiguration (<0.2) suggests rigidity. Very high reconfiguration (>0.7) suggests instability. The analysis display page discusses clinical interpretation in more detail.