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()

Upgrade or uninstall

Already had an older version of the library, you can updated to the latest version with the code:

pip install --upgrade eeg-uhb

If you no longer wish to have the library installed, activate the virtual environment where you installed it and run it:

pip uninstall eeg-uhb -y

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.5.tar.gz (39.8 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.5-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for eeg_uhb-0.1.5.tar.gz
Algorithm Hash digest
SHA256 2dffa33c021ca0ed7ea6b253a48bb6c86768f0625b7061cdf8fca6b4f7b43c6b
MD5 f6f8a7d2503d9a83e9ebe206fb32f210
BLAKE2b-256 59e585ebcd6b3fc1906e3e82b191c9aac85aa059937da950c4d079aee9953dd2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eeg_uhb-0.1.5-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.10.11

File hashes

Hashes for eeg_uhb-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 51aa86432ae80ee0127e5202cd02458deb19226c69112870d8ff781c80ce9528
MD5 892b38b2c7058012280710b2c4039ced
BLAKE2b-256 2ba5f645b4573de0f9686dd1b1eae2f172ed424f9716bdfb83eb80ca680a5a48

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