GithubHelp home page GithubHelp logo

Comments (6)

JohnGriffiths avatar JohnGriffiths commented on July 29, 2024 1

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.

JohnGriffiths avatar JohnGriffiths commented on July 29, 2024

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.

JohnGriffiths avatar JohnGriffiths commented on July 29, 2024

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:

  1. Write short data snippets to file and read in and compute signal quality index as a separate step

  2. 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.

JohnGriffiths avatar JohnGriffiths commented on July 29, 2024

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.

JohnGriffiths avatar JohnGriffiths commented on July 29, 2024

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.

ErikBjare avatar ErikBjare commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.