cogpy
Python toolkit for ECoG / iEEG signal processing and analysis.
cogpy provides composable, file-agnostic compute primitives for intracranial electrophysiology: filtering, spectral analysis, event detection, bad-channel identification, and spatial grid measures. It pairs a structured I/O layer with reproducible Snakemake pipelines and serves as the backend for visualization frontends.
Learning-oriented. Step-by-step lessons that take you from installation to working analysis pipelines. Start here if you are new to cogpy.
Task-oriented. Practical recipes for common tasks. Assumes you already know the basics.
Understanding-oriented. Design decisions, data model, and architecture. Read these to understand why cogpy works the way it does.
Information-oriented. Complete function and class documentation auto-generated from docstrings.
Installation
pip install -e ".[all]" # full install (editable dev)
pip install ecogpy # minimal core
pip install "ecogpy[viz]" # with visualization deps
pip install "ecogpy[io]" # with I/O format support
Note: The PyPI package is
ecogpy(becausecogpywas taken), but the import name iscogpy:import cogpy.
Quick Example
import cogpy
# Load sample grid ECoG data
sig = cogpy.datasets.load_sample()
# Compute multitaper PSD
from cogpy.spectral.psd import psd_multitaper
psd, freqs = psd_multitaper(sig.values, fs=sig.fs)
# Detect spectral bursts
from cogpy.detect import BURST_PIPELINE
events = BURST_PIPELINE.run(sig)