NeuronLab is a secure, multiplatform, and web-based framework that provides a working environment to researchers where every phase of the BCI lifecycle (acquisition, preprocessing, features extraction, and classification) can be performed. Additionally, it defines sophisticated tools to study the EEG signals.
- Node.js >= v18.14.2.
- Visual Studio to install dependencies.
- Clone the repo.
git clone https://github.com/JuananMtez/NeuronLab.git
- Change to project directory.
cd NeuronLab/NeuronLab-GUI
-
Install Visual Studio.
-
Install NPM packages.
npm install
- Modify properties in
./src/properties.js
.
export const properties = {
url_server: 'TO BE DEFINED',
port: 'TO BE DEFINED',
protocol: 'TO BE DEFINED'
};
parameter | Description |
---|---|
url_server | Domain where NeuronLab-Backend is deployed |
port | Port where NeuronLab-Backend is deployed |
protocol | Protocol (https or http) |
Run NeuronLab-GUI in the development mode.
npm run electron-dev
Nowadays, NeuronLab only can acquire Electroencephalogram (EEG) signal by using Lab Streaming Layer (LSL) protocol, as well as, UDP to capture stimuli generated by other applications. The receviced UDP packages must have the following format:
{
timestamp: float,
stimulus: [int]
}
To avoid timestamps errors, they must be generated by the function local_clock()
provided by LSL library. An example of code written in Python:
import socket
import json
import time
from pylsl import local_clock
server_ip = '127.0.0.1'
server_port = 5005
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while True:
data = {
"timestamp": local_clock(),
"stimulus": [1],
}
sock.sendto(json.dumps(data).encode('utf-8'), (server_ip, server_port))
time.sleep(1)
- Python 3.8.
- MySQL
- Clone the repo.
git clone https://github.com/JuananMtez/NeuronLab.git
- Change to project directory.
cd Neuronlab/NeuronLab-Backend
- Install dependencies.
pip install -r requirements.txt
-
Create database in MySQL.
-
Modify properties in
./app/config/properties.ini
.
[DATABASE]
user = TO BE DEFINED
password = TO BE DEFINED
host = TO BE DEFINED
database = TO BE DEFINED
[SECURITY]
secret_key = TO BE DEFINED
algorithm = TO BE DEFINED
access_token_expire_minute = TO BE DEFINED
parameter | Description |
---|---|
user | MySQL user |
password | MySQL password |
host | MySQL host |
database | MySQL database |
secret_key | Key used to sign the JWT tokens |
algorithm | Algorithm used to sign the JWT token |
access_token_expire_minute | Token lifetime in minutes |
Run NeuronLab-Backend.
python3 -m uvicorn app.main:app
The tables will be created in the database automatically.
This project is licensed under the MIT License - see the LICENSE file for details