-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Nihon Kohden EEG file reader WIP #6017
Conversation
This pull request introduces 1 alert when merging 4b922d8 into ce50c2b - view on LGTM.com new alerts:
Comment posted by LGTM.com |
@fraimondo can you get some tiny file in |
I need to check who has the system that can provide me with a testing dataset. I’ll come back soon.
… On 27 Mar 2019, at 20:11, Eric Larson ***@***.***> wrote:
@fraimondo <https://github.com/fraimondo> can you get some tiny file in mne-testing-data? I don't have any Nihon Koden data, but once that testing file is there, I (and others) can help with this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#6017 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AESRg0sW45D_IRbW0hsA_8dHkL48ApZeks5va8JPgaJpZM4bamKI>.
|
Just created a PR in mne-testing-data.
edit: see mne-tools/mne-testing-data#46
… On 2 Apr 2019, at 14:39, Fede Raimondo ***@***.***> wrote:
I need to check who has the system that can provide me with a testing dataset. I’ll come back soon.
> On 27 Mar 2019, at 20:11, Eric Larson ***@***.*** ***@***.***>> wrote:
>
> @fraimondo <https://github.com/fraimondo> can you get some tiny file in mne-testing-data? I don't have any Nihon Koden data, but once that testing file is there, I (and others) can help with this.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub <#6017 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AESRg0sW45D_IRbW0hsA_8dHkL48ApZeks5va8JPgaJpZM4bamKI>.
>
|
@fraimondo any time to come back to this in the next couple of weeks to make it into 0.21? You now have your testing file in If not, okay for me to push some commits to get tests working? |
4b922d8
to
4f53dc3
Compare
Just updated the code. This works. Can be improved by reading the annotations and more metadata. |
There's an issue with the channel names. Hold the PR. |
Awesome, I was just about to look into this to see if we could get into usable shape in the next week to make it into 0.21. Let me know if you need help |
7bae38a
to
6afaa2a
Compare
Can't figure out this one. I'm getting So now I use the It gives me an error that it can't broadcast the data after
any clue? The problem with this kind of files is that the data needs to be multiplied by the |
I recently made some changes to this function. Okay for me to look and push a commit tomorrow? |
Feel free. PR is ready to be merged one this is solved.
The only solution I have in mind is to set cals=1 and then do the `(*scaling + offset) * gains` before calling `_mult_cal_one`.
… On 7 Sep 2020, at 14:39, Eric Larson ***@***.***> wrote:
I recently made some changes to this function. Okay for me to look and push a commit tomorrow?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#6017 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABCJDAZ6MFWBPX6BKX54MIDSETIBJANCNFSM4G3KMKEA>.
|
Setting Basically the second arg of |
Yes, I got that.
But when a projector is applied while picking channels (as in the `_test_raw_reader` function), the `mult` parameter has shape (n_proj, n_channels). So the way I was offsetting and multiplying by units does not work, since `data` will have shape (n_proj, n_times).
I’ll do the cal=1 trick.
… On 7 Sep 2020, at 14:45, Eric Larson ***@***.***> wrote:
Setting cals=1 should be fine. The edf reader was updated to behave this way.
Basically the second arg of _mult_cal_one (one) should always have shape (n_data_channels, n_times) (and n_times can be shorter if you use it in chunks / with time-based slicing) then the _mult_cal_one will subindex the idx from n_data_channels that it needs. It's a bit wacky but it should work. The idx is really there just to tell you which rows of the one you actually need to fill / will be used.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#6017 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABCJDA5AL43WJ7PB4ZUIUGTSETIVBANCNFSM4G3KMKEA>.
|
You should not need to worry about the shape of |
CIs complain @fraimondo maybe rebase on master to fix it? |
Codecov is not happy with the coverage (80%). It's just a few lines testing for proper headers in the files / right values in the right places. I don't really know how to test those lines. The other two are unrelated to this PR:
|
@fraimondo let me know when you're done and I'll see if I can simplify the |
I'm fine now. I think I got enough codecov. At least I don't see a failed test. |
mne/io/nihon/tests/test_nihon.py
Outdated
# for x in range(len(raw.ch_names))] | ||
# edf_ch_types = [types_dict[raw_edf.info['chs'][x]['kind']] | ||
# for x in range(len(raw_edf.ch_names))] | ||
# assert ch_types == edf_ch_types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup?
@fraimondo pushed a commit to simplify. Feel free to address @agramfort's remaining comment then hopefully we're good to go! |
Thx @fraimondo |
* upstream/master: (489 commits) MRG, DOC: Fix ICA docstring, add whitening (mne-tools#8227) MRG: Extract measurement date and age for NIRX files (mne-tools#7891) Nihon Kohden EEG file reader WIP (mne-tools#6017) BUG: Fix scaling for src_mri_t in coreg (mne-tools#8223) MRG: Set pyvista as default 3d backend (mne-tools#8220) MRG: Recreate our helmet graphic (mne-tools#8116) [MRG] Adding get_montage for montage to BaseRaw objects (mne-tools#7667) ENH: Allow setting tqdm backend (mne-tools#8177) [MRG, IO] Persyst reader into Raw object (mne-tools#8176) MRG, BUG: Fix errors in IO/loading/projectors (mne-tools#8210) MAINT: vectorize _read_annotations_edf (mne-tools#8214) FIX : events_from_annotation when annotations.orig_time is None and f… (mne-tools#8209) FIX: do not project to sphere; DOC - explain how to get EEGLAB-like topoplots (mne-tools#7455) [MRG, DOC] Added linear algebra of transform to doc (mne-tools#7087) FIX: Travis failure on python3.8.1 (mne-tools#8207) BF: String formatting in exception message (mne-tools#8206) BUG: Fix STC limit bug (mne-tools#8202) MRG, DOC: fix ica tutorial (mne-tools#8175) CSP component order selection (mne-tools#8151) MRG, ENH: Add on_missing to plot_events (mne-tools#8198) ...
* Supports reading Nihon Kohden EEG files * Read channels from 21E file if available * Fixing codestyle * Fix in the Units * Reads annotations. Ready to merge maybe? * Fixed merge error * Flake * Add RawNihon to doc ignore * use _mult_cal_one * Flake * Fixed reading cals/mult/offset/gains * Spell check * Try to increase coverage * Try to increase coverage * FIX: More standard * Update mne/io/nihon/nihon.py * Cleanup, ready to go Co-authored-by: Eric Larson <[email protected]>
Hello, A colleague posted a NK .EEG file I don't know how to read:
In case you have interesting sources of information about the NK file formats... Thanks! |
MNE Python complains too:
|
This is a reader module for Nihon Kohden native EEG file format.
It is a WIP, so for now it does not read events, no metadata and the channel names are the standard ones (it can be renamed through a file).
I still need to add a test.
I leave it here so we can start doing the collaborative stuff and if anyone has any interest, they can chip in.