
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
|CircleCI|_ |GitHub Actions|_ |Codecov|_ |PyPI|_ |Conda-Forge|_
.. |CircleCI| image:: https://circleci.com/gh/autoreject/autoreject/tree/master.svg?style=shield&circle-token=:circle-token .. _CircleCI: https://circleci.com/gh/autoreject/autoreject
.. |GitHub Actions| image:: https://github.com/autoreject/autoreject/actions/workflows/test.yml/badge.svg .. _GitHub Actions: https://github.com/autoreject/autoreject/actions/workflows/test.yml
.. |Codecov| image:: http://codecov.io/github/autoreject/autoreject/coverage.svg?branch=master .. _Codecov: http://codecov.io/github/autoreject/autoreject?branch=master
.. |PyPI| image:: https://badge.fury.io/py/autoreject.svg .. _PyPI: https://badge.fury.io/py/autoreject
.. |Conda-Forge| image:: https://img.shields.io/conda/vn/conda-forge/autoreject.svg .. _Conda-Forge: https://anaconda.org/conda-forge/autoreject/
This is a library to automatically reject bad trials and repair bad sensors in magneto-/electroencephalography (M/EEG) data.
.. image:: https://autoreject.github.io/stable/_images/sphx_glr_plot_auto_repair_001.png :width: 400
The documentation can be found under the following links:
stable release <https://autoreject.github.io/stable/index.html>_latest (development) version <https://autoreject.github.io/dev/index.html>_.. docs_readme_include_label
We recommend the Anaconda Python distribution <https://www.anaconda.com/>_
and a Python version >= 3.8.
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://api.github.com/repos/autoreject/autoreject/zipball/master
If you do not have admin privileges on the computer, use the --user flag
with pip.
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.0)numpy (>=1.20.2)scipy (>=1.6.3)scikit-learn (>=0.24.2)joblibmatplotlib (>=3.4.0)Optional dependencies are:
openneuro-py (>= 2021.10.1, for fetching data from OpenNeuro.org <https://openneuro.org>_)The easiest way to get started is to copy the following three lines of code in your script:
.. code:: python
>>> 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:
.. code:: python
>>> from autoreject import get_rejection_threshold
>>> reject = get_rejection_threshold(epochs) # doctest: +SKIP
We also implement RANSAC from the PREP pipeline <https://doi.org/10.3389/fninf.2015.00016>_
(see PyPREP <https://github.com/sappelhoff/pyprep>_ for a full implementation of the PREP pipeline).
The API is the same:
.. code:: python
>>> 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 <https://autoreject.github.io/stable/_images/sphx_glr_plot_auto_repair_001.png>_.
Please use the GitHub issue tracker <https://github.com/autoreject/autoreject/issues>_ to report bugs.
[1] Mainak Jas, Denis Engemann, Federico Raimondo, Yousra Bekhti, and Alexandre Gramfort, "Automated rejection and repair of bad trials in MEG/EEG <https://hal.archives-ouvertes.fr/hal-01313458/document>_."
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 <http://www.sciencedirect.com/science/article/pii/S1053811917305013>_".
NeuroImage, 159, 417-429.
FAQs
Automated rejection and repair of epochs in M/EEG.
We found that autoreject demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.