Skip to main content

Read the Docs PyPI - Version Conda Version PyPI - Python Version GitHub License

GitHub Actions Workflow Release Status GitHub Actions Workflow Testing Status GitHub Actions Workflow Ruff Status GitHub Actions Workflow Yapf Status GitHub Actions Workflow Codespell Status GitHub Actions Workflow Isort Status

This module is meant to be used as a tool for EEG signal analysis based on graph signal analysis methods. The development of this toolbox takes place in GitHub.

EEGraSP package uses other libraries like PyGSP2 and mne for most of the processing and graph signal analysis.

Installation with pip (User Installation)

The EEGraSP is available on PyPI:

$ pip install eegrasp

Installation with conda (User Installation)

The EEGraSP is available on Conda Forge:

$ conda install conda-forge::eegrasp

Installation from source (User Installation)

  1. Clone the EEGraSP repository into a local directory with git: git clone https://github.com/gsp-eeg/eegrasp

  2. Change the current directory to the directory of the downloaded repository. cd eegrasp

  3. Install the cloned repository in your preferred Python environment through git. Use: pip install -e ..

Now you are ready to contribute!

Usage

Examples are provided in the examples folder of the repository:

  • The electrode_distance.py script computes the electrode distance from the standard biosemi64 montage provided in the MNE package.

  • The ERP_reconstruction.py script computes an example ERP from a database provided by MNE. Then, one of the channels is eliminated and reconstructed through Tikhonov Regression.

Basic steps for the package ussage are:

  1. Load the Package

>>> from EEGraSP.eegrasp import EEGraSP
  1. Initialize the EEGraSP class instance.

>>> eegsp = EEGraSP(data, eeg_pos, ch_names)

Where: data is a 2-dimensional numpy array with first dimension being channels and second dimension being the samples of the data. The missing channel should be included with np.nan as each sample. eeg_pos is a 2-dimensional numpy array with the position of the electrodes. This can be obtained through the MNE library. See examples for more information about how to do this. ch_names is a list of names for each channel.

  1. Compute the graph based on the electrodes distance. The parameters used to compute the graph need to be provided or estimated. In this case we will provide the parameters epsilon and sigma. To see how to find the best parameter for your data see ERP_reconstruction.py in the examples folder.

>>> distances = eegsp.compute_distance()
>>> graph_weights = eegsp.compute_graph(epsilon=0.5,sigma=0.1)
  1. Interpolate the missing channel.

>>> MISSING_IDX = 5
>>> interpolated = egsp.interpolate_channel(missing_idx=MISSING_IDX)

To interpolate a channel of your choice the MISSING_IDX variable should be changed to the index of the corresponding channel. Remember that python indices start from 0.

License

MIT licence

Project status

Still in development.

Acknowledgments

EEGraSP has been partly funded by FONDECYT REGULAR 1231132 grant, ANILLO ACT210053, and BASAL FB0008 grant.

Metadata

Release files for EEGraSP 0.0.5

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

Source distribution (sdist)

Source distribution for EEGraSP 0.0.5
File Size Uploaded Provenance Actions
eegrasp-0.0.5.tar.gz 34.2 kB Without provenance Details for eegrasp-0.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 57.0 kB

Release files / eegrasp-0.0.5.tar.gz

Download URL eegrasp-0.0.5.tar.gz
Size 34.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8392aa69495c65060423ff783136644ad9d85b8936be9c82b54bb79c67b35dc1
BLAKE2b-256 checksum
How to use checksums
ac9be93ca2af932b6e63a9ba4b2c3f38f056579aec7e976edeb6bc8ed95b3a59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / eegrasp-0.0.5-py3-none-any.whl

Download URL eegrasp-0.0.5-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
732c36668f1fc72a6b5655168e4e1e4c0b6a6bf5719a944e725980788c9ce165
BLAKE2b-256 checksum
How to use checksums
18b9d7ee3b15cad0264a2c4f495354dae8a76f530271b758b73001e0111c02a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for EEGraSP 0.0.5

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.

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files No provenance

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