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
- Open a terminal or Anaconda Prompt.
- Create a new virtual environment (for example: myenv):
python -m venv myenv
- Using Anaconda Prompt:
conda create --name myenv
- Enable the virtual environment:
- Windows:
myenv\Scripts\activate
- Anaconda Prompt:
conda activate myenv
- macOS/Linux:
source myenv/bin/activate
- 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.
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.
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
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 eeg_uhb-0.1.2.tar.gz.
File metadata
- Download URL: eeg_uhb-0.1.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
724547e7581954daad20334a46af0312e5cd03afc68d712625f284889eac7a77
|
|
| MD5 |
ddae42591e915ac85f432670bc7f3c1e
|
|
| BLAKE2b-256 |
306e8da44fbfa6f5568c67e6b92febc31c81d68d517bc1d0ef7d151815834c06
|
File details
Details for the file eeg_uhb-0.1.2-py3-none-any.whl.
File metadata
- Download URL: eeg_uhb-0.1.2-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
632ca02cbf68bf66f6b66835b4acddb59b1fce2a7bf239068a60f9b0ba7a09e7
|
|
| MD5 |
5d00cedcd57ab0731f52af83fd7f2945
|
|
| BLAKE2b-256 |
43998f7b299237685ec53c3b00a389899882f1e9f91bdb5cb4d02dec7a0e385f
|