Giter Club home page Giter Club logo

brainflow-notebooks's People

Contributors

jadintredup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

brainflow-notebooks's Issues

improve auto-detection of serial port

Currently the default behaviour is to assume that the serial port on windows is COM3.

This was throwing a brainflow error

UNABLE_TO_OPEN_PORT_ERROR:2 ...

The error on my machine was due to the fact that the openbci cyton was actually streaming on COM5

( btw I was able to discover this using the OpenBCI GUI, which displayed the port being used )

This commit adds an optional input argument that 'manually overrides' the auto-detected serial port

Usage:

from eegnb.devices.eeg import EEG
thiseeg = EEG(device='cython', serial_port='COM5')
thiseeg.start(fn='thisoutfname.csv')

In the future we should add more automated functionality to figure out the correct channel and not have to have people add a manual override.

We also need to do some testing to find out what typical and atypical behaviour is here.

csv file not saved properly at session's end

Hi Jadin, I tried the notebook and I was able to get the cyton board streaming to UART, however I have noticed the data is not saved properly at the end of the session from within Jupyter. I attach the error log here and a suggestion for improvement at the end
Cheers
Cris

setup:
-cloned the notebooks from Jadin (latest update pulled to my local repo: yesterday)
-connected cyton board and got the USB port number
-changed instruction 3 in N170 notebook to:
n170_exp.initialize_eeg(board_type='cyton',usb_port='/dev/cu.usbserial-DM00DS6T')

-ran succesfully N170 from the beginning until instruction 4:

subject_name = 'jadin_test'
duration = 10
trial_num = 3
n170_exp.run_trial(duration=duration,
subject=subject_name,
run=trial_num)

error log :
Beginning EEG Stream; Wait 5 seconds for signal to settle...


BrainFlowError Traceback (most recent call last)
in
2 duration = 10
3 trial_num = 3
----> 4 n170_exp.run_trial(duration=duration,
5 subject=subject_name,
6 run=trial_num)

~/git/brainflow-notebooks/experiments.py in run_trial(self, duration, subject, run)
239 data = self.board.get_board_data()
240 data_fn, event_fn = get_fns(subject, run, self.erp)
--> 241 DataFilter.write_file(data, data_fn, 'w')
242 self.mywin.close()
243 self.trials.to_csv(event_fn)

/opt/anaconda3/envs/bfnotebooks/lib/python3.8/site-packages/brainflow/data_filter.py in write_file(cls, data, file_name, file_mode)
515 res = DataHandlerDLL.get_instance ().write_file (data_flatten, data.shape[0], data.shape[1], file, mode)
516 if res != BrainflowExitCodes.STATUS_OK.value:
--> 517 raise BrainFlowError ('unable to write file', res)
518
519 @classmethod

BrainFlowError: GENERAL_ERROR:17 unable to write file

change suggestion

 def get_fns(subject, run, paradigm):
    data_fn = os.path.join('data', f'{subject}_{paradigm}_{run}.csv')
    event_fn = os.path.join('data', f'{subject}_{paradigm}_{run}_EVENTS.csv')

becomes

 def get_fns(subject, run, paradigm):
    home = os.getenv("HOME")
    if not os.path.isdir(os.path.join(home,'data')):
        os.makedirs(os.path.join(home,'data'))
    data_fn = os.path.join(home,'data', f'{subject}_{paradigm}_{run}.csv')
    event_fn = os.path.join(home,'data', f'{subject}_{paradigm}_{run}_EVENTS.csv')
    return data_fn, event_fn

psychopy screen doesn't auto-fit screen size in windows

screenshot example:

image

...run using code:

from eegnb.experiments.visual_n170 import n170
n170.present(duration=10)

The issue is that the grey screen doesn't fill the background. Hence you can see some of my chrome browser in the background

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.