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.24623691167398867; 0.49436721273022155; 0.9140728347361693;;],
 ispc_ang = [-1.6743103948273022; -2.315375917658481; 0.019855901949326217;;],
 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.1409993227109614 2.7736367931740817 … 2.248197362047135 2.3018224215927963; 3.1405947333370934 2.7891384001862383 … 2.7437912777538562 2.576909352685673; -0.0003667937453757375 -0.3477637654695205 … 0.5380444373496556 0.5044018949944712;;;],
 s1_phase = [-1.5703194024695484 -1.1386958775697185 … -1.117497658397073 -1.0761218563960957; -1.570246310753687 -0.8149831269003903 … -1.04665885730375 -0.8949404574102103; -1.570077667033953 -0.7946850729295682 … -0.8659716631862315 -0.6236259890645669;;;],
 s2_phase = [1.570679920241413 1.6349409156043635 … 1.1306997036500621 1.2257005651967006; 1.5703484225834063 1.9741552732858478 … 1.697132420450106 1.6819688952754623; -1.5704444607793286 -1.1424488383990887 … -0.327927225836576 -0.11922409407009572;;;],)

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))