Skip to main content

ASRpy

Tests codecov PyPI version Documentation

Artifact Subspace Reconstruction for Python

Introduction

Artifact subspace reconstruction (ASR) is an automated, online, component-based artifact removal method for removing transient or large-amplitude artifacts in multi-channel EEG recordings (Kothe & Jung, 2016). This repository provides a Python implementation of the standard ASR algorithm, similar to the original MATLAB implementation in EEGLab's clean_rawdata plugin. As of now, this repository only implements the standard version of the ASR algorithm. A valid version of the improved riemannian ASR (Blum et al., 2019) might be added in the future.

This implementation aims to follow the original ASR algorithm as close as possible. Using the according parameters, it should be perfectly equivalent to the original implementation, except for a few imprecisions introduced by different solvers implemented in Python and MATLAB, e.g. when calculating the eigenspace. However, this implementation is based on python_meegkit. For an alternative implementation check their repository.

References

Installation

You can install the latest ASRpy release using:

pip install asrpy

or install the current working version directly from GitHub, using:

pip install git+https://github.com/DiGyt/asrpy.git

Examples

ASRpy applies the Artifact Subspace Reconstruction method directly to MNE-Python's mne.io.Raw objects. It's usage should be as simple as:

import asrpy
asr = asrpy.ASR(sfreq=raw.info["sfreq"], cutoff=20)
asr.fit(raw)
raw = asr.transform(raw)

To get started, we recommend going through the example notebook. You can simply run them via your internet browser (on Google Colab's hosted runtime) by clicking the button below.

Open in Colab

Documentation

The ASRpy documentation is created using pdoc3 and GitHub Pages. Click on the link below to view the documentation.

Documentation

In most Python IDEs, you can also read them by e.g. typing asrpy.ASR?

Metadata

Release files for asrpy 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asrpy 0.0.8
File Size Uploaded Provenance Actions
asrpy-0.0.8.tar.gz 20.8 kB Without provenance Details for asrpy-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asrpy 0.0.8
File Interpreter ABI Platform Actions
asrpy-0.0.8-py3-none-any.whl Python 3 none any Details for asrpy-0.0.8-py3-none-any.whl

Total release size: 41.2 kB

Release files / asrpy-0.0.8.tar.gz

Download URL asrpy-0.0.8.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9b7a2a5adf73c18e07f4af537ea338e38ef715223259a3f510b605264a6c1969
BLAKE2b-256 checksum
How to use checksums
fdf6cbf2949b2cf1fe3a99c43c7072ab18ff995f7a65992df5c7f25e862b55c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / asrpy-0.0.8-py3-none-any.whl

Download URL asrpy-0.0.8-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0acf5f0c00513cfba60c38d5823424bcad3035f3ddee0c1272b638d4ed20384
BLAKE2b-256 checksum
How to use checksums
3ed2979a4fc283e80ae83e225ee9fa4e2bb22b911555d46db143749502a2a8fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Security for asrpy 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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