Skip to main content

autoreject

CircleCI GitHub Actions Codecov PyPI Conda-Forge

This is a library to automatically reject bad trials and repair bad sensors in magneto-/electroencephalography (M/EEG) data.

https://autoreject.github.io/stable/_images/sphx_glr_plot_auto_repair_001.png

The documentation can be found under the following links:

Installation

We recommend the Anaconda Python distribution and a Python version >= 3.11. We furthermore recommend that you install autoreject into an isolated Python environment. To obtain the stable release of autoreject, you can use pip:

pip install -U autoreject

Or conda:

conda install -c conda-forge autoreject

If you want the latest (development) version of autoreject, use:

pip install https://github.com/autoreject/autoreject/archive/refs/heads/main.zip

To check if everything worked fine, you can do:

python -c 'import autoreject'

and it should not give any error messages.

Below, we list the dependencies for autoreject. All required dependencies are installed automatically when you install autoreject.

  • mne (>=1.5.0)

  • numpy (>=1.21.2)

  • scipy (>=1.7.1)

  • scikit-learn (>=1.0.0)

  • joblib

  • matplotlib (>=3.5.0)

Optional dependencies are:

  • openneuro-py (>= 2021.10.1, for fetching data from OpenNeuro.org)

Quickstart

The easiest way to get started is to copy the following three lines of code in your script:

>>> from autoreject import AutoReject
>>> ar = AutoReject()
>>> epochs_clean = ar.fit_transform(epochs)  # doctest: +SKIP

This will automatically clean an epochs object read in using MNE-Python. To get the rejection dictionary, simply do:

>>> from autoreject import get_rejection_threshold
>>> reject = get_rejection_threshold(epochs)  # doctest: +SKIP

We also implement RANSAC from the PREP pipeline (see PyPREP for a full implementation of the PREP pipeline). The API is the same:

>>> from autoreject import Ransac
>>> rsc = Ransac()
>>> epochs_clean = rsc.fit_transform(epochs)  # doctest: +SKIP

For more details check out the example to automatically detect and repair bad epochs.

Bug reports

Please use the GitHub issue tracker to report bugs.

Cite

[1] Mainak Jas, Denis Engemann, Federico Raimondo, Yousra Bekhti, and Alexandre Gramfort, “Automated rejection and repair of bad trials in MEG/EEG.” In 6th International Workshop on Pattern Recognition in Neuroimaging (PRNI), 2016.

[2] Mainak Jas, Denis Engemann, Yousra Bekhti, Federico Raimondo, and Alexandre Gramfort. 2017. “Autoreject: Automated artifact rejection for MEG and EEG data”. NeuroImage, 159, 417-429.

Download files

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

Source Distribution

autoreject-0.5.0.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

autoreject-0.5.0-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file autoreject-0.5.0.tar.gz.

File metadata

  • Download URL: autoreject-0.5.0.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for autoreject-0.5.0.tar.gz
Algorithm Hash digest
SHA256 948adfc4e65c156bb6731cbaf820ce6ff899e9fd4d4c3182ccd27ac9faa7a1cd
MD5 471ca2e47ce9152ed68683a4f769913e
BLAKE2b-256 c7228d25a7071c0e8b617b965769f4fff56eee70aac09f2862a33d9e12a160bc

See more details on using hashes here.

File details

Details for the file autoreject-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: autoreject-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for autoreject-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa406c510574557c699405bcd6d1ce0a31091f08960122db0f729f4e72b75963
MD5 48ae6d5f172d35f069b297988d0f55cb
BLAKE2b-256 092f810c94631babedbe81d3a93830c5562e3472547354e20e679a9cd8399101

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2

2 files

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page