## WB_EEG_CalcNetwork

Information and resources about the WeBrain tools
WeBrainTool
Posts: 14
Joined: Mon Apr 19, 2021 10:56 am

### WB_EEG_CalcNetwork

WB_EEG_CalcNetwork is a basic tool to calculate EEG network between EEG channels at scalp level. Calculating EEG network consists of:
 Specific event data can be extracted according to the input ‘eventlabel’. If the input ‘eventlabel’ is empty, all data will be used. If applicable, EEG segments in bad block (label 9999, marked by WB_EEG_Mark) will be rejected automatically, and NOT used to calculate network.
 Specific EEG signals will be divided into small epochs.
 EEG data of each epoch (default is 5-s epoch) was subjected to calculate correlation/coherence/PSI/PLV to obtain the EEG network across electrodes in the specific bands

Connections can be defined as (Bob et al., 2008; Edagawa and Kawasaki, 2017; Lee and Hsieh, 2014; Xu et al., 2014):
(1)Pearson’s correlation
(2)Magnitude squared coherence. The magnitude squared coherence estimate is a function of frequency with values between 0 and 1 that indicates how well x corresponds to y at each frequency. The magnitude squared coherence is a function of the power spectral densities. PSI tends to 0 for asynchronous processes and to 1 for phase locked systems. Considering real noisy data, neither 0 nor 1 is reached, but we can expect that the PSI for synchronized oscillations will be significantly larger than for unsynchronized processes.
(3)Phase Locking Value (PLV). The phase locking index is sensitive to phase change and its value ranges from 0 to 1. The PLV =1 if and only if the condition of strict phase locking is obeyed. In contrast, the PLV = 0 for uniformly distributed phases.

Default frequency bands are (Chen et al., 2008; Malver et al., 2014; Nuwer et al., 1994; Thatcher et al., 2005):
delta: 1 - 4 Hz
theta: 4 - 8 Hz
alpha: 8 - 12.5 Hz
beta: 12.5 - 25 Hz
high beta: 25 - 30 Hz
gamma1: mean power acorss 30 - 40 Hz
gamma2: mean power acorss 40 - 60 Hz
fullband: 1 - 60 Hz Fig. 7: Pipelines of calculating EEG networks of EEG data. (A) Calculating EEG networks of a specific event data. Step1: Specific event data are first extracted according to the input ‘eventlabel’ (e.g. label ‘22’). If applicable, EEG segments in bad block (label 9999, marked by WB_EEG_Mark) will also be rejected automatically, and NOT used to calculate power indices. Step2: Specific event EEG signals will be divided into small epochs. Step3: EEG data of each small epoch (default is 5s epoch) will be subjected to calculate correlation/coherence/PSI/PLV to obtain the EEG network across electrodes in the specific bands. (B) Calculating EEG networks of all data. All data will be divided into small epochs first, and then data of each epoch (excluding bad blocks) will be used to calculate EEG networks.

Parameters
epochLenth: Length of small epochs to calculate power. Unit is second. Default is 5s. Epochs less than epochLenth will be not used to calculate indices. If epochLenth is negative (Fig. 2), it means that if possible, data before event labels (eventlabel) will be used (no overlapped).
eventlabel: Event label which means specific event data. If it is empty, all data will be used to calculate indices. If eventlabel is not found in events, NO data will be epoched and calculated. If structure event (eventlabel) doesn’t include duration, the duration will be equal to epochLenth. DO NOT contain blank spaces in the event label (e.g. S 22). Strings of events will be compared ignoring space characters. Default is empty (‘[]’).
bandLimit: A string array with specific frequency bands. Default is ‘[1,4],[4,8],[8,12.5],[12.5,25],[25,30],[30,40],[40,60],[1,60]’. If it is ‘[]’, full band will be used. Bands should be separated by comma.
seleChanns: String with indices of the selected channels (e.g. ‘[1:4,7:30]’), or ‘all’. Default is ‘all’.
method: Method used to calculate EEG network. Default is 'psi'.
‘corr’: Pearson’s correlation
‘cohere’: Magnitude squared coherence
‘psi’: Phase Synchronization Index
‘plv’: Phase Locking Value
proportion: overlapped proportion for each segments/sliding windows. It should be [0,1). Default is 0 (no overlapped).
srate: Sampling rate of EEG data. It can be automatically detected in EEG data, if it is ‘[]’. But for ASCII/Float .txt File and MATLAB .mat File, users should fill the sampling rate by hand. Default is ‘[]’.
grouplabel: Group label of subject. It will be used to statistical analysis in the future. Default is ‘[]’.

Note: EEG data will be imported as EEG structure using EEGLAB. EEG.data should be channels × time points OR channels × time points × epochs. If size of EEG.data is channels × time points × epochs (has been epoched), all data will be used to calculate EEG network. If applicable, epochs in bad block (label 9999, marked by WB_EEG_Mark) will also be rejected automatically, and NOT used to calculate network.

Outputs
For each subject, output is a MATLAB .mat file (network_*.mat) in which is a structure EEG_results including connection matrices, mean connection matrices across epochs, z-score connection matrices and parameters. The results can be used to calculate network measures based on graph theory using EEG tool WB_EEG_calcBasicNetIndices.

EEG_results.type: type of results, i.e. ‘network’;
EEG_results.nettype: type of network;
‘BU’: binary undirected network;
‘BD’: binary directed network;
‘WU’: weighted undirected network;
‘WD’: weighted directed network.
EEG_results.M: connection matrix (symmetric) across frequency bands. Size of M is channels × channels × epochs × frequency bands;
EEG_results.M_zscore: Fisher's z-score connection matrix across frequency bands. Size of M_zscore is channels × channels × epochs × frequency bands;
EEG_results.M_mean: mean connection matrix across epochs. Size of M_mean is channels × channels × frequency bands;
EEG_results.M_zscore_mean: mean Fisher's z-score connection matrix across epochs. Size of M_zscore_mean is channels × channels × frequency bands;
EEG_results.Block_percentage: percentage of EEG data used to calculate network.
EEG_results.filename: filename of EEG data;

EEG_results.parameter.bandLimit: an array with specific frequency bands;
EEG_results.parameter.bandName: a cell array with band names;
EEG_results.parameter.eventlabel: an eventlabel which means specific data;
EEG_results.parameter.selechanns: an array with selected channels;
EEG_results.parameter.epochLenth: length of small epochs. Unit is time point;
EEG_results.parameter.srate: sampling rate of EEG data;
EEG_results.parameter.method: method used to calculate EEG network;
EEG_results.parameter.proportion: overlapped proportion for each segments/sliding windows;
EEG_results.parameter.chanlocs: channel locations;
EEG_results.parameter.ref: reference of EEG data;
EEG_results.grouplabel: group label of subject. It will be used to statistical analysis in the future.

### Who is online

Users browsing this forum: No registered users and 1 guest