Skip to content

Commit

Permalink
Document
Browse files Browse the repository at this point in the history
  • Loading branch information
arnevdk committed Nov 8, 2023
1 parent a387fa2 commit 9808d26
Showing 8 changed files with 69 additions and 16 deletions.
1 change: 1 addition & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -10,4 +10,5 @@ WORKDIR /project
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY ./brainbrowsr .
RUN chmod +x run.sh
CMD ./run.sh
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,18 +5,33 @@ for the acquisition and real-time processing of biosignals.

## Installation

Make sure you have [docker](https://docs.docker.com/engine/install/) (or [podman](https://podman.io/docs/installation)) installed.

## Usage
```
podman run --net=host -e DATA_SOURCE=simulated -p 8000:8000 -p 8001:8001 --privileged -it localhost/timeflux-workshop:latest
```

### To run timeflux

Running timeflux with simulated data:
```sh
docker run --net=host -e DATA_SOURCE=simulated --publish-all --privileged -it localhost/timeflux-workshop:latest
```

Running an LSL server connected to the Mentalab headset and running timeflux
```
podman run --net=host -e DATA_SOURCE=lsl -e MENTALAB_NAME=Explore_8559 -p 8000:8000 -p 8001:8001 --privileged -it localhost/timeflux-workshop:latest
podman run --net=host -e DATA_SOURCE=lsl -e MENTALAB_NAME=<MENTALAB_NAME> --publish-all --privileged -it localhost/timeflux-workshop:latest
```

### To open the BrainBrowsR example

Launch the Google Chrome/Chromium web browser with the following
command-line options
```
chromium-browser --disable-web-security --disable-features=IsolateOrigins,site-per-process --disable-site-isolation-trials --user-data-dir=<TEMP_DATA_DIR>
```
to allow controlling the Facebook iframe from whithin our JS app.

The BrainBrowsr interface can be found at http://localhost:8000/brainbrowsr/,
The monitoring example at http://localhost:8001/monitor/

## Useful resources

@@ -27,10 +42,4 @@ podman run --net=host -e DATA_SOURCE=lsl -e MENTALAB_NAME=Explore_8559 -p 8000:8
whitepaper](https://timeflux.io/assets/pdf/Timeflux_GBCIC2019.pdf)
- [Timeflux BCI](https://github.com/timeflux/timeflux_bci)
implementations of the classical BCI paradigms:

## To run the BrainBrowsR example

Launch the Google Chrome/Chromium web browser with the following
command-line options
`chromium-browser --disable-web-security --disable-features=IsolateOrigins,site-per-process --disable-site-isolation-trials --user-data-dir=<TEMP_DATA_DIR>`
to allow controlling the Facebook iframe from whithin our JS app.
- [Labstreaming layer](https://labstreaminglayer.org/#/)
Binary file modified brainbrowsr/brainbrowsr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 29 additions & 3 deletions brainbrowsr/graphs/monitor.yml
Original file line number Diff line number Diff line change
@@ -10,11 +10,29 @@ graphs:
- raw_eeg
- events

# Powerline notch filter
#- id: notch
# module: timeflux_dsp.nodes.filters
# class: IIRLineFilter
# params:
# edges_center: [50]
# orders: [2]
# edges_width: [3]
# Band pass filter the signal
- id: notch
module: timeflux_dsp.nodes.filters
class: IIRFilter
params:
order: 4
frequencies: [49, 51]
filter_type: 'bandstop'

# Band pass filter the signal
- id: bandpass
module: timeflux_dsp.nodes.filters
class: IIRFilter
params:
order: 4
frequencies: [1, 30]
filter_type: 'bandpass'

@@ -23,13 +41,13 @@ graphs:
module: timeflux.nodes.window
class: Window
params:
length: 1.5
step: 0.5
length: 2

# Compute the power spectral density
- id: psd
module: timeflux_dsp.nodes.spectral
class: Welch

- id: freq_bands
module: timeflux_dsp.nodes.spectral
class: Bands
@@ -70,19 +88,27 @@ graphs:
class: UI
params:
port: 8001
settings:
monitor:
minValue: -200
maxValue: 200

edges:
- source: sub:raw_eeg
target: ui:raw_eeg
- source: sub:events
target: ui:events

- source: sub:raw_eeg
target: notch
- source: notch
target: bandpass
- source: bandpass
target: ui:processed_eeg


- source: sub:raw_eeg

- source: bandpass
target: rolling_window
- source: rolling_window
target: psd
2 changes: 2 additions & 0 deletions brainbrowsr/graphs/record.yml
Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@ graphs:
params:
prop: name
value: {{ MENTALAB_NAME }}_ExG
channels: ["1","2","3","4","5","6","7","8"]
dejitter: True

- id: pub
module: timeflux.nodes.zmq
3 changes: 2 additions & 1 deletion brainbrowsr/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/bash
if [[ $DATA_SOURCE == "lsl" ]]; then
explorepy push2lsl -n $MENTALAB_NAME &
#explorepy visualize -n $MENTALAB_NAME &
fi
timeflux -d brainbrowsr.yml
timeflux brainbrowsr.yml
15 changes: 14 additions & 1 deletion brainbrowsr/ui/assets/css/style.css
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ body {
}

.stim {
width: 10vw;
width: 20vw;
height: auto;
position: absolute;
animation-name: flashAnimation;
@@ -69,6 +69,7 @@ body {
}
*/
@keyframes flashAnimation{
/*
0% {
opacity: 0;
}
@@ -78,6 +79,18 @@ body {
100% {
opacity 0;
}
*/
0% {
filter: invert(0%);
}
50% {
filter: invert(100%);
}
100% {
filter: invert(0%);
}



}

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
timeflux
timeflux_ui
timeflux_dsp
timeflux_rasr
graphviz

#Decoding

0 comments on commit 9808d26

Please sign in to comment.