-
Notifications
You must be signed in to change notification settings - Fork 222
Fix SetRawAnnotations when no stim channel
#838
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 SetRawAnnotations when no stim channel
#838
Conversation
|
Thank you, @PierreGtch. However, I’m now facing a new issue related to missing events. It seems to be caused by the commit in this PR, as the issue does not occur on the current develop branch. from pathlib import Path
import mne
from moabb.datasets import Dreyer2023
from moabb.paradigms import LeftRightImagery
paradigm = LeftRightImagery()
dataset = Dreyer2023()
X, labels, meta = paradigm.get_data(dataset=dataset, subjects=[1])
print(X.shape[0]) # returns 11 (should be 240)
# extract events from raw processed by moabb
raw = dataset.get_data(subjects=[1])[1]["0"]["0R1acquisition"]
events_moabb, _ = mne.events_from_annotations(raw)
# extract events from unprocessed raw
fname = Path.home() / "mne_data" / "MNE-Dreyer2023-data" / "sub-01" / "eeg" / "sub-01_task-R1acquisition_eeg.edf"
raw = mne.io.read_raw_edf(fname)
events, event_id = mne.events_from_annotations(raw)
new_event_id = {"left_hand":event_id["769"], "right_hand":event_id["770"]}
epochs = mne.Epochs(raw, event_id = new_event_id, tmin=0, tmax=5, baseline=None)
events_unprocessed = epochs.events
print(events_moabb.shape) # 2, 3
print(events_unprocessed.shape) # 40, 3 |
Signed-off-by: Pierre Guetschel <[email protected]>
|
Ok i think I got it! Feel free to do additional tests, I will merge when tell me |
|
Thanks! I tested it on my machine, and everything works as expected. |
|
Great! thanks @simonkojima :) |
* V1.4.2 (#845) * fixing the release * pushing to including the .csv * pre-commit * v 1.4.2 * Fix `SetRawAnnotations` when no stim channel (#838) * First try to fix * Add test * [pre-commit.ci] auto fixes from pre-commit.com hooks * Whats new * enforce desired event ids when creating events from annotations --------- Signed-off-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Increase compatibility with Python 3.14 (#848) * Initial plan * Increase compatibility with Python 3.14 Co-authored-by: bruAristimunha <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bruAristimunha <[email protected]> * Fix warnings from scikit-learn 1.8+ and introduce FixedPipeline (#850) * p * fixing number * Fix compatibility with scikit-learn 1.8 (#852) * fixing more colab issues * updating the utils * Enhance documentation and update design elements (#853) * more design details * more adjust * more adjusts * more updates * updating the readme * removing the roadmap * first round * more modification and almost done * including subject info * remove the video * more details * updating to colab * updating the citation * updating the __init__ * Macro release (#854) --------- Signed-off-by: Pierre Guetschel <[email protected]> Co-authored-by: Bru <[email protected]> Co-authored-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: bruAristimunha <[email protected]>
* Release 1.4.3 (#855) * V1.4.2 (#845) * fixing the release * pushing to including the .csv * pre-commit * v 1.4.2 * Fix `SetRawAnnotations` when no stim channel (#838) * First try to fix * Add test * [pre-commit.ci] auto fixes from pre-commit.com hooks * Whats new * enforce desired event ids when creating events from annotations --------- Signed-off-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Increase compatibility with Python 3.14 (#848) * Initial plan * Increase compatibility with Python 3.14 Co-authored-by: bruAristimunha <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bruAristimunha <[email protected]> * Fix warnings from scikit-learn 1.8+ and introduce FixedPipeline (#850) * p * fixing number * Fix compatibility with scikit-learn 1.8 (#852) * fixing more colab issues * updating the utils * Enhance documentation and update design elements (#853) * more design details * more adjust * more adjusts * more updates * updating the readme * removing the roadmap * first round * more modification and almost done * including subject info * remove the video * more details * updating to colab * updating the citation * updating the __init__ * Macro release (#854) --------- Signed-off-by: Pierre Guetschel <[email protected]> Co-authored-by: Bru <[email protected]> Co-authored-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: bruAristimunha <[email protected]> * updating the md and yml * updating the DNS config * more documentation fix * checking links automatically * Update README.md Signed-off-by: Bru <[email protected]> * more fix within the links * fixing the url --------- Signed-off-by: Pierre Guetschel <[email protected]> Signed-off-by: Bru <[email protected]> Signed-off-by: Bru <[email protected]> Co-authored-by: Bruno Aristimunha <[email protected]> Co-authored-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]>
As described by @simonkojima in #830, when a dataset does not have a stim channel, the paradigm ignores the dataset's
intervalattribute when creating windowsThis PR should fix it
@simonkojima could you review this? On my machine, it passes the test on
Dreyer2023you sharedFixes #830