Wpli Connectivity
Module name: WpliConnectivity
Package: CEAMSModules 7.4.0
Version: 2.1.0
Overview
This node computes corrected Weighted Phase Lag Index (wPLI) connectivity from EEG epochs.
Workflow
Stack input epochs into a 3D array with shape (num_epochs, num_channels, num_samples).
Remove artifact windows by dropping any epoch that contains NaNs (across all channels/samples).
For each remaining epoch, compute wPLI between all channel pairs using the analytic (Hilbert) signal.
Build a null distribution via time-shift (lag) surrogates and apply a Wilcoxon test: keep (real wPLI − median(surrogates)) if p < p_value and real > median; otherwise set 0.
Return the per-epoch corrected wPLI and the average across epochs, along with channel names.
Inputs
Input |
Format |
Default |
Description |
|---|---|---|---|
|
list[EpochModel] |
— |
Each EpochModel has .samples (2D array W×T: epochs × samples), .sample_rate, .channel. |
|
pandas.DataFrame |
— |
Present for interface consistency; not used by the computation here. |
|
int |
20 |
Number of time-shift surrogates for correction. |
|
float |
0.05 |
Significance threshold for the Wilcoxon signed-rank test. |
Outputs
Output |
Format |
Description |
|---|---|---|
|
dict |
{
“final_wpli”: (num_epochs_kept, C, C) array of corrected wPLI per epoch,
“average_wpli”: (C, C) array = mean over kept epochs,
“channel_names”: list[str] of channel labels
}
|
Usage in a process
Open Dev Tools -> New process in Snooz.
In the Module Library, find Wpli Connectivity under the Connectivity Analysis category.
Drag the module onto the process canvas.
Connect the required inputs from upstream modules (or set values in the Settings tab).
Connect outputs to downstream modules as needed.
Double-click the module to configure parameters in the Settings tab.
Run the process and inspect results in the Results tab.
Note
For general guidance on building processes with modules, see Explore examples.