NeuroAnalyzer tutorials: Analyze: Functional connectivity: ISPC/ITPC

Initialize NeuroAnalyzer
using NeuroAnalyzer
using Plots
eeg = load("files/eeg.hdf");
e10 = epoch(eeg, ep_len=10);

Clustering of phase angles of different electrodes over time (ISCP) or trials (ITPC).

Mean phase angle:

Inter-Site Phase Clustering (ISPC): difference in phase values between two channels. ISPC reflects the variance of phase angle differences between two channels and average over time.

ISPC = ABS(MEAN(EXP(1im × ANGLE DIFFERENCE)))

ISPC for distant and close channels:

ISPC measure is phase-invariant:

Inter-Trial-Phase Clustering (ITPC): phase clustering of one channel average over trials/epochs, at specified time-point.

ITPC = ABS(MEAN(EXP(1im × ANGLES)))

Angles: phase angles at a given time point.

General idea: if oscillations of two areas are phase synchronized \(\rightarrow\) they are functionally connected (transferring information between these two regions)

  • timing (phase) is important, not amplitude
  • consistency in phase difference is important (relative phase is irrelevant)

Phase synchronization:

Application: when there is a hypothesis regarding the timing of band-specific activity over trials with the respect to an experiment event, such as the stimulus onset or response.

Temporal precision of ITPC is lower than ERP.

ISPC values: 0 to 1.

Interpretation: ISPC = 0: random phases, ISPC = 1: perfect phase clustering.

Alternative names: phase synchronization, phase correlation, phase-locking value, phase-locking factor, phase clustering.

ISPC is sensitive to volume conduction

Best use for hypothesis testing.

ITPC gets smaller with increasing number of trials - important when comparing experiments with different number of trials. When comparing ITPC for different recordings - make sure that the number of trials/epochs is similar.

Higher number of trials required for higher frequencies, lower frequencies are less sensitive.

Comparing ITPCs:

A: vectors are clustered around one region

B: vectors are uniformly spread

A: distribution of phase angles is less uniform compared to B

A: clustered phase angles across trials = similar timing of oscillatory processes in these trials

Rayleigh’s Z: used to compare ITPC between subjects of different trials numbers: \[ Z = n \times ITPC^2 \] \(n\): number of trials

Calculate ISPC:

ispc(e10,
     e10,
     ch1=["Fp1", "F3", "T3"],
     ch2=["Fp2", "F4", "T4"],
     ep1=1,
     ep2=1)
(ispc_val = [0.2462369116739891; 0.49436721273022155; 0.9140728347361695;;], ispc_ang = [-1.6743103948273044; -2.315375917658481; 0.01985590194932611;;], s_diff = [0.05356211162171931 -152.46398061801904 … 304.31969173651436 307.4845197571353; 0.01400788633527128 -280.92381336552063 … -53.020934150284866 -52.05033644498863; -0.07544712386492058 -129.53110047203884 … -2.8000691619525924 -5.896578959135425;;;], ph_diff = [3.140999322710961 2.773636793174082 … 2.2481973620471347 2.301822421592796; 3.1405947333370934 2.7891384001862383 … 2.7437912777538562 2.5769093526856723; -0.0003667937453757375 -0.3477637654695206 … 0.5380444373496555 0.5044018949944714;;;], s1_phase = [-1.5703194024695484 -1.1386958775697185 … -1.117497658397073 -1.076121856396095; -1.5702463107536873 -0.8149831269003903 … -1.04665885730375 -0.8949404574102101; -1.570077667033953 -0.7946850729295684 … -0.8659716631862313 -0.623625989064567;;;], s2_phase = [1.5706799202414128 1.6349409156043637 … 1.1306997036500617 1.2257005651967008; 1.5703484225834061 1.9741552732858478 … 1.697132420450106 1.6819688952754623; -1.5704444607793286 -1.142448838399089 … -0.32792722583657585 -0.11922409407009563;;;])

Plot ISPC:

plot_ispc(e10,
          e10,
          ch1="Fp1",
          ch2="Fp2",
          ep1=4,
          ep2=4)

Plot ITPC at 1000 ms (1 s) time point:

plot_itpc(e10, ch="Fp1", t=t2s(e10, t=1))