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.6.tar.gz (39.9 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.6-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eeg_uhb-0.1.6.tar.gz
  • Upload date:
  • Size: 39.9 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.6.tar.gz
Algorithm Hash digest
SHA256 20098578c662284267cfa1e93c53ededdd0d52b3ccb3e39c6ef309a6ecdf2d65
MD5 4d049fb3527189d0fa5a805083f75778
BLAKE2b-256 c99941c993d1879a6bd0f8e6f3d2b4a973eb73bb9b50021fab9e5bb811a3266a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eeg_uhb-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 36.8 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 11c1c4bc56d46d9a45e40121b4cfb93cae91991d53d55a16bb4ebd1397065b54
MD5 7d922884f2e5b4f59cd7119258fc3e69
BLAKE2b-256 f5f5779301b0d3e30859a0137840cd005f4e84b771181861bcda0327db9dfe8f

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