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.4.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.4-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eeg_uhb-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 1e8eadcb4491c72636ffc86807929dc1499bd15fec7b74b15111f00d5e390c90
MD5 c72820963779561f39e8346358a3bebe
BLAKE2b-256 832e95f370b635dcb5fdcec28928cc8e9859b732d1577d75ecddcec9680924f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eeg_uhb-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 36.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4b9151dddf93df84a741b59becdcff9af804969f5423fbfaf2553b7262e009b7
MD5 613377d2c7f98c2b4a1af591c873067c
BLAKE2b-256 fbbfb19b8f87b30d26524b84b4118c7c00e904cd511b7db49a41b90d5285281c

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