Skip to content
forked from DiGyt/asrpy

Artifact Subspace Reconstruction for Python

License

Notifications You must be signed in to change notification settings

brainamics/asrpy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASRpy

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

Currently, the way to install the package is:

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

Please refer to the ASRpy function Docstrings for documentation. In most Python IDEs, you can read them by e.g. typing asrpy.ASR?

The following functions/objects are available.

Main API:

asrpy.ASR
asrpy.ASR.fit
asrpy.ASR.transform

MATLAB-like functions (similar to EEGLab's clean_rawdata).

asrpy.asr_calibrate
asrpy.asr_process

Helper functions.

asrpy.clean_windows

About

Artifact Subspace Reconstruction for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 73.5%
  • Python 26.5%