Statistical Learning analysis for EEG - Z-scored Inter-Trial Coherence (ZITC) computation
Project description
autocleaneeg-sl
Statistical Learning analysis for EEG data - computes Z-scored Inter-Trial Coherence (ZITC).
ZITC measures neural entrainment to rhythmic stimuli by comparing phase-locking values against a surrogate distribution, providing a statistically meaningful metric that accounts for baseline phase consistency.
Installation
pip install autocleaneeg-sl
Quick Start
Command Line
# Process a single file
autocleaneeg-sl subject01_epochs.set
# Extract specific target frequencies (e.g., word rate and syllable rate)
autocleaneeg-sl subject01_epochs.set --target-freqs 1.111 3.333
# Process multiple files with custom parameters
autocleaneeg-sl *.set --surrogates 200 --freq-min 0.5 --freq-max 5.0 --output-dir ./results/
Python API
from autocleaneeg_sl import compute_zitc
# Basic usage
result = compute_zitc("subject01_epochs.set")
# Get ZITC at specific frequency
word_zitc = result.get_zitc_at_freq(1.111)
print(f"Word rate ZITC: {word_zitc['zitc']:.3f}")
# Export to DataFrame
df = result.to_dataframe()
df.to_csv("subject01_zitc.csv", index=False)
Parameters
result = compute_zitc(
epochs, # Path to .set file or MNE Epochs object
freq_range=(0.2, 10.0), # Frequency range in Hz
n_surrogates=100, # Number of surrogate iterations
channels=None, # Channel selection (None = all)
random_seed=42, # For reproducibility
verbose=True, # Print progress
)
Method
ZITC is computed as:
ZITC = (True PLV - Surrogate Mean) / Surrogate Std
Where:
- True PLV: Phase-locking value computed from the actual data
- Surrogate Mean/Std: Statistics from null distribution generated by circular time-shifting each epoch
This z-scoring normalizes the raw PLV against chance-level phase consistency, allowing comparison across subjects and frequencies.
Output
The ZITCResult object contains:
frequencies: Array of frequency bins (Hz)raw_itc: Raw PLV values (n_channels x n_freqs)zitc: Z-scored ITC values (n_channels x n_freqs)surrogate_mean,surrogate_std: Null distribution statisticschannel_names: List of channel namessfreq: Sampling frequencyn_epochs: Number of epochsn_surrogates: Number of surrogates used
Requirements
- Python >= 3.9
- NumPy >= 1.20
- MNE-Python >= 1.0
- Pandas >= 1.3
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autocleaneeg_sl-0.1.0.tar.gz.
File metadata
- Download URL: autocleaneeg_sl-0.1.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c039564b18918559e9c7587fef9d2a2ea5c118066d583c421cd6eba0bcb5464a
|
|
| MD5 |
a85d7f813b05606dfddfe7a78ea6d713
|
|
| BLAKE2b-256 |
d3b9da5981d7f364097167cdd52df6a2c284ec4ab094e59a4c606c520f519050
|
File details
Details for the file autocleaneeg_sl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: autocleaneeg_sl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a9b1ed664c3ec302835a403f0bd67aab4146f06e76ab3f85047274b8bb22bbb
|
|
| MD5 |
d4d54bb07430b2562b06955a8fb69a33
|
|
| BLAKE2b-256 |
83899e070d6aac9d8daf50392f6194c7c5f52347d075851fc00d9f30851e415f
|