-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
read_raw_egi always exclude first isolated event #11672
Labels
Comments
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴 |
Could you open a pull request with your proposed fix? That might tell us if it causes problems elsewhere (if some of our tests fail).
-------- Original Message --------
…On May 2, 2023, 19:52, nafraw wrote:
Description of the problem
The version I am using is "1.3.1". When reading mff file from an EGI system, I found that an event may be accidentally excluded if the first (1-indexed) event is discrete (one sample only) and only happen once.
The problem is that:
- under "def _read_events(input_fname, info)" of events.py, at line 32, events[n][i] = n + 1 will make 0th event as 1. If that event only happens once in the entire recording, there will be only one non-zero element and the value is 1.
- Then, when reaching line 424 of egimff.py or line 196 of egi.py, the condition "if event.sum() <= 1 and event_codes[ii]:" becomes True because event.sum() == 1
- As a result, that event is appended in "more_excludes" in the line after.
A simple solution:
Making "event.sum() <= 1" as "event.sum() < 1" for both:
- line 424 of egimff.py
- line 196 of egi.py
However, I don't know if this would trigger another issue.
Steps to reproduce
with an mff file that has the event file (.xml) started with an event that only happened once.
Run:
mne.io.read_raw_egi(file, preload=True)
Then:
The output message reads that event is excluded.
Link to data
No response
Expected results
The event should not be excluded
Actual results
The event is excluded
Additional information
Platform: Windows-10-10.0.19044-SP0
Python: 3.8.13 (default, Mar 28 2022, 06:59:08) [MSC v.1916 64 bit (AMD64)]
mne: 1.3.1
numpy: 1.21.5 {MKL 2021.4-Product with 8 threads}
scipy: 1.7.3
—
Reply to this email directly, [view it on GitHub](#11672), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAN2AU6ABXXY7ZVNR7TSBBLXEGT4DANCNFSM6AAAAAAXTXYHGM).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the problem
The version I am using is "1.3.1". When reading mff file from an EGI system, I found that an event may be accidentally excluded if the first (1-indexed) event is discrete (one sample only) and only happen once.
The problem is that:
A simple solution:
Making "event.sum() <= 1" as "event.sum() < 1" for both:
However, I don't know if this would trigger another issue.
Steps to reproduce
Link to data
No response
Expected results
The event should not be excluded
Actual results
The event is excluded
Additional information
Platform: Windows-10-10.0.19044-SP0
Python: 3.8.13 (default, Mar 28 2022, 06:59:08) [MSC v.1916 64 bit (AMD64)]
mne: 1.3.1
numpy: 1.21.5 {MKL 2021.4-Product with 8 threads}
scipy: 1.7.3
The text was updated successfully, but these errors were encountered: