Skip to main content

Librería modular para adquisición y procesamiento EEG de UHB

Project description

EEG_UHB

Library for Electroencephalography (EEG) signal acquisition and processing using Unicorn Hybrid Black (UHB) commercial equipment using Lab Streaming Layer (LSL).

Install

You can install the library directly from PyPI using pip:

pip install eeg-uhb

Installation from GitHub (optional)

If you want to install the latest version directly from the repository, run:

pip install git+https://github.com/IngAmaury/EEG_UHB_LIBRARY.git

Installation in a Python virtual environment

  1. Open a terminal or Anaconda Prompt.
  2. Create a new virtual environment (for example: myenv):
python -m venv myenv
  • Using Anaconda Prompt:
conda create --name myenv
  1. Enable the virtual environment:
  • Windows:
myenv\Scripts\activate
  • Anaconda Prompt:
conda activate myenv
  • macOS/Linux:
source myenv/bin/activate
  1. Install the library inside the virtual environment:
pip install eeg-uhb

[!NOTE] It is recommended to install in a virtual environment to avoid conflicts with other system libraries.

Dependencies

The library requires the following dependencies, which will be installed automatically with pip:

  • numpy
  • pylsl
  • scipy
  • scikit-fuzzy

[!IMPORTANT] If you want to make the acquisition with Unicorn Hybrid Black you need to install Unicorn Suite Hybrid Black, You can also watch their video tutorial. Within the application, you will need to install the Unicorn Recorder from the Apps section or the Unicorn LSL from the DevTools section.

Use

If you are acquiring through the Unicorn LSL Interface, see the image below, you can use the example code below the image, you must put in the start_adquisition function in the stream_name attribute the same name that you put in the “Streamname” box inside the LSL settings of the Unicorn LSL.

[!TIP] If you have never used the Unicorn LSL Interface before, we recommend that you read its user documentation.

Unicorn Hybrid Black acquisition tool using LSL protocol

from eeg_uhb import EEGAcquisitionManager
import time

if __name__=='__main__':
    EEG = EEGAcquisitionManager()
    start_time = time.time()
    duration = 0.04  # segundos

    '''
    # Connect to any available stream without saving
    eeg.start_acquisition(stream_name='UN-2023.07.40')  

    # Connect to specific stream and save data
    eeg.start_acquisition(stream_name='UN-2023.07.40', 
                        save=True,
                        save_path='./eeg_data/')
    '''
    
    # the stream_name depends on the one you choose
    EEG.start_acquisition(stream_name='UN-2023.07.40', save=True)
    start = time.sleep(duration)
    print(EEG.data)
    print(f'Length: {len(EEG.data)}')
    EEG.stop_acquisition()

If you are acquiring through the Unicorn Recorder App, see the image below, you can use the example code below the image, you must not put anything in start_acquisition in the stream_name attribute as the app assigns one internally, the other attributes can be used as normal.

Unicorn Recorder App acquisition tool

from eeg_uhb import EEGAcquisitionManager
import time

if __name__=='__main__':
    EEG = EEGAcquisitionManager()
    start_time = time.time()
    duration = 0.04  # segundos

    '''
    # Connect stream and save data
    eeg.start_acquisition(save=True, save_path='./eeg_data/')
    '''
    
    # the stream_name depends on the one you choose
    EEG.start_acquisition()
    start = time.sleep(duration)
    print(EEG.data)
    print(f'Length: {len(EEG.data)}')
    EEG.stop_acquisition()

License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eeg_uhb-0.1.3.tar.gz (39.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eeg_uhb-0.1.3-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file eeg_uhb-0.1.3.tar.gz.

File metadata

  • Download URL: eeg_uhb-0.1.3.tar.gz
  • Upload date:
  • Size: 39.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for eeg_uhb-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fbee610964c7f6becc47594de125ce30b7a97d0422bd10a0ee74d494fe6e3265
MD5 b6a34237768ccf53bcabefed389a6eb9
BLAKE2b-256 7fc2857e9c03c77d4db4351179da527c3b81b6fe7a5aab3fe8fcec4c232e9cf1

See more details on using hashes here.

File details

Details for the file eeg_uhb-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: eeg_uhb-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for eeg_uhb-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7de86bac70fbdfd8fea51d6a28d3cc9ce32f8d2436075687e9bd6603f1bdf15d
MD5 0f90b828924d0a52da5de99d7a875be0
BLAKE2b-256 e8f4bb5e149ef80d3da4c80f0889ddb47ea85acc284722ed1213676012da01dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page