Skip to content

rkmtlab/OpenRBSync

Repository files navigation

OpenRBSync

A toolkit to collect physiological data from two remote devices, save it to a csv file with synchronized timestamps, send it to a server, and visualize its time-windowed raw data/its synchronicity.

Getting Started

Prerequisits

Sensors

Our current version only supports BITalino (eeg, ecg, eda, emg) as a sensor to use. We plan to increase the options of sensors in the near future.

Software

BITalino needs OpenSignals, an official software to acquire signals from BITalino via Bluetooth. Please install this software beforehand.

OpenRBSync uses ngrok for tunneling. Please download following here.

Installation

Run the following command and install OpenRBSync.

git clone https://github.com/rkmtlab/OpenRBSync.git

Running the program

Running a server

In a server PC, run server.py.

cd OpenRBSync
python server.py
  • In a GUI dialog, set appropriate parameters.
    • Signals to receive from clients
    • Port number to serve
    • A Visualization method
    • An analysis method
  • Default parameters are set for port number and cross recurrence quantification analysis, but you can change them as you want.

Image from Gyazo

  • Open another terminal window, and run ngrok command.
ngrok http [port number you set in the gui dialog (default is 3030)]
  • Ngrok window will be showed up, so copy the link displayed. You should not close this ngrok window by the end of the data acquisition.

Image from Gyazo

Running a client

In each client PC, open OpenSignals and set up your BITalino.

  • Open System preferences of your computer, go to Bluetooth preference and connect your BITalino device via Bluetooth.

  • Launch OpenSignals, find your BITalino device, and enable it.

Image from Gyazo

  • Click on the box and configure parameters.

Image from Gyazo

  • Click on the setting icon, go to the INTEGRATION tab, and enable Lab Streaming Layer.

Image from Gyazo

  • Click the red button and start data acquisition.

Then, open terminal on your computer and run client.py.

python client.py
  • In a GUI dialog, set appropriate parameters.
    • MAC address of your BITalino device you have selected on OpenSignals. (Written in the back side of the device / OpenSignals)
    • Signal types to send
    • Host link you get by ngrok command on your server computer (Copy it from the row of Forwarding as shown in Running a server section.)

Image from Gyazo

Quitting programs

When you quit running programs, follow this order:

  1. Quit client.py and client2.py by entering ^C in the terminal window
  2. Click on the x button of the plotting window
  3. Quit server.py by entering ^C in the terminal window

Image from Gyazo

System configurations

server.py

Receive data from clients and visualize signals.

visualize options

  1. Raw signal plot

Image from Gyazo

  1. Bar graph of synchronicity
  • Calculate cross correlations of the past 500 signals and display the maximum correlation among time shifted correlations (multiplied by a hundred).
  • Conduct Cross Recurrence Quantification Analysis and display recurrence rate multiplied by a hundred. Determinism is also saved in a csv file.

Image from Gyazo

client.py / client2.py

Receive data from sensors and send it to the server.

sensor options

  1. bitalino (eeg, ecg, eda, emg)

Authors

Yuna Watanabe, Kotaro Omori (The University of Tokyo)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published