Skip to main content

A modular framework for automated EEG data processing, built on MNE-Python

Project description

AutoClean EEG

Python License Code style: black

A modular framework for automated EEG data processing, built on MNE-Python.

Features

  • Framework for automated EEG preprocessing with "lego block" modularity
  • Support for multiple EEG paradigms (ASSR, Chirp, MMN, Resting State)
  • BIDS-compatible data organization and comprehensive quality control
  • Extensible plugin system for file formats, montages, and event processing
  • Research-focused workflow: single file testing → parameter tuning → batch processing
  • Detailed output: logs, stage files, metadata, and quality control visualizations

Installation

pip install autoclean-eeg

For development installation:

git clone https://github.com/cincibrainlab/autoclean_pipeline.git
cd autoclean-eeg
uv tool install -e --upgrade ".[dev]"

Quick Start

AutoClean EEG offers two approaches for building custom EEG processing workflows:

Option 1: Python Task Files (Recommended for New Users)

Create simple Python files that combine configuration and processing logic:

# my_task.py
from typing import Any, Dict
from autoclean.core.task import Task

# Embedded configuration
config = {
    'resample_step': {'enabled': True, 'value': 250},
    'filtering': {'enabled': True, 'value': {'l_freq': 1, 'h_freq': 100}},
    'ICA': {'enabled': True, 'value': {'method': 'picard'}},
    'epoch_settings': {'enabled': True, 'value': {'tmin': -1, 'tmax': 1}}
}

class MyRestingTask(Task):
    def __init__(self, config: Dict[str, Any]):
        self.settings = globals()['config']
        super().__init__(config)
    
    def run(self) -> None:
        self.import_raw()
        self.run_basic_steps(export=True)
        self.run_ica(export=True)
        self.create_regular_epochs(export=True)
# Use your custom task
from autoclean import Pipeline

pipeline = Pipeline(output_dir="/path/to/output")
pipeline.add_task("my_task.py")
pipeline.process_file("/path/to/data.raw", task="MyRestingTask")

Option 2: Traditional YAML Configuration

For complex workflows or when you prefer separate config files:

from autoclean import Pipeline

# Initialize pipeline with YAML configuration
pipeline = Pipeline(
    output_dir="/path/to/output"
)

# Process using built-in tasks
pipeline.process_file(
    file_path="/path/to/test_data.raw", 
    task="rest_eyesopen"
)

Typical Research Workflow

  1. Test single file to validate task and tune parameters
  2. Review results in output directories and adjust as needed
  3. Process full dataset using batch processing
# Batch processing (works with both approaches)
pipeline.process_directory(
    directory="/path/to/dataset",
    task="MyRestingTask",  # or built-in task name
    pattern="*.raw"
)

Key Benefits of Python Task Files:

  • Simpler: No separate YAML files to manage
  • Self-contained: Configuration and logic in one file
  • Flexible: Optional export=True parameters control file outputs
  • Intuitive: Pandas-like API with sensible defaults

Documentation

Full documentation is available at https://cincibrainlab.github.io/autoclean_pipeline/

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use this software in your research, please cite:

@software{autoclean_eeg,
  author = {Gammoh, Gavin, Pedapati, Ernest, and Grace Westerkamp},
  title = {AutoClean EEG: Automated EEG Processing Pipeline},
  year = {2024},
  publisher = {GitHub},
  url = {[https://github.com/yourusername/autoclean-eeg](https://github.com/cincibrainlab/autoclean_pipeline/)}
}

Acknowledgments

  • Cincinnati Children's Hospital Medical Center
  • Built with MNE-Python

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoclean_eeg-2.0.0.tar.gz (339.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autoclean_eeg-2.0.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file autoclean_eeg-2.0.0.tar.gz.

File metadata

  • Download URL: autoclean_eeg-2.0.0.tar.gz
  • Upload date:
  • Size: 339.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.2

File hashes

Hashes for autoclean_eeg-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8f9136a3f75965947c38a2191897703fce6efe3cca112b0d667c4cb3d4a8d51d
MD5 bb6bac06a5caf432d0c0eaa301b42ff7
BLAKE2b-256 6ff14b32547b690a433c29f78f5d202ef8262de164f56a86ed3864f92e17eb90

See more details on using hashes here.

File details

Details for the file autoclean_eeg-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for autoclean_eeg-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f9282dfca01b1424694fea03f401393a74eb4484ef8ae46342c8ecbe14d7f74
MD5 2d4441a056578e1718361ba98b53a9e6
BLAKE2b-256 71e29b07c86463a3e0681f5e733a7f50843bb2f7e97fa99cd0b8658f18564cfa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page