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.


Tutorials

Learning-oriented. Step-by-step lessons that take you from installation to working analysis pipelines. Start here if you are new to cogpy.

Tutorials
How-to Guides

Task-oriented. Practical recipes for common tasks. Assumes you already know the basics.

How-to Guides
Explanation

Understanding-oriented. Design decisions, data model, and architecture. Read these to understand why cogpy works the way it does.

Explanation
API Reference

Information-oriented. Complete function and class documentation auto-generated from docstrings.

API Reference

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 (because cogpy was taken), but the import name is cogpy: 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)