Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N170 Load and Visualize Data #205

Closed
Liam-Noah opened this issue Sep 12, 2022 · 5 comments
Closed

N170 Load and Visualize Data #205

Liam-Noah opened this issue Sep 12, 2022 · 5 comments

Comments

@Liam-Noah
Copy link

Liam-Noah commented Sep 12, 2022

📝 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

@JohnGriffiths
Copy link
Collaborator

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?

@Liam-Noah
Copy link
Author

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

@JohnGriffiths
Copy link
Collaborator

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?

@Liam-Noah
Copy link
Author

Liam-Noah commented Sep 15, 2022

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 .

@oreHGA
Copy link
Collaborator

oreHGA commented Dec 15, 2022

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

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

@oreHGA oreHGA closed this as completed Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants