EEG-ExPy icon indicating copy to clipboard operation
EEG-ExPy copied to clipboard

N170 Load and Visualize Data

Open Liam-Noah opened this issue 3 years ago • 4 comments
trafficstars

📝 Provide a description of requested docs changes

https://neurotechx.github.io/eeg-notebooks/auto_examples/visual_n170/01r__n170_viz.html Hello, Could you explain how eegnb_data_path and n170_data_path variable are and how to use them ? I set n170_data_path to be n170_data_path = "C:/Users/.../.eegnb/data/visual_n170/local/muse2/subject0000/session000/recording_2022-09-12-15.40.21.csv" but apparently I have to change eegnb_data_path aswell ?

the examples work well on their own

update : I changed a few things subject = 0 session = 0 raw = load_data(subject,session, experiment='visual_n170', site='local', device_name='muse2', data_dir = eegnb_data_path)

update: it's a problem with the csv, sometimes it has 7 columns and it expects 6 I get this error :

ParserError: Error tokenizing data. C error: Expected 6 fields in line 14, saw 7

update4:

I added to the csv another column in the first line

now I get another error:

TypeError: can't multiply sequence by non-int of type 'float'

update5: so aparently if I just add the column to the first line of the csv without changing anything else, this solves the problem still, in jupyter notebook you have just images of the mne plot, it's not interactive

Liam-Noah avatar Sep 12 '22 16:09 Liam-Noah

Hi Vladimir. Can you screenshot the first 30 lines or so of the csv file ? Is it missing the final column in the first few rows?

JohnGriffiths avatar Sep 14 '22 17:09 JohnGriffiths

Hi Vladimir. Can you screenshot the first 30 lines or so of the csv file ? Is it missing the final column in the first few rows?

Yes, that's exactly what's happening here

Screenshot 2022-09-15 104104

Liam-Noah avatar Sep 15 '22 08:09 Liam-Noah

Ok. This is a known bug that occurs sometimes with muselsl streaming that has to do with asynchronous recording process initialization, and that we haven't managed to get a robust fix to yet unfortunately.

Sorry this has been a problem.

The data you have should be usable, the file just needs repairing. There is a function in the library for this:

https://github.com/NeuroTechX/eeg-notebooks/blob/a22501228677df0f968c49a0a699207380b1bd50/eegnb/analysis/utils.py#L530

usage ftom a python interpreter:

from eegnb analysis.utils import fix_musemissinglines

fpath = " " # path to the .csv file
fix_musemissinglines(fpath)

Which will create a new file with '_fml.csv' as suffix in the same folder.

Moving forward, you have two options:

  1. Continue as you have been, and applying this fix, to recorded files

  2. Switch streaming options

I highly recommend 2. The brainflow streaming options do not have this issue. You would give device option muse2_bfn ( bfn stands for BrainFlow with Native bluetooth hardware of your system, as opposed to brainflow with a BLED dongle which is '_bfb' ). The only reason why this isn't the only option listed is there are some unsolved brainflow issues with the newest windows 11 distributions. But you should try and see if this works on your comp.

What OS are you on?

JohnGriffiths avatar Sep 15 '22 11:09 JohnGriffiths

Hi again, I'm on windows 10. I'll give brainflow a try since there are less bugs. Thanks for the tips !

Do you real time analysis with jupyter notebook aswell? Like a neurofeedback window with live parameters, to see how well you do on getting focused or calm .

Liam-Noah avatar Sep 15 '22 11:09 Liam-Noah

Hi @Liam-Noah , eeg-notebooks doesn't currently support realtime analysis but here are a couple links that could help

  • EEGEdu - https://eegedu.com/
  • Timeflux - https://timeflux.io/

Some headsets like Neurosity has an api that can give you predictions every second of focus/calm

oreHGA avatar Dec 15 '22 15:12 oreHGA