You must be running one of these Lab Streaming Layer (LSL) applications. This process assumes that you are running Bluemuse, but two alternatives are also suggested:
| App | OS | Download | LSL | Recording | Paywall | Notes |
|---|---|---|---|---|---|---|
| BluseMuse | Windows | Github | ☑️ | ❌ | ❌ | No in-built recording |
| Petal Metrics | Windows, OS X, Linux | Website, Free Ver.$^1$ (Windows, Linux only) | ☑️ | ☑️ | 💵 | Stops recording when signals are interrupted |
| Mind Monitor | iOS, Android | Website | 🤷$^2$ | ☑️ | 💵 | Timestamps are packaged and lossy |
1: Version 1.8.0 of the software has been cached prior to the developers paywalling their application. I've only managed to cache the Windows and Linux versions; I unfortunately no longer have access to the OS X version. 2: I haven't explored this possibility yet. The Mind Monitor application implies to allow streaming to a specific IP address and port, but preliminary exploration did not give me a chance to access this IP from another device on the same network.
The easiest way to download this repo is to download the source code of our latest release.
Alternatively, you can simply clone the repository via Git commands. This allows you to pull updates when needed. Just be sure to keep an eye out when we update new releases.
# HTTPS
https://github.com/SimpleDevs-Tools/RecordMuse.git
# SSH
git clone git@github.com:SimpleDevs-Tools/RecordMuse.gitAll dependencies are provided in requirements.txt. It's safest to set up a virtual Python environment first. This has been tested in Python 3.11.
# Virtual environment `.venv` setup (Windows)
py -m venv .venv
.venv/Scripts/activate
# Virtual environment `.venv` setup (Mac / Linux)
python -m venv .venv
source .venv/bin/activate
# Installing dependencies via pip
pip install -r requirements.txt
# Do your thing
# <run commands here>
# Or run the Streamlit app to have a visual interface
streamlit run app.py
# Closing the virtual environment
deactivateIf you attempt to activate your virtual environment and you get an error, then you need to double-check that you have execution policy permissions allowed.
Firstly, open up a PowerShell window in Administrator Mode. Then, double-check the output of this command. You are likely to see the following:
# Run this Command
Get-ExecutionPolicy -List
# Likely Output
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined # <-- This should be "RemoteSigned", but it isn't...
LocalMachine RemoteSignedTo change this, run the following command:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserYou can double-check once more if the permission has been applied to "CurrentUser" - if so, then you're golden.
All scripts are split between different directories:
record/: contains all scripts related to demo-ing and recording EEG data.processing/: contains all scripts related to converting from Mind Monitor to BlueMuse formatting, filtering, and data normalization.analysis/: contains all scripts related to analysis, such as data validation and power spectral density (PSD) calculation.
If you prefer a user interface for easy operation, you can run this repo as a Streamlit application:
streamlit run app.pyThis interface gives you some basic controls for demo-ing, recording, converting, and processing EEG data. However, not all functions are provided. For more specific coverage, move onto Option 2.
A quick run-through of operations may look something like this:
- Record your Data
- Start your LSL streaming softare (BlueMuse or Petal Metrics)
- Check if RecordMuse properly detects which streaming presets are needed (
record/stream_info.pyandrecord/stream_presets.yaml) - Demo your EEG data streams to ensure proper alignment with the user's scalp (
record/demo.py) - Record your EEG data (
record/record.py)
- Processing your Data
- (If needed) Convert your EEG data from Mind Monitor's formatting to BlueMuse's formatting (
processing/convert.py) - Filter your EEG data via a notch filter of 60Hz to remove noise from electrical components; apply an additional butterworth filter to further restrict high-frequency noise data (
processing/filter.py) - (0If you recorded rest-state EEG) Normalize your EEG samples (
processing/normalize.py)
- (If needed) Convert your EEG data from Mind Monitor's formatting to BlueMuse's formatting (
- Analyze your Data
- Perform a Power Spectral Density calculation to identify key frequencies in your data (
analysis/psd.py) - Validate your samples (
analysis/validate.py)
- Perform a Power Spectral Density calculation to identify key frequencies in your data (
For more details on implementation specifics (e.g. command line flags, implementation details and methods), please refer to methodology.md.