eegdash 0.3.6.dev183416654__py3-none-any.whl → 0.3.7.dev105__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of eegdash might be problematic. Click here for more details.

@@ -0,0 +1,161 @@
1
+ import logging
2
+ from pathlib import Path
3
+
4
+ from mne.utils import warn
5
+
6
+ from ..api import EEGDashDataset
7
+ from ..bids_eeg_metadata import build_query_from_kwargs
8
+ from ..const import RELEASE_TO_OPENNEURO_DATASET_MAP, SUBJECT_MINI_RELEASE_MAP
9
+ from .registry import register_openneuro_datasets
10
+
11
+ logger = logging.getLogger("eegdash")
12
+
13
+
14
+ class EEGChallengeDataset(EEGDashDataset):
15
+ def __init__(
16
+ self,
17
+ release: str,
18
+ cache_dir: str,
19
+ mini: bool = True,
20
+ query: dict | None = None,
21
+ s3_bucket: str | None = "s3://nmdatasets/NeurIPS25",
22
+ **kwargs,
23
+ ):
24
+ """Create a new EEGDashDataset from a given query or local BIDS dataset directory
25
+ and dataset name. An EEGDashDataset is pooled collection of EEGDashBaseDataset
26
+ instances (individual recordings) and is a subclass of braindecode's BaseConcatDataset.
27
+
28
+ Parameters
29
+ ----------
30
+ release: str
31
+ Release name. Can be one of ["R1", ..., "R11"]
32
+ mini: bool, default True
33
+ Whether to use the mini-release version of the dataset. It is recommended
34
+ to use the mini version for faster training and evaluation.
35
+ query : dict | None
36
+ Optionally a dictionary that specifies a query to be executed,
37
+ in addition to the dataset (automatically inferred from the release argument).
38
+ See EEGDash.find() for details on the query format.
39
+ cache_dir : str
40
+ A directory where the dataset will be cached locally.
41
+ s3_bucket : str | None
42
+ An optional S3 bucket URI to use instead of the
43
+ default OpenNeuro bucket for loading data files.
44
+ kwargs : dict
45
+ Additional keyword arguments to be passed to the EEGDashDataset
46
+ constructor.
47
+
48
+ """
49
+ self.release = release
50
+ self.mini = mini
51
+
52
+ if release not in RELEASE_TO_OPENNEURO_DATASET_MAP:
53
+ raise ValueError(
54
+ f"Unknown release: {release}, expected one of {list(RELEASE_TO_OPENNEURO_DATASET_MAP.keys())}"
55
+ )
56
+
57
+ dataset_parameters = []
58
+ if isinstance(release, str):
59
+ dataset_parameters.append(RELEASE_TO_OPENNEURO_DATASET_MAP[release])
60
+ else:
61
+ raise ValueError(
62
+ f"Unknown release type: {type(release)}, the expected type is str."
63
+ )
64
+
65
+ if query and "dataset" in query:
66
+ raise ValueError(
67
+ "Query using the parameters `dataset` with the class EEGChallengeDataset is not possible."
68
+ "Please use the release argument instead, or the object EEGDashDataset instead."
69
+ )
70
+
71
+ if self.mini:
72
+ # When using the mini release, restrict subjects to the predefined subset.
73
+ # If the user specifies subject(s), ensure they all belong to the mini subset;
74
+ # otherwise, default to the full mini subject list for this release.
75
+
76
+ allowed_subjects = set(SUBJECT_MINI_RELEASE_MAP[release])
77
+
78
+ # Normalize potential 'subjects' -> 'subject' for convenience
79
+ if "subjects" in kwargs and "subject" not in kwargs:
80
+ kwargs["subject"] = kwargs.pop("subjects")
81
+
82
+ # Collect user-requested subjects from kwargs/query. We canonicalize
83
+ # kwargs via build_query_from_kwargs to leverage existing validation,
84
+ # and support Mongo-style {"$in": [...]} shapes from a raw query.
85
+ requested_subjects: list[str] = []
86
+
87
+ # From kwargs
88
+ if "subject" in kwargs and kwargs["subject"] is not None:
89
+ # Use the shared query builder to normalize scalars/lists
90
+ built = build_query_from_kwargs(subject=kwargs["subject"])
91
+ s_val = built.get("subject")
92
+ if isinstance(s_val, dict) and "$in" in s_val:
93
+ requested_subjects.extend(list(s_val["$in"]))
94
+ elif s_val is not None:
95
+ requested_subjects.append(s_val) # type: ignore[arg-type]
96
+
97
+ # From query (top-level only)
98
+ if query and isinstance(query, dict) and "subject" in query:
99
+ qval = query["subject"]
100
+ if isinstance(qval, dict) and "$in" in qval:
101
+ requested_subjects.extend(list(qval["$in"]))
102
+ elif isinstance(qval, (list, tuple, set)):
103
+ requested_subjects.extend(list(qval))
104
+ elif qval is not None:
105
+ requested_subjects.append(qval)
106
+
107
+ # Validate if any subjects were explicitly requested
108
+ if requested_subjects:
109
+ invalid = sorted(
110
+ {s for s in requested_subjects if s not in allowed_subjects}
111
+ )
112
+ if invalid:
113
+ raise ValueError(
114
+ "Some requested subject(s) are not part of the mini release for "
115
+ f"{release}: {invalid}. Allowed subjects: {sorted(allowed_subjects)}"
116
+ )
117
+ # Do not override user selection; keep their (validated) subjects as-is.
118
+ else:
119
+ # No subject specified by the user: default to the full mini subset
120
+ kwargs["subject"] = sorted(allowed_subjects)
121
+
122
+ s3_bucket = f"{s3_bucket}/{release}_mini_L100_bdf"
123
+ else:
124
+ s3_bucket = f"{s3_bucket}/{release}_L100_bdf"
125
+
126
+ warn(
127
+ "\n\n"
128
+ "[EEGChallengeDataset] EEG 2025 Competition Data Notice:\n"
129
+ "-------------------------------------------------------\n"
130
+ "This object loads the HBN dataset that has been preprocessed for the EEG Challenge:\n"
131
+ " - Downsampled from 500Hz to 100Hz\n"
132
+ " - Bandpass filtered (0.5–50 Hz)\n"
133
+ "\n"
134
+ "For full preprocessing details, see:\n"
135
+ " https://github.com/eeg2025/downsample-datasets\n"
136
+ "\n"
137
+ "IMPORTANT: The data accessed via `EEGChallengeDataset` is NOT identical to what you get from `EEGDashDataset` directly.\n"
138
+ "If you are participating in the competition, always use `EEGChallengeDataset` to ensure consistency with the challenge data.\n"
139
+ "\n",
140
+ UserWarning,
141
+ module="eegdash",
142
+ )
143
+
144
+ super().__init__(
145
+ dataset=RELEASE_TO_OPENNEURO_DATASET_MAP[release],
146
+ query=query,
147
+ cache_dir=cache_dir,
148
+ s3_bucket=s3_bucket,
149
+ _suppress_comp_warning=True,
150
+ **kwargs,
151
+ )
152
+
153
+
154
+ registered_classes = register_openneuro_datasets(
155
+ summary_file=Path(__file__).with_name("dataset_summary.csv"),
156
+ base_class=EEGDashDataset,
157
+ namespace=globals(),
158
+ )
159
+
160
+
161
+ __all__ = ["EEGChallengeDataset"] + list(registered_classes.keys())
@@ -16,7 +16,7 @@ def register_openneuro_datasets(
16
16
  ) -> Dict[str, type]:
17
17
  """Dynamically create dataset classes from a summary file."""
18
18
  if base_class is None:
19
- from .api import EEGDashDataset as base_class # lazy import
19
+ from ..api import EEGDashDataset as base_class # lazy import
20
20
 
21
21
  summary_path = Path(summary_file)
22
22
  namespace = namespace if namespace is not None else globals()
@@ -59,7 +59,7 @@ def register_openneuro_datasets(
59
59
 
60
60
  doc = f"""OpenNeuro dataset ``{dataset_id}``.
61
61
 
62
- {markdown_table(row_series)}
62
+ {_markdown_table(row_series)}
63
63
 
64
64
  Parameters
65
65
  ----------
@@ -101,7 +101,7 @@ def register_openneuro_datasets(
101
101
  return registered
102
102
 
103
103
 
104
- def markdown_table(row_series: pd.Series) -> str:
104
+ def _markdown_table(row_series: pd.Series) -> str:
105
105
  """Create a reStructuredText grid table from a pandas Series."""
106
106
  if row_series.empty:
107
107
  return ""
eegdash/utils.py CHANGED
@@ -1,7 +1,7 @@
1
1
  from mne.utils import get_config, set_config, use_log_level
2
2
 
3
3
 
4
- def __init__mongo_client():
4
+ def _init_mongo_client():
5
5
  with use_log_level("ERROR"):
6
6
  if get_config("EEGDASH_DB_URI") is None:
7
7
  set_config(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eegdash
3
- Version: 0.3.6.dev183416654
3
+ Version: 0.3.7.dev105
4
4
  Summary: EEG data for machine learning
5
5
  Author-email: Young Truong <dt.young112@gmail.com>, Arnaud Delorme <adelorme@gmail.com>, Aviv Dotan <avivd220@gmail.com>, Oren Shriki <oren70@gmail.com>, Bruno Aristimunha <b.aristimunha@gmail.com>
6
6
  License-Expression: GPL-3.0-only
@@ -1,13 +1,13 @@
1
- eegdash/__init__.py,sha256=CNB9QzZzygIs4P5KTbHSxUjEaGFIXWglPEizOr4jLag,247
2
- eegdash/api.py,sha256=_7Ne1uo9ozYgDewuNOGmu79600SJoAGXHHDgyD-eDVw,37460
3
- eegdash/data_config.py,sha256=OS6ERO-jHrnEOfMJUehY7ieABdsRw_qWzOKJ4pzSfqw,1323
4
- eegdash/data_utils.py,sha256=mi9pscui-BPpRH9ovRtGWiSwHG5QN6K_IvJdYaING2I,27679
5
- eegdash/dataset.py,sha256=WoKVmPoBIiRNn5h5ICUMMg5uUa2cMrc5ymChdfYV_f4,9469
6
- eegdash/dataset_summary.csv,sha256=9Rw9PawiQ9a_OBRJYKarrzb4UFSGpkGULhYB0MYUieE,14740
1
+ eegdash/__init__.py,sha256=yplAyK95jkzGdCrV7kNsoqxXC0jxOJzkD87WI29VA5A,285
2
+ eegdash/api.py,sha256=s6dG52Or7YlEsJFR_BJQ8Az2-BwyuUScFoy8UZLgsdY,38097
3
+ eegdash/bids_eeg_metadata.py,sha256=iAHJKxeleDWzeei4sNqc-9NlZJk4QY2BYk6D1t2mkOI,6984
4
+ eegdash/const.py,sha256=qdFBEL9kIrsj9CdxbXhBkR61R3CrTGSaj5Iq0YOACIs,7313
5
+ eegdash/data_utils.py,sha256=sPglGH1w3USBuDn6uNpsfPxji8NVy2QmVg789uMhe_E,29739
7
6
  eegdash/mongodb.py,sha256=GD3WgA253oFgpzOHrYaj4P1mRjNtDMT5Oj4kVvHswjI,2006
8
- eegdash/preprocessing.py,sha256=7S_TTRKPKEk47tTnh2D6WExBt4cctAMxUxGDjJqq5lU,2221
9
- eegdash/registry.py,sha256=jBR2tGE4YJL4yhbZcn2CN4jaC-ttyVN0wmsCR1uWzoU,4329
10
- eegdash/utils.py,sha256=wU9CBQZLW_LIQIBwhgQm5bU4X-rSsVNPdeF2iE4QGJ4,410
7
+ eegdash/utils.py,sha256=7TfQ9D0LrAJ7FgnSXEvWgeHWK2QqaqS-_WcWXD86ObQ,408
8
+ eegdash/dataset/__init__.py,sha256=Qmzki5G8GaFlzTb10e4SmC3WkKuJyo1Ckii15tCEHAo,157
9
+ eegdash/dataset/dataset.py,sha256=5ku9I-JTC8DNult_m1Dgem1OQnSPazp_Xdktq4s_2s4,6829
10
+ eegdash/dataset/registry.py,sha256=4L8KHlCrY7LT2SDAjKSiEuwklZVKbP-KZceoMDM3zO4,4332
11
11
  eegdash/features/__init__.py,sha256=BXNhjvL4_SSFAY1lcP9nyGpkbJNtoOMH4AHlF6OyABo,4078
12
12
  eegdash/features/datasets.py,sha256=kU1DO70ArSIy-LF1hHD2NN4iT-kJrI0mVpSkyV_OSeI,18301
13
13
  eegdash/features/decorators.py,sha256=v0qaJz_dcX703p1fvFYbAIXmwK3d8naYGlq7fRVKn_w,1313
@@ -23,8 +23,8 @@ eegdash/features/feature_bank/dimensionality.py,sha256=j_Ds71Y1AbV2uLFQj8EuXQ4kz
23
23
  eegdash/features/feature_bank/signal.py,sha256=3Tb8z9gX7iZipxQJ9DSyy30JfdmW58kgvimSyZX74p8,3404
24
24
  eegdash/features/feature_bank/spectral.py,sha256=bNB7skusePs1gX7NOU6yRlw_Gr4UOCkO_ylkCgybzug,3319
25
25
  eegdash/features/feature_bank/utils.py,sha256=DGh-Q7-XFIittP7iBBxvsJaZrlVvuY5mw-G7q6C-PCI,1237
26
- eegdash-0.3.6.dev183416654.dist-info/licenses/LICENSE,sha256=asisR-xupy_NrQBFXnx6yqXeZcYWLvbAaiETl25iXT0,931
27
- eegdash-0.3.6.dev183416654.dist-info/METADATA,sha256=R99Rg04ca_IDFRTEuOtRiwd-aEvv4EW5BbwLcUOXoW4,10059
28
- eegdash-0.3.6.dev183416654.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- eegdash-0.3.6.dev183416654.dist-info/top_level.txt,sha256=zavO69HQ6MyZM0aQMR2zUS6TAFc7bnN5GEpDpOpFZzU,8
30
- eegdash-0.3.6.dev183416654.dist-info/RECORD,,
26
+ eegdash-0.3.7.dev105.dist-info/licenses/LICENSE,sha256=asisR-xupy_NrQBFXnx6yqXeZcYWLvbAaiETl25iXT0,931
27
+ eegdash-0.3.7.dev105.dist-info/METADATA,sha256=Eyu7l05oYbcZVSJGfZ2H3sC9a4Ekjc3oc4Z9fuZrk48,10053
28
+ eegdash-0.3.7.dev105.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ eegdash-0.3.7.dev105.dist-info/top_level.txt,sha256=zavO69HQ6MyZM0aQMR2zUS6TAFc7bnN5GEpDpOpFZzU,8
30
+ eegdash-0.3.7.dev105.dist-info/RECORD,,
eegdash/data_config.py DELETED
@@ -1,34 +0,0 @@
1
- config = {
2
- "required_fields": ["data_name"],
3
- # Default set of user-facing primary record attributes expected in the database. Records
4
- # where any of these are missing will be loaded with the respective attribute set to None.
5
- # Additional fields may be returned if they are present in the database, notably bidsdependencies.
6
- "attributes": {
7
- "data_name": "str",
8
- "dataset": "str",
9
- "bidspath": "str",
10
- "subject": "str",
11
- "task": "str",
12
- "session": "str",
13
- "run": "str",
14
- "sampling_frequency": "float",
15
- "modality": "str",
16
- "nchans": "int",
17
- "ntimes": "int", # note: this is really the number of seconds in the data, rounded down
18
- },
19
- # queryable descriptive fields for a given recording
20
- "description_fields": ["subject", "session", "run", "task", "age", "gender", "sex"],
21
- # list of filenames that may be present in the BIDS dataset directory that are used
22
- # to load and interpret a given BIDS recording.
23
- "bids_dependencies_files": [
24
- "dataset_description.json",
25
- "participants.tsv",
26
- "events.tsv",
27
- "events.json",
28
- "eeg.json",
29
- "electrodes.tsv",
30
- "channels.tsv",
31
- "coordsystem.json",
32
- ],
33
- "accepted_query_fields": ["data_name", "dataset"],
34
- }
@@ -1,256 +0,0 @@
1
- dataset,n_records,n_subjects,n_tasks,nchans_set,sampling_freqs,duration_hours_total,size,size_bytes,s3_item_count
2
- ds002718,18,18,1,74,250,14.844,4.31 GB,4624315408,0
3
- ds005505,1342,136,10,129,500,125.366,103.11 GB,110708824369,0
4
- ds004745,6,6,1,,1000,0.0,242.08 MB,253839725,0
5
- ds005514,2885,295,10,129,500,213.008,185.03 GB,198677728665,0
6
- ds005512,2320,257,10,129,500,196.205,157.19 GB,168778507427,0
7
- ds005510,1227,135,10,129,500,112.464,90.80 GB,97492961757,0
8
- ds005511,3100,381,10,"6,129",500,285.629,244.83 GB,262883881898,0
9
- ds005509,3326,330,10,129,500,274.559,224.17 GB,240701124393,0
10
- ds005508,3342,324,10,129,500,269.281,229.81 GB,246753736933,0
11
- ds005507,1812,184,10,129,500,168.649,139.37 GB,149646718160,0
12
- ds005506,1405,150,10,129,500,127.896,111.88 GB,120126449650,0
13
- test,2,1,1,64,500,20.556,0 B,0,0
14
- ds004854,1,1,1,64,128,0.535,79.21 MB,83057080,0
15
- ds004853,1,1,1,64,128,0.535,79.21 MB,83057080,0
16
- ds004844,68,17,1,64,1024,21.252,22.33 GB,23976121966,0
17
- ds004843,92,14,1,64,256,29.834,7.66 GB,8229205795,0
18
- ds004842,102,14,1,64,256,20.102,5.21 GB,5589054270,0
19
- ds004852,1,1,1,64,128,0.535,79.21 MB,83057106,0
20
- ds004851,1,1,1,64,128,0.535,56.59 GB,60765064414,0
21
- ds004850,1,1,1,64,128,0.535,79.21 MB,83057078,0
22
- ds004855,1,1,1,64,128,0.535,79.21 MB,83057076,0
23
- ds004849,1,1,1,64,128,0.535,79.21 MB,83057084,0
24
- ds004841,147,20,1,64,256,29.054,7.31 GB,7846934401,0
25
- ds004661,17,17,1,64,128,10.137,1.40 GB,1505577392,0
26
- ds004660,42,21,1,32,"2048,512",23.962,7.25 GB,7782408710,0
27
- ds004657,119,24,1,64,"1024,8192",27.205,43.06 GB,46237302701,0
28
- ds004362,1526,109,1,64,"128,160",48.592,11.14 GB,11961862159,0
29
- ds004010,24,24,1,64,1000,26.457,23.14 GB,24844863976,0
30
- ds002181,226,226,1,125,500,7.676,150.89 MB,158222084,0
31
- ds004554,16,16,1,99,1000,0.024,8.79 GB,9432865762,0
32
- ds005697,50,50,1,"65,69",1000,77.689,66.58 GB,71486411402,0
33
- ds004350,240,24,5,64,256,41.265,26.83 GB,28810754598,0
34
- ds004785,17,17,1,32,500,0.019,351.17 MB,368224136,0
35
- ds004504,88,88,1,19,500,19.608,5.38 GB,5780997160,0
36
- ds004635,55,55,1,129,1000,20.068,30.56 GB,32817659781,0
37
- ds005787,448,19,1,"64,66","1000,500",23.733,27.09 GB,29087512003,0
38
- ds005079,60,1,15,65,500,3.25,1.68 GB,1809231997,0
39
- ds005342,32,32,1,17,250,33.017,2.03 GB,2181610593,0
40
- ds005034,100,25,2,129,1000,37.525,61.36 GB,65885315479,0
41
- ds002680,350,14,1,31,1000,21.244,9.22 GB,9902152149,0
42
- ds003805,1,1,1,19,500,0.033,16.96 MB,17781347,0
43
- ds003838,130,65,2,63,1000,136.757,253.29 GB,271965704312,0
44
- ds002691,20,20,1,32,250,6.721,776.76 MB,814491068,0
45
- ds003690,375,75,3,"64,66",500,46.771,21.46 GB,23043491552,0
46
- ds004040,4,2,1,64,512,4.229,11.59 GB,12440304224,0
47
- ds003061,39,13,1,79,256,8.196,2.26 GB,2421951821,0
48
- ds005672,3,3,1,"65,69",1000,4.585,4.23 GB,4545641306,0
49
- ds005410,81,81,1,63,1000,22.976,19.76 GB,21213481224,0
50
- ds003753,25,25,1,64,500,10.104,4.62 GB,4965253148,0
51
- ds005565,24,24,1,,500,11.436,2.62 GB,2816607296,0
52
- ds002893,52,49,1,33,"250,250.0293378038558",36.114,7.70 GB,8263047991,0
53
- ds002578,2,2,1,256,256,1.455,1.33 GB,1429254677,0
54
- ds005089,36,36,1,63,1000,68.82,68.01 GB,73021312961,0
55
- ds003822,25,25,1,64,500,12.877,5.82 GB,6248744522,0
56
- ds003670,62,25,1,32,2000,72.772,97.53 GB,104721234854,0
57
- ds005048,35,35,1,,250,5.203,355.91 MB,373200880,0
58
- ds004574,146,146,1,"63,64,66",500,31.043,13.48 GB,14470034208,0
59
- ds004519,40,40,1,62,250,0.067,12.56 GB,13486848019,0
60
- ds004602,546,182,3,128,"250,500",87.11,73.91 GB,79364456958,0
61
- ds004784,6,1,6,128,512,0.518,10.82 GB,11621460277,0
62
- ds004771,61,61,1,34,256,0.022,1.36 GB,1462195517,0
63
- ds003518,137,110,1,64,500,89.888,39.51 GB,42423490194,0
64
- ds005207,39,20,1,"6,10,12,14,15,16,17,18","128,250",422.881,69.12 GB,74214619739,0
65
- ds005866,60,60,1,,500,15.976,3.57 GB,3837211623,0
66
- ds003523,221,91,1,64,500,84.586,37.54 GB,40304852370,0
67
- ds004347,48,24,1,64,"128,512",6.389,2.69 GB,2890549319,0
68
- ds004588,42,42,1,24,300,4.957,601.76 MB,630994652,0
69
- ds005811,448,19,1,62,"1000,500",23.733,24.12 GB,25902600444,0
70
- ds003987,69,23,1,64,500.0930232558139,52.076,26.41 GB,28362707915,0
71
- ds004317,50,50,1,60,500,37.767,18.29 GB,19639199743,0
72
- ds004033,36,18,2,64,500,42.645,19.81 GB,21270391452,0
73
- ds004315,50,50,1,60,500,21.104,9.81 GB,10532856899,0
74
- ds003474,122,122,1,64,500,36.61,16.64 GB,17867805967,0
75
- ds003509,84,56,1,64,500,48.535,22.34 GB,23988721823,0
76
- ds005868,48,48,1,,500,13.094,2.93 GB,3146417813,0
77
- ds003516,25,25,1,47,500,22.57,13.46 GB,14451393616,0
78
- ds004942,62,62,1,65,1000,28.282,25.05 GB,26899933549,0
79
- ds004348,18,9,2,34,200,35.056,12.30 GB,13210476025,0
80
- ds004625,543,32,9,120,500,28.397,62.46 GB,67069111978,0
81
- ds003517,34,17,1,64,500,13.273,6.48 GB,6952992399,0
82
- ds004368,40,39,1,63,128,0.033,997.14 MB,1045574811,0
83
- ds004584,149,149,1,"63,64,66",500,6.641,2.87 GB,3078216874,0
84
- ds003506,84,56,1,64,500,35.381,16.21 GB,17400039992,0
85
- ds003570,40,40,1,64,2048,26.208,36.12 GB,38783075272,0
86
- ds003490,75,50,1,64,500,12.76,5.85 GB,6276775630,0
87
- ds004117,85,23,1,69,"1000,250,500,500.059",15.941,5.80 GB,6230776574,0
88
- ds004505,25,25,1,120,250,30.398,522.56 GB,561092363916,0
89
- ds004580,147,147,1,"63,64,66",500,36.514,15.84 GB,17008438640,0
90
- ds004532,137,110,1,64,500,49.651,22.09 GB,23719572304,0
91
- ds004902,218,71,2,61,"500,5000",18.118,8.29 GB,8898600609,0
92
- ds004295,26,26,1,66,"1024,512",34.313,31.51 GB,33831372141,0
93
- ds003519,54,27,1,64,500,20.504,8.96 GB,9623156762,0
94
- ds003458,23,23,1,64,500,10.447,4.72 GB,5065250805,0
95
- ds003004,34,34,1,"134,180,189,196,201,206,207,208,209,211,212,213,214,215,218,219,220,221,222,223,224,226,227,229,231,232,235",256,49.072,35.63 GB,38255333087,0
96
- ds004200,20,20,1,37,1000,14.123,7.21 GB,7740555648,0
97
- ds004015,36,36,1,18,500,47.29,6.03 GB,6475870225,0
98
- ds004595,53,53,1,64,500,17.078,7.89 GB,8470863296,0
99
- ds004626,52,52,1,68,1000,21.359,19.87 GB,21336341431,0
100
- ds004475,30,30,1,"113,115,118,119,120,122,123,124,125,126,127,128",512,26.899,112.74 GB,121053900746,0
101
- ds004515,54,54,1,64,500,20.61,9.48 GB,10177384081,0
102
- ds004883,516,172,3,128,500,137.855,122.80 GB,131858855599,0
103
- ds003739,120,30,4,128,256,20.574,10.94 GB,11742611182,0
104
- ds004389,260,26,4,42,10000,30.932,376.50 GB,404264486093,0
105
- ds004367,40,40,1,68,1200,24.81,27.98 GB,30039343808,0
106
- ds004369,41,41,1,4,500,37.333,8.01 GB,8596739356,0
107
- ds004579,139,139,1,"63,64,66",500,55.703,24.12 GB,25896737812,0
108
- ds005416,23,23,1,64,1000,24.68,21.30 GB,22869325264,0
109
- ds001785,54,18,3,63,"1000,1024",14.644,27.86 GB,29915397068,0
110
- ds001971,273,20,1,108,512,46.183,31.98 GB,34339201543,0
111
- ds004388,399,40,3,67,10000,43.327,682.54 GB,732876226489,0
112
- ds003478,243,122,1,64,500,23.57,10.65 GB,11430531312,0
113
- ds004306,15,12,1,124,1024,18.183,79.11 GB,84945921180,0
114
- ds005305,165,165,1,64,"2048,512",14.136,6.41 GB,6887595053,0
115
- ds005114,223,91,1,64,500,125.701,56.47 GB,60630838923,0
116
- ds003039,16,16,1,64,500,14.82,7.82 GB,8401240820,0
117
- ds003602,699,118,6,35,1000,159.35,73.21 GB,78609742568,0
118
- ds003655,156,156,1,19,500,130.923,20.26 GB,21756905870,0
119
- ds003522,200,96,1,64,500,57.079,25.36 GB,27225424004,0
120
- ds003801,20,20,1,24,250,13.689,1.15 GB,1233075452,0
121
- ds005296,62,62,1,,500,37.205,8.53 GB,9154623627,0
122
- ds004561,23,23,1,62,10000,11.379,97.96 GB,105188606283,0
123
- ds005131,63,58,2,64,500,52.035,22.35 GB,23996524256,0
124
- ds005028,66,11,3,,,0.0,1.46 GB,1563795662,0
125
- ds005170,225,5,1,,,0.0,261.77 GB,281068716313,0
126
- ds004840,51,9,3,8,"1024,256,512",11.306,1.75 GB,1876219715,0
127
- ds004718,51,51,1,64,1000,21.836,108.98 GB,117013849037,0
128
- ds002725,105,21,5,30,1000,0.0,15.32 GB,16447829856,0
129
- ds004408,380,19,1,128,512,20.026,18.70 GB,20083249915,0
130
- ds004796,235,79,3,,1000,0.0,240.21 GB,257923739221,0
131
- ds004511,134,45,3,139,3000,48.922,202.28 GB,217194709208,0
132
- ds004817,20,20,1,63,1000,0.0,25.34 GB,27207910489,0
133
- ds003190,280,19,1,0,256,29.891,1.27 GB,1361816737,0
134
- ds004917,24,24,1,,,0.0,36.47 GB,39162637090,0
135
- ds004357,16,16,1,63,1000,0.0,69.56 GB,74685825960,0
136
- ds005397,26,26,1,64,500,27.923,12.10 GB,12993735747,0
137
- ds003846,60,19,1,64,500,24.574,11.36 GB,12193814091,0
138
- ds004024,497,13,3,64,20000,55.503,1021.22 GB,1096522006089,0
139
- ds005815,137,26,4,30,"1000,500",38.618,9.91 GB,10642000219,0
140
- ds005429,61,15,3,64,"2500,5000",14.474,16.47 GB,17685373747,0
141
- ds003702,47,47,1,61,500,0.0,60.93 GB,65421860496,0
142
- ds004577,130,103,1,"19,21,24",200,22.974,652.76 MB,684471843,0
143
- ds003574,18,18,1,64,500,0.0,14.79 GB,15876358782,0
144
- ds005779,250,19,16,"64,67,70",5000,16.65,88.67 GB,95206991747,0
145
- ds005185,356,20,3,8,500,0.0,783.25 GB,841005525524,0
146
- ds001787,40,24,1,64,256,27.607,5.69 GB,6112379157,0
147
- ds003505,37,19,2,128,2048,0.0,90.13 GB,96777780296,0
148
- ds005340,15,15,1,2,10000,35.297,19.14 GB,20556600898,0
149
- ds005363,43,43,1,64,1000,43.085,17.71 GB,19011101429,0
150
- ds005121,39,34,1,58,512,41.498,9.04 GB,9711092185,0
151
- ds004256,53,53,2,64,500,42.337,18.18 GB,19516271706,0
152
- ds005420,72,37,2,20,500,5.485,372.11 MB,390189484,0
153
- ds002034,167,14,4,64,512,37.248,10.10 GB,10842685551,0
154
- ds003825,50,50,1,"63,128",1000,0.0,55.34 GB,59421076202,0
155
- ds004587,114,103,1,59,10000,25.491,219.34 GB,235517890780,0
156
- ds004598,20,9,1,,10000,0.0,26.66 GB,28629940214,0
157
- ds005383,240,30,1,30,200,8.327,17.43 GB,18712238212,0
158
- ds003195,20,10,2,19,200,4.654,121.08 MB,126957549,0
159
- ds005403,32,32,1,62,10000,13.383,135.65 GB,145656630881,0
160
- ds004621,167,42,4,,1000,0.0,77.39 GB,83096459121,0
161
- ds005863,357,127,4,27,500,0.0,10.59 GB,11371790189,0
162
- ds005594,16,16,1,64,1000,12.934,10.89 GB,11695589464,0
163
- ds002336,54,10,6,,5000,0.0,17.98 GB,19300632853,0
164
- ds004043,20,20,1,63,1000,0.0,30.44 GB,32685724275,0
165
- ds005106,42,42,1,32,500,0.012,12.62 GB,13547440607,0
166
- ds004284,18,18,1,129,1000,9.454,16.49 GB,17703523636,0
167
- ds005620,202,21,3,"64,65",5000,21.811,77.30 GB,83002663223,0
168
- ds002720,165,18,10,19,1000,0.0,2.39 GB,2566221024,0
169
- ds005307,73,7,1,"72,104",10000,1.335,18.59 GB,19956343711,0
170
- ds002094,43,20,3,30,5000,18.593,39.45 GB,42356287674,0
171
- ds002833,80,20,1,257,1000,11.604,39.77 GB,42698182133,0
172
- ds002218,18,18,1,0,256,16.52,1.95 GB,2089183870,0
173
- ds005021,36,36,1,64,1024,0.0,83.20 GB,89337424472,0
174
- ds004264,21,21,1,31,1000,0.0,3.30 GB,3546307489,0
175
- ds004446,237,30,1,129,1000,33.486,29.23 GB,31382984441,0
176
- ds004980,17,17,1,64,"499.9911824,499.9912809,499.991385,499.9914353,499.9914553,499.9915179,499.9917272,499.9917286,499.9917378,499.9919292,499.9919367,499.9923017,499.9923795,500",36.846,15.82 GB,16989514798,0
177
- ds002722,94,19,5,32,1000,0.0,6.10 GB,6545819602,0
178
- ds003944,82,82,1,61,"1000,3000.00030000003",6.999,6.15 GB,6606397067,0
179
- ds004279,60,56,1,64,1000,53.729,25.22 GB,27082275780,0
180
- ds005876,29,29,1,32,1000,16.017,7.61 GB,8170007441,0
181
- ds003816,1077,48,8,127,1000,159.313,53.97 GB,57953346429,0
182
- ds005385,3264,608,2,64,1000,169.62,74.07 GB,79529430923,0
183
- ds004572,516,52,10,58,1000,52.624,43.56 GB,46777273840,0
184
- ds005095,48,48,1,63,1000,16.901,14.28 GB,15336165645,0
185
- ds004460,40,20,1,160,1000,27.494,61.36 GB,65881325046,0
186
- ds005189,30,30,1,61,1000,0.0,17.03 GB,18283103870,0
187
- ds005274,22,22,1,6,500,0.0,71.91 MB,75400374,0
188
- ds004075,116,29,4,,1000,0.0,7.39 GB,7936060172,0
189
- ds004447,418,22,1,"128,129",1000,23.554,20.73 GB,22253514308,0
190
- ds004952,245,10,1,128,1000,123.411,696.72 GB,748095804444,0
191
- ds002724,96,10,4,32,1000,0.0,8.52 GB,9150248444,0
192
- ds005571,45,24,2,64,5000,0.0,62.77 GB,67394456730,0
193
- ds004262,21,21,1,31,1000,0.0,3.48 GB,3731654700,0
194
- ds005273,33,33,1,63,1000,58.055,44.42 GB,47690882240,0
195
- ds004520,33,33,1,62,250,0.055,10.41 GB,11175908145,0
196
- ds004444,465,30,1,129,1000,55.687,48.62 GB,52204973958,0
197
- ds004582,73,73,1,59,10000,34.244,294.22 GB,315915939478,0
198
- ds002723,44,8,6,32,1000,0.0,2.60 GB,2791985215,0
199
- ds003751,38,38,1,128,250,19.95,4.71 GB,5057922307,0
200
- ds003421,80,20,1,257,1000,11.604,76.77 GB,82433418198,0
201
- ds002158,117,20,1,,,0.0,428.59 GB,460190030981,0
202
- ds004951,23,11,1,63,1000,29.563,22.00 GB,23627352274,0
203
- ds004802,38,38,1,65,"2048,512",0.0,29.34 GB,31504070800,0
204
- ds004816,20,20,1,63,1000,0.0,23.31 GB,25028989553,0
205
- ds005873,2850,125,1,2,256,11935.09,117.21 GB,125851664268,0
206
- ds003194,29,15,2,"19,21",200,7.178,189.15 MB,198333904,0
207
- ds004356,24,22,1,34,10000,0.0,213.08 GB,228796286136,0
208
- ds004381,437,18,1,"4,5,7,8,10",20000,11.965,12.36 GB,13275540742,0
209
- ds004196,4,4,1,64,512,1.511,9.33 GB,10022898106,0
210
- ds005692,59,30,1,24,5000,112.206,92.81 GB,99649237201,0
211
- ds002338,85,17,4,,5000,0.0,25.89 GB,27802574037,0
212
- ds004022,21,7,1,"16,18",500,0.0,634.93 MB,665774359,0
213
- ds004603,37,37,1,64,1024,30.653,39.13 GB,42020115207,0
214
- ds004752,136,15,1,"0,8,10,19,20,21,23","200,2000,4000,4096",0.302,11.95 GB,12829882725,0
215
- ds003768,255,33,2,,,0.0,89.24 GB,95819107191,0
216
- ds003947,61,61,1,61,"1000,3000.00030000003",5.266,12.54 GB,13466591394,0
217
- ds005530,21,17,1,10,500,154.833,6.47 GB,6949642931,0
218
- ds005555,256,128,1,"2,8,9,11,12,13",256,2002.592,33.45 GB,35921410419,0
219
- ds004477,9,9,1,79,2048,13.557,22.34 GB,23990303639,0
220
- ds005688,89,20,5,4,"10000,20000",2.502,8.42 GB,9036021093,0
221
- ds003766,124,31,4,129,1000,39.973,152.77 GB,164033759919,0
222
- ds005540,103,59,1,64,"1200,600",0.0,70.40 GB,75594345013,0
223
- ds004152,21,21,1,31,1000,0.0,4.77 GB,5118976537,0
224
- ds003626,30,10,1,,,0.0,24.99 GB,26828585815,0
225
- ds002814,168,21,1,68,1200,0.0,48.57 GB,52151006842,0
226
- ds003645,108,18,1,,,0.0,105.89 GB,113698969765,0
227
- ds005586,23,23,1,60,1000,33.529,28.68 GB,30791089319,0
228
- ds003810,50,10,1,15,125,0.0,69.31 MB,72674251,0
229
- ds003969,392,98,4,64,"1024,2048",66.512,54.46 GB,58479195149,0
230
- ds004000,86,43,2,128,2048,0.0,22.50 GB,24161100810,0
231
- ds004995,20,20,1,,,0.0,27.60 GB,29637643188,0
232
- ds003638,57,57,1,64,512,40.597,16.31 GB,17516109722,0
233
- ds004521,34,34,1,62,250,0.057,10.68 GB,11470006201,0
234
- ds001849,120,20,1,30,5000,0.0,44.51 GB,47790431085,0
235
- ds004252,1,1,1,,,0.0,4.31 GB,4630172409,0
236
- ds004448,280,56,1,129,1000,43.732,38.17 GB,40980948240,0
237
- ds005795,39,34,2,72,500,0.0,6.43 GB,6902188541,0
238
- ds004018,32,16,1,63,1000,0.0,10.56 GB,11334174765,0
239
- ds004324,26,26,1,28,500,19.216,2.46 GB,2637689107,0
240
- ds003887,24,24,1,128,1000,0.0,80.10 GB,86007307086,0
241
- ds004860,31,31,1,32,"2048,512",0.0,3.79 GB,4065632222,0
242
- ds002721,185,31,6,19,1000,0.0,3.35 GB,3598851749,0
243
- ds003555,30,30,1,,1024,0.0,28.27 GB,30359240949,0
244
- ds005486,445,159,1,,"25000,5000",0.0,371.04 GB,398401152773,0
245
- ds005520,69,23,3,67,1000,60.73,275.98 GB,296326427308,0
246
- ds005262,186,12,1,,,0.0,688.75 MB,722211079,0
247
- ds002778,46,31,1,40,512,2.518,545.00 MB,571471228,0
248
- ds003885,24,24,1,128,1000,0.0,82.21 GB,88277188455,0
249
- ds005406,29,29,1,63,1000,15.452,13.26 GB,14241905076,0
250
- ds003710,48,13,1,32,5000,9.165,10.18 GB,10934708022,0
251
- ds003343,59,20,1,16,500,6.551,663.50 MB,695729345,0
252
- ds005345,26,26,1,64,500,0.0,405.13 GB,435000970369,0
253
- ds004067,84,80,1,63,2000,0.0,100.79 GB,108218050644,0
254
- ds001810,263,47,1,64,512,91.205,109.70 GB,117790096766,0
255
- ds005515,2516,533,8,129,500,198.849,160.55 GB,172385741878,0
256
- ds005516,3397,430,8,129,500,256.932,219.39 GB,235564761634,0
eegdash/preprocessing.py DELETED
@@ -1,63 +0,0 @@
1
- import logging
2
-
3
- import mne
4
- import numpy as np
5
-
6
- from braindecode.preprocessing import Preprocessor
7
-
8
- logger = logging.getLogger("eegdash")
9
-
10
-
11
- class hbn_ec_ec_reannotation(Preprocessor):
12
- """Preprocessor to reannotate the raw data for eyes open and eyes closed events.
13
-
14
- This processor is designed for HBN datasets.
15
-
16
- """
17
-
18
- def __init__(self):
19
- super().__init__(fn=self.transform, apply_on_array=False)
20
-
21
- def transform(self, raw):
22
- """Reannotate the raw data to create new events for eyes open and eyes closed
23
-
24
- This function modifies the raw MNE object by creating new events based on
25
- the existing annotations for "instructed_toCloseEyes" and "instructed_toOpenEyes".
26
- It generates new events every 2 seconds within specified time ranges after
27
- the original events, and replaces the existing annotations with these new events.
28
-
29
- Parameters
30
- ----------
31
- raw : mne.io.Raw
32
- The raw MNE object containing EEG data and annotations.
33
-
34
- """
35
- events, event_id = mne.events_from_annotations(raw)
36
-
37
- logger.info("Original events found with ids: %s", event_id)
38
-
39
- # Create new events array for 2-second segments
40
- new_events = []
41
- sfreq = raw.info["sfreq"]
42
- for event in events[events[:, 2] == event_id["instructed_toCloseEyes"]]:
43
- # For each original event, create events every 2 seconds from 15s to 29s after
44
- start_times = event[0] + np.arange(15, 29, 2) * sfreq
45
- new_events.extend([[int(t), 0, 1] for t in start_times])
46
-
47
- for event in events[events[:, 2] == event_id["instructed_toOpenEyes"]]:
48
- # For each original event, create events every 2 seconds from 5s to 19s after
49
- start_times = event[0] + np.arange(5, 19, 2) * sfreq
50
- new_events.extend([[int(t), 0, 2] for t in start_times])
51
-
52
- # replace events in raw
53
- new_events = np.array(new_events)
54
-
55
- annot_from_events = mne.annotations_from_events(
56
- events=new_events,
57
- event_desc={1: "eyes_closed", 2: "eyes_open"},
58
- sfreq=raw.info["sfreq"],
59
- )
60
-
61
- raw.set_annotations(annot_from_events)
62
-
63
- return raw