Skip to main content

EEG source localization with DK atlas regions

Project description

AutoClean EEG2Source

EEG source localization with Desikan-Killiany (DK) atlas regions. This package converts EEG epochs to source-localized data using the DK brain atlas.

Features

  • Convert EEG epochs to source-localized data with DK atlas regions
  • Memory-efficient processing with monitoring
  • Support for EEGLAB .set file format
  • Batch processing capabilities
  • Command-line interface

Installation

Requirements

  • Python >= 3.8
  • MNE-Python 1.6.0
  • nibabel
  • numpy
  • pandas
  • loguru
  • psutil

Install from source

pip install .

Install in development mode

pip install -e .

Install with development dependencies

pip install -e ".[dev]"

Command-Line Usage

The package provides a command-line interface for processing EEG files.

Process EEG files

Convert EEG epochs to source-localized data:

autoclean-eeg2source process input.set --output-dir ./results

Process multiple files in a directory:

autoclean-eeg2source process ./data --output-dir ./results --recursive

Validate files

Check if EEG files are valid:

autoclean-eeg2source validate ./data

Get file information

Display information about an EEG file:

autoclean-eeg2source info input.set

Advanced options

autoclean-eeg2source process input.set \
    --output-dir ./results \
    --montage "GSN-HydroCel-129" \
    --resample-freq 250 \
    --lambda2 0.1111 \
    --max-memory 4.0 \
    --log-level INFO

Python API Usage

from autoclean_eeg2source import SequentialProcessor, MemoryManager

# Initialize components
memory_manager = MemoryManager(max_memory_gb=4)
processor = SequentialProcessor(
    memory_manager=memory_manager,
    montage="GSN-HydroCel-129",
    resample_freq=250
)

# Process a file
result = processor.process_file("input.set", "./output")

if result['status'] == 'success':
    print(f"Output saved to: {result['output_file']}")
else:
    print(f"Processing failed: {result['error']}")

Output Format

The package outputs:

  • .set files with DK atlas regions as channels (68 regions)
  • _region_info.csv with region metadata (names, hemispheres, positions)

Building and Publishing

Build the package

python -m build

Upload to TestPyPI

python -m twine upload --repository testpypi dist/*

Install from TestPyPI

pip install --index-url https://test.pypi.org/simple/ --no-deps autoclean-eeg2source

License

MIT License

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_eeg2source-0.1.1.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

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

autoclean_eeg2source-0.1.1-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

Details for the file autoclean_eeg2source-0.1.1.tar.gz.

File metadata

File hashes

Hashes for autoclean_eeg2source-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cdaaca774a82fe867995d2d903232caa9ad147d81189341a281f4617140efb99
MD5 5f75486a00d0552af4728ea1e21d54f7
BLAKE2b-256 1c3e7fd6abae558807833e2af6d7925fcab7b06afccf1c906875a1cc2ca89a1d

See more details on using hashes here.

File details

Details for the file autoclean_eeg2source-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for autoclean_eeg2source-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f55ba7648d5d43f67aa1558b3a4d88fe7a5d22f0c7d50d946abc46e0975aaba5
MD5 b82dca233435507e8614e742e71cfe33
BLAKE2b-256 556b944656981aec0d05211c4a777752831ea20658952c2fda9aded59b174ee2

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