Comments (6)
So following the discussion in developer's meeting today, the plan on this is to implement
i) A 'data buffer' or 'get recent data' functionality in the EEG
device class
ii) Add Erik's signal quality check code as a function in analysis/utils.py
iii) Add something that initializes i), calls ii), and prints results to command line
PR for my first attempt at the data buffer component, for muse: #103
from eeg-expy.
This function should go in the cli utils.py
file:
https://github.com/JohnGriffiths/eeg-notebooks/blob/master/eegnb/cli/utils.py
Made a minimal start on this for muselsl. Pushing shortly.
from eeg-expy.
OR, maybe we should make use of our device abstraction and put some part of this as a method in the EEG
class
https://github.com/NeuroTechX/eeg-notebooks/blob/master/eegnb/devices/eeg.py
I see two ways of doing this:
-
Write short data snippets to file and read in and compute signal quality index as a separate step
-
Read the data snippets in memory and compute sq
Consderations:
Option 1 is obviously less elegant because it involves i/o
However, our device abstraction is already currently based around i/o (i.e. you define an output file when you start a recording). So within our current device class it would (I think) be less additional code to do option 2 than option 1. Similarly, option 2 would necessarily involve at least two separate implementations (one for brainflow one for muselsl), whereas option 1 can just use our higher-level device wrapper.
The lines for pulling samples into memory are however pretty minimal so not a huge overhead all the same
from eeg-expy.
Make a 10s temp recording file for sigqual eval with EEG device and muse headset
import os
import time
from eegnb.devices.eeg import EEG
f = os.path.abspath('sigqual_tempfile.csv')
this_eeg = EEG(device='muse2016')
this_eeg.start(f, duration=10)
time.sleep(3) # get error if no markers?
this_eeg.push_sample([99], timestamp=time.time())
from eeg-expy.
Code for pulling samples used in the muselsl visualizer
https://github.com/alexandrebarachant/muse-lsl/blob/master/muselsl/viewer_v2.py
from pylsl import StreamInlet, resolve_byprop
from muselsl.constants import LSL_EEG_CHUNK, LSL_SCAN_TIMEOUT
streams = resolve_byprop('type', 'EEG', timeout=LSL_SCAN_TIMEOUT)
inlet = StreamInlet(streams[0], max_chunklen=LSL_EEG_CHUNK)
samples, timestamps = inlet.pull_chunk(timeout=0.0, max_samples=100)
import numpy as np
arr = np.array(samples)
np.std(arr,axis=0)
from eeg-expy.
Brainflow filtering: https://brainflow.readthedocs.io/en/stable/Examples.html#python-signal-filtering
MNE filtering: https://mne.tools/stable/generated/mne.filter.filter_data.html
My filtering (inspired by the muse-lsl viewer): https://github.com/ErikBjare/thesis/blob/b25661aaffa5ab957b464fe8f46fdbfe81b51eb4/src/eegclassify/clean.py#L26-L45
from eeg-expy.
Related Issues (20)
- Installing eeg notebooks on Mac M1 HOT 1
- Idea to implement for EEG decoding the option to convert it to DFT? HOT 1
- Hello, I have a basic question about another project HOT 1
- N170 experiment doesn't work HOT 1
- N170 Load and Visualize Data HOT 5
- Research showing the influence of the used SSVEP pattern image HOT 2
- Error with installing dukpy HOT 3
- Can't run experiments from CLI interface HOT 4
- pyglet version incompatibility mac HOT 4
- Implement version + release schedule HOT 2
- aux channel with muse2_bfn device
- P300 experiment explanation: "...high or low probability..."
- Legend items order when using diff_waveform in plot_conditions HOT 1
- Support for Oculus/Meta Quest VR for N170 and other experiments
- is it possible to save the PPG data from Muse 2 (with bluemuse and/or brainflow)? HOT 2
- Problems with saving data file using brainflow HOT 2
- AttributeError: module 'eegnb.experiments.visual_ssvep.ssvep' has no attribute 'present' HOT 3
- Incomplete outputfile SSAEP_onefreq with Bluemuse HOT 1
- `eeg-notebook` => `eeg-expy` rename
- Neurosity crown supported in code, not yet listed in doc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eeg-expy.