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

Fix incorrect interval in annotations #607

Conversation

PierreGtch
Copy link
Collaborator

The annotations added by SetRawAnnotations do not take into account the case when a dataset’s interval does not start at 0. This PR fixes it.

@PierreGtch
Copy link
Collaborator Author

PierreGtch commented May 29, 2024

Datasets affected since version 1.0:

imagery BNCI2014_001	interval=[2, 6]
imagery BNCI2014_002	interval=[3, 8]
imagery BNCI2014_004	interval=[3, 7.5]
imagery BNCI2015_004	interval=[3, 10]
imagery Weibo2014	interval=[3, 7]
p300 Huebner2017	interval=[-0.2, 0.7]
p300 Huebner2018	interval=[-0.2, 0.7]
p300 Sosulski2019	interval=[-0.2, 1]
ssvep Kalunga2016	interval=[2, 4]
ssvep MAMEM1	interval=[1, 4]
ssvep MAMEM2	interval=[1, 4]
ssvep MAMEM3	interval=[1, 4]
ssvep Nakanishi2015	interval=[0.15, 4.3]
ssvep Wang2016	interval=[0.5, 5.5]

@bruAristimunha bruAristimunha merged commit e1c2466 into NeuroTechX:develop May 29, 2024
12 checks passed
@bruAristimunha
Copy link
Collaborator

We need to create more tests for this situation, but for a new PR!

@PierreGtch
Copy link
Collaborator Author

A bit more context: In 1.0.0, for all the datasets where interval[0]!=0, the raw.annotations were set to start exactly at the onset events[:,0], and not at events[:,0] + sfreq * interval[0].

The durations in the annotations were correct.

This did not affect the creation of epochs when using MOABB’s paradigms.
However, this affected the codes loading the raw data from MOABB and doing the epoching externally by relying on the annotations and ignoring the dataset’s interval, which is the case in Braindecode.

@sylvchev
Copy link
Member

Ok, that why there was no regression in MOABB but it was the case for Braindecode. Good catch.

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

Successfully merging this pull request may close these issues.

3 participants