Skip to content

Commit

Permalink
Develop (#267)
Browse files Browse the repository at this point in the history
* example test commit (#182)

* example test commit

* example edit

* ci: run test workflow on develop branch

* ci: add develop branch to job triggers

* ci: fix syntax issue in workflow

* fix: fixed import (brainflow updated API)

* build(deps): locked pylsl==1.10.5 (#187)

* Experiment Class Refactor (update to #183), converting specific experiments to subclasses (#184)

* First commit

* Second commit

* Modifications

* Lol

* Lol

* Incorporated N170 and p300, looking good for a PR

* ssvep update

* Implementing subclasses instead of loose functions

* fix: fixed import (brainflow updated API)

* Playing around still

* Fixing import errors

* Adding abstractmethod decorators

* Still working on the import error

* Guess what's finally working

* Comments and naming ticks

* More comments

* Live coding demonstration

* ssvep adapted

* Adapting Auditory Oddball

* changing save_fn to self.save_fun

* This maybe the last big change

* utils file changed, changes work through cli

Co-authored-by: Erik Bjäreholt <[email protected]>

* Submodule added for gsoc

* Adding pipelines for cli analysis (#202)

* started pipelines function

* almost working simple function equivalents of nb scripts

* fix: fixed import (brainflow updated API)

* sqc fixes for unicorn (#176)

* Ignore pushes

* Trying to create a cli

* Stepping through the problem

* First commit

* Fixing pause in signal quality check

* Fixing Signal quality check problem

* fix the technical debt

* Save path done for automated saving pdf

* I feel amazing

* Almost through

* Update eegnb/cli/__main__.py

Co-authored-by: Erik Bjäreholt <[email protected]>

* Trying to create cli but it's being really painful

* Extra word cli error

* Changed example handling

* Pain

* Adding whole datapath

* Finally fixed cli

* hmm

* Looking good

* added hyperlink

* Having some issues with detecting css and image deltetion

* Just the css now

* Fixed the css linking problem though it's a weird soln

* Automated running, still fnames problem

* Hahahah embedded images in html

* Improving code

* Okay now

* Look at that

* Almost there just the two figures now

* Now

* Added attrdict to do with cli error

Co-authored-by: John Griffiths <[email protected]>
Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: John Griffiths <[email protected]>

* added more options for site args; improved function names; removed some redundant lines (#209)

* fix subject num parsing bug

* analysis report function improvements for openbci cyton and gtec unicorn devices

* run exp fix

* Update requirements.txt

* fixes to get docs building by github action (#210)

* fixes to get docs building by github action

* reverted some changes

* Update 01r__ssvep_viz.py

Co-authored-by: John Griffiths <[email protected]>

* Update README.rst

small commit to test doc build workflow on this branch

* removing gsoc submodule

* ci: update python to 3.8, update wxPython, update setup-python action

* ci: pin ubuntu versions to 22.04, updated wxPython urls

* ci: bumped psychopy to 2023.1.0

* build(deps): set upper supported numpy version to 1.23.x

* chore: applied no_implicit_optional

* update dependencies - for build (#220)

* major update: merging develop to master (#217)

* example test commit (#182)

* example test commit

* example edit

* ci: run test workflow on develop branch

* ci: add develop branch to job triggers

* ci: fix syntax issue in workflow

* fix: fixed import (brainflow updated API)

* build(deps): locked pylsl==1.10.5 (#187)

* Experiment Class Refactor (update to #183), converting specific experiments to subclasses (#184)

* First commit

* Second commit

* Modifications

* Lol

* Lol

* Incorporated N170 and p300, looking good for a PR

* ssvep update

* Implementing subclasses instead of loose functions

* fix: fixed import (brainflow updated API)

* Playing around still

* Fixing import errors

* Adding abstractmethod decorators

* Still working on the import error

* Guess what's finally working

* Comments and naming ticks

* More comments

* Live coding demonstration

* ssvep adapted

* Adapting Auditory Oddball

* changing save_fn to self.save_fun

* This maybe the last big change

* utils file changed, changes work through cli

Co-authored-by: Erik Bjäreholt <[email protected]>

* Submodule added for gsoc

* Adding pipelines for cli analysis (#202)

* started pipelines function

* almost working simple function equivalents of nb scripts

* fix: fixed import (brainflow updated API)

* sqc fixes for unicorn (#176)

* Ignore pushes

* Trying to create a cli

* Stepping through the problem

* First commit

* Fixing pause in signal quality check

* Fixing Signal quality check problem

* fix the technical debt

* Save path done for automated saving pdf

* I feel amazing

* Almost through

* Update eegnb/cli/__main__.py

Co-authored-by: Erik Bjäreholt <[email protected]>

* Trying to create cli but it's being really painful

* Extra word cli error

* Changed example handling

* Pain

* Adding whole datapath

* Finally fixed cli

* hmm

* Looking good

* added hyperlink

* Having some issues with detecting css and image deltetion

* Just the css now

* Fixed the css linking problem though it's a weird soln

* Automated running, still fnames problem

* Hahahah embedded images in html

* Improving code

* Okay now

* Look at that

* Almost there just the two figures now

* Now

* Added attrdict to do with cli error

Co-authored-by: John Griffiths <[email protected]>
Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: John Griffiths <[email protected]>

* added more options for site args; improved function names; removed some redundant lines (#209)

* fix subject num parsing bug

* analysis report function improvements for openbci cyton and gtec unicorn devices

* run exp fix

* Update requirements.txt

* fixes to get docs building by github action (#210)

* fixes to get docs building by github action

* reverted some changes

* Update 01r__ssvep_viz.py

Co-authored-by: John Griffiths <[email protected]>

* Update README.rst

small commit to test doc build workflow on this branch

* removing gsoc submodule

Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: Parv Agarwal <[email protected]>
Co-authored-by: Parvfect <[email protected]>
Co-authored-by: Ben Pettit <[email protected]>

* update dependencies - seaborn

* docs/perf: reduced the imports: `cueing` example

* bug: update deprecated `plot_psd()` method

- feature of new `mne` version.
- instead of doing plot_psd() from the `mne.io.Raw` object, must do this:
	- `raw.compute_psd().plot()`
	- i.e., has to pass through a `spectrum` object

* updated deprec. `mne` function

* perf: removed importage of unused packages from example
- One of them, i.e., `collections.Iterable` is even deprecated.
- Must use `collections.abc.Iterable` instead now.
- Resulting in faster build/user run

* bugfix: `plot_conditions` - due to `sns` deprecation

* bugfix: resolved `psd_welch()` deprecation (`mne`)

---------

Co-authored-by: John Griffiths <[email protected]>
Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: Parv Agarwal <[email protected]>
Co-authored-by: Parvfect <[email protected]>
Co-authored-by: Ben Pettit <[email protected]>
Co-authored-by: Taha Morshedzadeh <[email protected]>

* Updated psychopy (#215)

* update psychopy for psychxr compatibility

* updated n170 example to run again.

* Updated doc examples for N170, P300 and SSVEP after Experiment Class Refactor (#218)

* major update: merging develop to master (#217)

* example test commit (#182)

* example test commit

* example edit

* ci: run test workflow on develop branch

* ci: add develop branch to job triggers

* ci: fix syntax issue in workflow

* fix: fixed import (brainflow updated API)

* build(deps): locked pylsl==1.10.5 (#187)

* Experiment Class Refactor (update to #183), converting specific experiments to subclasses (#184)

* First commit

* Second commit

* Modifications

* Lol

* Lol

* Incorporated N170 and p300, looking good for a PR

* ssvep update

* Implementing subclasses instead of loose functions

* fix: fixed import (brainflow updated API)

* Playing around still

* Fixing import errors

* Adding abstractmethod decorators

* Still working on the import error

* Guess what's finally working

* Comments and naming ticks

* More comments

* Live coding demonstration

* ssvep adapted

* Adapting Auditory Oddball

* changing save_fn to self.save_fun

* This maybe the last big change

* utils file changed, changes work through cli

Co-authored-by: Erik Bjäreholt <[email protected]>

* Submodule added for gsoc

* Adding pipelines for cli analysis (#202)

* started pipelines function

* almost working simple function equivalents of nb scripts

* fix: fixed import (brainflow updated API)

* sqc fixes for unicorn (#176)

* Ignore pushes

* Trying to create a cli

* Stepping through the problem

* First commit

* Fixing pause in signal quality check

* Fixing Signal quality check problem

* fix the technical debt

* Save path done for automated saving pdf

* I feel amazing

* Almost through

* Update eegnb/cli/__main__.py

Co-authored-by: Erik Bjäreholt <[email protected]>

* Trying to create cli but it's being really painful

* Extra word cli error

* Changed example handling

* Pain

* Adding whole datapath

* Finally fixed cli

* hmm

* Looking good

* added hyperlink

* Having some issues with detecting css and image deltetion

* Just the css now

* Fixed the css linking problem though it's a weird soln

* Automated running, still fnames problem

* Hahahah embedded images in html

* Improving code

* Okay now

* Look at that

* Almost there just the two figures now

* Now

* Added attrdict to do with cli error

Co-authored-by: John Griffiths <[email protected]>
Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: John Griffiths <[email protected]>

* added more options for site args; improved function names; removed some redundant lines (#209)

* fix subject num parsing bug

* analysis report function improvements for openbci cyton and gtec unicorn devices

* run exp fix

* Update requirements.txt

* fixes to get docs building by github action (#210)

* fixes to get docs building by github action

* reverted some changes

* Update 01r__ssvep_viz.py

Co-authored-by: John Griffiths <[email protected]>

* Update README.rst

small commit to test doc build workflow on this branch

* removing gsoc submodule

Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: Parv Agarwal <[email protected]>
Co-authored-by: Parvfect <[email protected]>
Co-authored-by: Ben Pettit <[email protected]>

* Updated doc examples

* Update 00x__n170_run_experiment.py

fix: typo in func param

---------

Co-authored-by: John Griffiths <[email protected]>
Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: Ben Pettit <[email protected]>
Co-authored-by: Ore O <[email protected]>

* fix error breaking n170 test (#223)

* fixed requirements.txt so 'pip install -e .' would work on windows. (#229)

* Get CI test builds working again! (#170)

* Revert "Revert PR #167: "ci: fix broken CI" (#169)"

This reverts commit 2d74871.

* Update Makefile

* fix: Update vep.py import

* Update Makefile

* Update vep.py

* fix: typo in makefile

* fix: update BaseExperiment class reference

* Update Makefile

* Update vep.py

* Update 01r__n170_viz.py

* makefile: install libnotify4

---------

Co-authored-by: Ore O <[email protected]>

* fix macos build (#245)

* Add devcontainer configuration for CPU environment

* Fixed the python version needed

* Fix plot conditions (#257)

* fixed plot_conditions functoni issues

* small change to viz n170 plotting example

* small change to viz p300 plotting example

* fixed to plotting issue

* modify plot command

* update example files

* fix condition label bug

* fix: set layout engine to fix colorbar error

---------

Co-authored-by: Ore O <[email protected]>

* Started the name switch (#251)

* started renaming from eegnb to eegexpy

* more eegnb renaming work

* more eegnb switches

* more relabelling

* ssvep renamings

* cueing eg

* update for more misc files

* more of the same

* update

* Update and rename available_notebooks.md to available_experiments.md

* Add newlogo (#260)

* Add files via upload

* Update README.rst

* added to enable eegexpy commands (#265)

* started alias of main package for imports (#266)

* Add multiple installation options (#263)

* added newly separated analysis and streaming utils files

* modified setup and requirements to allow for optional install types

* updated imports in experiment examples

* fixed some typos

* Update requirements.txt

moved click library to stim pres requirements section

* Update requirements.txt

Co-authored-by: Taha Morshedzadeh <[email protected]>

* Update Makefile

* Update docs.yml

* Update Makefile

this does a full build with all dependencies for EEG-ExPy

---------

Co-authored-by: Ore O <[email protected]>
Co-authored-by: Taha Morshedzadeh <[email protected]>

* Add support for /develop in docs site (#259)

* feat: update action to build doc page in a folder

* test: see if it works without if clause

* test: change source for docs

* Initial support for VR headsets (#241)

* fixed requirements.txt so 'pip install -e .' would work on windows.

* added support for n170 to run on rift

* altered logic to add back in jitter

* simplified logic

* made fullscreen again

* further simplified logic

* decreased font size of instructions for vr

* fixed instructions display, further simplified logic, removed logs

* made code easier to read

* reverted board back to muse

* Enable headlocking to fix jittering - cancel out any rotation and translation coming from the headset.

* fixed use_vr parameter to be set to False by default for existing experiments.

* fix macos build

* reverted unnecessary changes and made p300 experiment display correctly

* added vr support for p300 and ssvep

* fix psychxr version

* adding vr doc

* updated vr doco

---------

Co-authored-by: John Griffiths <[email protected]>

* ssaep volumefadingfixes (#81)

* fixed duration on instructions screen

* put sound object instantiation inside trials loop. fixes sound fading issue

---------

Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: Parv Agarwal <[email protected]>
Co-authored-by: Parvfect <[email protected]>
Co-authored-by: Ben Pettit <[email protected]>
Co-authored-by: Ore Ogundipe <[email protected]>
Co-authored-by: Taha Morshedzadeh <[email protected]>
Co-authored-by: Ben Pettit <[email protected]>
Co-authored-by: Taha Morshedzadeh <[email protected]>
  • Loading branch information
9 people authored Jun 21, 2024
1 parent da11068 commit e03c52d
Show file tree
Hide file tree
Showing 25 changed files with 896 additions and 107 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
make install-deps-wxpython
- name: Build project
run: |
make build
make install-docs-build-dependencies
- name: Build docs
run: |
Expand All @@ -35,4 +35,9 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/_build/html

- name: Deploy Dev Docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/_build/html
destination_dir: develop
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
build:
# Use pep517 to install pygatt==4.0.5(deprecated setuptools/egg installer) on macos
pip install --use-pep517 .
pip install --use-pep517 .[full]

install-docs-build-dependencies:
pip install -e .[docsbuild]

test:
pytest
Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ EEG-ExPy
.. |badge_binder| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/NeuroTechX/eeg-expy/master

.. image:: https://github.com/NeuroTechX/EEG-ExPy/blob/master/doc/img/EEG-ExPy_Logo.png
.. image:: ./doc/img/EEG-ExPy_Logo.png
:align: center


EEG-ExPy is a collection of classic EEG experiments, implemented in Python. The experimental protocols and analyses are quite generic, but are primarily taylored for low-budget / consumer EEG hardware such as the InteraXon MUSE and OpenBCI Cyton. The goal is to make cognitive neuroscience and neurotechnology more accessible, affordable, and scalable.

- **For an intro talk on the ***EEG-ExPy*** (formerly ***eeg-notebooks***) project see:** `JG's Brainhack Ontario presentation <https://www.crowdcast.io/e/brainhack-ontario/7>`_.
Expand Down Expand Up @@ -87,7 +88,7 @@ The best place for general discussion on eeg-expy functionality is the `issues p



.. image:: https://github.com/NeuroTechX/EEG-ExPy/blob/master/doc/img/eeg-notebooks_democratizing_the_cogneuro_experiment.png
.. image:: ./doc/img/eeg-notebooks_democratizing_the_cogneuro_experiment.png
:align: center
:scale: 50

49 changes: 49 additions & 0 deletions doc/getting_started/running_experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,52 @@ eeg_device = EEG(device=board_name)
# Run stimulus presentation
n170.present(duration=record_duration, eeg=eeg_device, save_fn=save_fn)
```


## Using virtual reality

### Heads up display

A heads-up display can be used for presenting experiments in a similar way to a monitor, without much modification.

#### Features to be added in future releases:

* Controller input
* Controller haptic feedback

### Prerequisites:
* Oculus Rift compatible VR headset, e.g. Oculus Rift or Meta Quest series.
* Native Windows installation with meta link compatible video card.
* EEG device, e.g. OpenBCI Cyton or Muse

If an experiment has the use_vr argument in its present method, it can have its stimulus presented to a subject's VR headset.
The N170 experiment for example, can have its stimulus displayed on the VR headset with a simple modification to the 'use_vr' argument, when presenting an experiment:

```python
# Run stimulus presentation with VR enabled.
n170.present(duration=record_duration, eeg=eeg_device, save_fn=save_fn, use_vr=True)
```

###

### Steps for running experiment in VR

1. Launch the Oculus app on the Windows computer and the IDE or CLI to be used for running the experiment.
2. Turn on the VR headset and put it on your head to make sure it is on and active, then take it off.
3. Go to the 'Devices' view in the Oculus app, it will show the headset as connected and active, along with any inactive or connected controllers.
4. Go to the 'Settings' view, under the 'Beta' title, enable 'Pass through over Oculus Link', double tapping the headset later with a fingertip will activate passthrough.
5. Put the VR headset onto the head, activate passthrough to help with wearing the eeg device.
6. Place the EEG device on top of the head.
7. Ensure the electrodes are touching the scalp ok and not being blocked by the headset strap.
8. From inside the VR headset's 'quick settings' dashboard, select 'Quest Link' and connect to the Oculus server running on windows, via air link or link cable.
9. Once the Oculus menu has finished loading on the VR headset, open the built-in Oculus desktop app by using the touch controllers or gamepad.
10. Try opening an eeg device raw data viwer and verify that the electrodes are receiving a good signal without too much noise, eg 'OpenBCI GUI'.
11. Run the EEG-ExPy experiment from the command line or IDE, it should load and take control from the Oculus desktop app.
12. Follow the experiment instructions, and press a key if necessary to begin the experiment and collect valid data.

### Other experiments can have VR added too.

1. Load/prepare stimulus in the same function as previously (def load_stimulus(self))
2. Present stimulus in the same function as previously(def present_stimulus(self, current_trial: int))
3. VR can be enabled for the experiment as part of the initializer to the base Experiment class, by default it is not enabled(use_vr=False) and will function the same as previously before VR functionality was added.

7 changes: 7 additions & 0 deletions eegexpy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

from eegnb.experiments import VisualN170,VisualP300,VisualSSVEP,AuditoryOddball

from eegnb.analysis.utils import *



Loading

0 comments on commit e03c52d

Please sign in to comment.