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

[WIP] Adding a A large EEG database with users' profile information for motor imagery Brain-Computer Interface dataset #404

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5d5a366
Adding a new dataset
Sara04 Jun 21, 2023
cc5de0c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2023
4c4ec42
Add data loading, update docstring
Sara04 Jun 23, 2023
a6786ea
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jun 23, 2023
594a306
merge
Sara04 Jun 23, 2023
7efaf94
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 23, 2023
2da66cd
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Jun 26, 2023
8bcbb06
Update dataset and add example
Sara04 Jun 27, 2023
d468441
Merge branch 'Dreyer2023_MI_dataset' of https://github.com/Sara04/moa…
Sara04 Jun 27, 2023
8e6eef0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2023
ebce567
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jun 27, 2023
e146fb8
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jun 29, 2023
cc33198
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jul 3, 2023
e4e7ee9
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Jul 4, 2023
c4ce3eb
Update Dreyer 2023 dataset class and example
Sara04 Jul 5, 2023
d5e7b8f
Remove loading info before db is downloaded
Sara04 Jul 5, 2023
fb157b7
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Jul 8, 2023
d8993fc
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jul 10, 2023
8f001e4
Merge branch 'develop' into Dreyer2023_MI_dataset
Sara04 Nov 17, 2023
2386c96
Update dataset session and run naming; update plotting
Sara04 Nov 18, 2023
c353080
Add whats_new
Sara04 Nov 18, 2023
3e21b66
Add words to ignore in pre commit config
Sara04 Nov 18, 2023
77620b4
Add words to ignore in pre commit config
Sara04 Nov 18, 2023
5fbde2d
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Apr 11, 2024
fac087d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 11, 2024
d9ddebe
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Apr 11, 2024
09ed4b6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 11, 2024
3beed67
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] committed Jun 21, 2023
commit cc5de0ca5e6510bf739e2f86cc3a9e17367a7d5e
51 changes: 29 additions & 22 deletions moabb/datasets/Dreyer2023.py
Original file line number Diff line number Diff line change
@@ -4,41 +4,47 @@
https://zenodo.org/record/7554429
"""

from functools import partialmethod
import logging
import os
import shutil
from moabb.datasets import download as dl
from pooch import Unzip, retrieve
import zipfile
from functools import partialmethod
from pathlib import Path

from pooch import Unzip, retrieve

from moabb.datasets import download as dl

from .base import BaseDataset
from .download import get_dataset_path
from pathlib import Path


DREYER2023_URL = "https://zenodo.org/record/7554429/files/BCI Database.zip"


class Dreyer2023(BaseDataset):
def __init__(self, db_id='A', subjects=[]):
assert db_id in ['A', 'B', 'C'], "Invalid dataset selection! Existing Dreyer2023 datasets: A, B, and C."
def __init__(self, db_id="A", subjects=[]):
assert db_id in [
"A",
"B",
"C",
], "Invalid dataset selection! Existing Dreyer2023 datasets: A, B, and C."
self.db_id = db_id
self.db_off = dict(A=0, B=60, C=81)
super().__init__(subjects,
sessions_per_subject=1,
events=dict(left_hand=1, right_hand=2),
code='Dreyer2023',
interval=[3, 8],
paradigm='imagery')
super().__init__(
subjects,
sessions_per_subject=1,
events=dict(left_hand=1, right_hand=2),
code="Dreyer2023",
interval=[3, 8],
paradigm="imagery",
)

def _get_single_subject_data(self, subject):

subj_dir_path = self.data_path(subject)
subj_files = os.listdir(subj_dir_path)
print(subj_files)


def data_path(
self, subject, path=None, force_update=False, update_path=None, verbose=None
):
@@ -49,24 +55,25 @@ def data_path(
if not os.path.isdir(basepath):
os.makedirs(basepath)

#dlpath = dl.data_dl(DREYER2023_URL, "DREYER_2023", path)
dlpath = '/home/sara/mne_data_test/MNE-dreyer_2023-data/record/7554429/files/BCI Database.zip'
if not os.path.exists(os.path.join(os.path.dirname(dlpath), 'BCI Database')):
# dlpath = dl.data_dl(DREYER2023_URL, "DREYER_2023", path)
dlpath = "/home/sara/mne_data_test/MNE-dreyer_2023-data/record/7554429/files/BCI Database.zip"
if not os.path.exists(os.path.join(os.path.dirname(dlpath), "BCI Database")):
with zipfile.ZipFile(dlpath) as zip_file:
zip_file.extractall(os.path.dirname(dlpath))

subj_template_path = os.path.join(os.path.dirname(dlpath), 'BCI Database', 'Signals/DATA {0}/{0}{1}')
subj_template_path = os.path.join(
os.path.dirname(dlpath), "BCI Database", "Signals/DATA {0}/{0}{1}"
)
return subj_template_path.format(self.db_id, subject + self.db_off[self.db_id])


class Dreyer2023A(Dreyer2023):
__init__ = partialmethod(Dreyer2023.__init__, "A", subjects=list(range(1, 61)))


class Dreyer2023B(Dreyer2023):
__init__ = partialmethod(Dreyer2023.__init__, "B", subjects=list(range(1, 22)))


class Dreyer2023C(Dreyer2023):
__init__ = partialmethod(Dreyer2023.__init__, "C", subjects=list(range(1, 7)))