Sense Record
A cross-platform application for saving data streams from biosensor hardware using the BrainFlow Python API.
Sense Record is designed for a research lab setting, where the user (experimenter, study staff) needs to ensure that the raw file stream is being saved and that the file is saved along with information about the experimental session/task/run/participant.
Sense Record saves biosensor recordings using file naming conventions compliant with the Brain Imaging Data Structure (BIDS). The user is prompted to enter the subject/participant, session, task, and run information before starting any recording. This data is then used by Sense Record to generate the output file name and sub directory names, along with BIDS-spec metadata files that it saves with each recording.
Status
Sense Record is pre-alpha, in development, unstable. Use accordingly, at your own risk.
Supported hardware
| Manufacturer | Senserecord config name |
|---|---|
| OpenBCI | CYTON_BOARD |
| OpenBCI | GANGLION_BOARD |
| OpenBCI | CYTON_DAISY_BOARD |
| OpenBCI | GALEA_BOARD |
| OpenBCI | GANGLION_WIFI_BOARD |
| OpenBCI | CYTON_WIFI_BOARD |
| OpenBCI | CYTON_DAISY_WIFI_BOARD |
| Brainbit | BRAINBIT_BOARD |
| g.tec | UNICORN_BOARD |
| Callibri | CALLIBRI_EEG_BOARD |
| Callibri | CALLIBRI_EMG_BOARD |
| Callibri | CALLIBRI_ECG_BOARD |
| MIT | FASCIA_BOARD |
| Neurosity | NOTION_OSC_BOARD |
| I_Ron-BCI | IRONBCI_BOARD |
| Crowd Supply | FREEEEG32_BOARD |
Installation
Invoke pip as appropriate in your environment to do:
pip install senserecord
Usage
Sense Record provides three types of interfaces for recording biosensor data with BrainFlow: a GUI desktop app, a command-line interface, and a REST web services API.
To launch the GUI desktop app:
senserecord-gui
To launch the CLI console app:
senserecord
To launch the local http server and web app with REST API:
senserecord-http
Learn more about each of these interfaces in the sections below.
GUI Desktop Application
The GUI provides controls for starting and stopping recordings. It prompts you for run information (BIDS fields) at the start of each recording run.
- Launch the GUI by running the command:
senserecord-gui - In the menu bar, select File > Load configuration file and load your
.ymlfile. Use the example configuration files in/examplesto create your config file. - Press the "Start Recording" button. A dialog will appear, prompting you to enter information (BIDS fields) about your recording.
- Record until your task/run is finished.
- Press the "Stop Recording" button.
- Find your recording's raw data file in
[bidsroot]/sourcedata/sub-[subject]/ses-[session]/[data_type]/*.csv
CLI Application
Sense Record comes with an interactive command-line interface.
Type senserecord with no arguments and it shows you help text.
Type senserecord start with no arguments and you are prompted for input, like this:
Enter your board name: SYNTHETIC_BOARD
Enter the path to the root directory of your project: ./
Subject name/ID: 001
Session name: testSession
Task name: myExperiment
Run number: 001
Data type. Choices: eeg, ecg,: eeg
Now recording from SYNTHETIC_BOARD
Stop the recording? [y/N]: n
Stop the recording? [y/N]: y
Stopped recording from SYNTHETIC_BOARD
This example run created a test directory sourcedata/sub-001/ses-testSession/eeg with a data file inside named sub-001_ses-testSession_task-myExperiment_run-001_eeg.csv.
You can also bypass the prompts with command-line arguments, like this example:
:$ senserecord start --board-name SYNTHETIC_BOARD --serial-port /dev/ttyUSB0 --bidsroot /home/myuser/my_experiment_dir --sub 001 --ses mySession --task myTask --run 001 --data-type eeg
Type senserecord start --help to see available options.
REST Web Services API
You can control recordings over http using the built-in REST web services API. Start the REST server with:
senserecord-http
This will launch the server process and try to open the http endpoint in your browser at http://127.0.0.1:8000. Visit that URL and you get interactive HTML documentation that allows you to start and stop recordings from your browser. You can also use it to build URLs like the one used in the example below.
Example usage of the REST API
Recordings can be started with a GET request, with parameters in the query string of the URL.
Visit this example URL and it will start recording from SYNTHETIC_BOARD:
http://127.0.0.1:8000/start/SYNTHETIC_BOARD?bidsroot=%2Fhome%2Flink%2FDownloads&serial_port=%2Fdev%2FttyUSB0&sub=001&ses=default&task=default&run=001&data_type=eeg&modality=eeg
It returns a simple JSON response that looks something like this:
{
"status": "ok",
"result": {
"board": {
"name": "SYNTHETIC_BOARD",
"is_ready": false,
"is_recording": true
}
},
"details": []
Don't forget to stop the recording! You can do that by visiting this URL:
http://127.0.0.1:8000/stop/SYNTHETIC_BOARD
When the recording stops, the API returns this JSON response smth like:
{
"status": "ok",
"result": {
"board": {
"name": "SYNTHETIC_BOARD",
"is_ready": true,
"is_recording": false
}
},
"details": []
}
License
GPL-3.0-or-later
Contact
Link Swanson (link@swanson.link)
Metadata
Release files for senserecord 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| senserecord-0.1.4.tar.gz | 637.8 kB | Without provenance | Details for senserecord-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| senserecord-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for senserecord-0.1.4-py3-none-any.whl |
Total release size: 1.3 MB
Release files / senserecord-0.1.4.tar.gz
| Download URL | senserecord-0.1.4.tar.gz |
|---|---|
| Size | 637.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69ece45eb9918a330d317ad6b3e15f08795ac5e5d6c8356b3155897421e6dc94
|
|
BLAKE2b-256 checksum How to use checksums |
9b3d70c3e4c7368df7a7b0765d3eb6d79cf64594731db02762a5d3604eb56f0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.7.3 Linux/4.19.0-13-amd64
|
Release files / senserecord-0.1.4-py3-none-any.whl
| Download URL | senserecord-0.1.4-py3-none-any.whl |
|---|---|
| Size | 652.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
886270c2efc0298bb7aa7f9a42892ad37bf259a326d2093ceb53cc86af8dc7d8
|
|
BLAKE2b-256 checksum How to use checksums |
447d4db059757d3abc92e33be4f58d819e90184e35e91692f0d3d7cce21822ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.7.3 Linux/4.19.0-13-amd64
|
Security for senserecord 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.