Code for uni- and dual-directional visual motion based BCI spellers, as described in the original paper: Doubling the speed of N200 speller by dual-directional motion Encoding. Note that the original code is in the release Version 0.1.1.
This repository requires python3.6 and Windows platform. If you have Conda:
conda create -n py36 python=3.6
Activate the virtual env and install the dependencies from PyPI:
conda activate py36
pip3 install -r requirements.txt
To test the Psychopy setup, run OnlineSystem.py with the debug config ./tests/test_stimulator.yml.
python3 OnlineSystem.py --cfg ./tests/test_stimulator.yml
To reproduce the major results reported in the paper, download the data from this link, decompress and put it under the data directory. Then simply run the notebook figs_offline.ipynb.
If you would like to run your own online experiments, you could either use NeusanW (Neuracle Inc.) with the interface provided by us or implement your own interface (including online data transmission and offline data loader) following the instructions in Online/README.md.
- Setup the hardware.
- Write a config file for your subject referring to the examples in config/.
- Run OnlineSystem.py to collect training data. (Note that the script do not collect data, so keep it in mind to record manually.)
python3 OnlineSystem.py --cfg your/config/file
- Copy the data to the just generated path "./data/(subject)/(YY-MM-DD-HH-MM-SS)".
- Run training.py to train the model.
python3 training.py --cfg your/config/file
- Run OnlineSystem.py again for online experiments.
python3 OnlineSystem.py --cfg your/config/file -t -d YY-MM-DD-HH-MM-SS # -d takes the time of offline data with the form "YY-MM-DD-HH-MM-SS" # as the input.
Note: After running the OnlineSystem.py, press "S" to start and "Q" to quit the process.
If you have a question or feedback, or find any problems, you can contact us by email or open an issue on GitHub.