Library for live and offline denoising of multi-channel EEG data powered by auto-encoders, created by Synaptrix Labs Inc.
Project description
Synaptrix
A library for live and offline denoising of multi-channel EEG data powered by auto-encoders, created by Synaptrix Labs Inc. This README covers how to prepare LabStreamingLayer (LSL) for your platform, and how to install and initialize the SynaptrixClient.
Table of Contents
Overview
Synaptrix provides a convenient Python API for EEG denoising using your own model or pre-trained models. It also integrates with LabStreamingLayer (LSL) for real-time data acquisition. To use LSL functionality, you must first install the native LSL libraries on your system (see Prerequisites).
Prerequisites
Install LSL on macOS
- Ensure you have Homebrew installed.
- Run:
brew install labstreaminglayer/tap/lsl
This installs the native LSL libraries that pylsl depends on.
Install LSL on Windows
- Visit the official LSL Windows Installation Docs
- Download the appropriate installer/zip.
- Follow instructions to install the .dlls so that pylsl can detect them.
Install LSL on Linux
- Ubuntu/Debian (example):
sudo apt-get update sudo apt-get install cmake build-essential git clone https://github.com/sccn/labstreaminglayer.git cd labstreaminglayer/LSL # Then follow build instructions from the official docs
Installation
After installing the native LSL libraries for your platform, you can install Synaptrix:
pip install synaptrix
Usage
Initialize SynaptrixClient
from synaptrix import SynaptrixClient
import pandas as pd
# Initialize the client
client = SynaptrixClient(
API_KEY="YourAPIKey"
)
After initializing the client, you can then access all the functions of synaptrix.
Here is an example of how you can denoise a csv file called data.csv containing 4 channels of eeg data and output as a df:
data_in = pd.read_csv("data.csv")
denoised = client.denoise_batch(data_in, num_channels=4, output_format="df")
print("Denoised Data: ", denoised)
# output_format can be adjusted to "array", "list", "df, or "csv"
Here is an example of how you can generate a plot of the denoised data:
data_in = pd.read_csv("data.csv)
client.plot_denoised(data_in, num_channels=4, initial_window_sec=1)
# initial_window_sec dictates how wide is the sliding viewing window
Here is an exmaple of how to stream data through lsl into synaptrix and output denoised data:
lsl_output = client.lsl_denoise(
stream_duration = 10, # in seconds, change parameter to 0 for indefinite streaming
num_channels = 4,
sample_rate = 512, # adjust to match sampling rate of your device
output_format = "csv",
file_name = "lsl_test.csv"
# at the conclusion of the stream, all denoised data will be saved to this file
)
License
This project is licensed under the Apache 2.0 license. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synaptrix-1.0.1.tar.gz.
File metadata
- Download URL: synaptrix-1.0.1.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9b4948d7d4892a98e27f9e614437c24439509a051933730563d2e4dc95144bb
|
|
| MD5 |
5140e7931243698addc93dacb84b89d0
|
|
| BLAKE2b-256 |
6a3ed517b18ed1a7eb7bc6ab99dfbaf1e71d57a4c40bbe59af27a98c4b8930fd
|
File details
Details for the file synaptrix-1.0.1-py3-none-any.whl.
File metadata
- Download URL: synaptrix-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b63c125f9ff43fb67b4b55cbd1a27c48a9ed8b911594568c4bbce04eda51dc2
|
|
| MD5 |
b77ea2d2b4ca9eecc3b09b8650226852
|
|
| BLAKE2b-256 |
58c73f0cec9ca31bae4aca5a557ad9d3393cf3cba8c502caa6d5287f12b80ce3
|