Braindecode 1.3.0.dev169361694__tar.gz → 1.3.0.dev169765289__tar.gz
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.
- {braindecode-1.3.0.dev169361694/braindecode.egg-info → braindecode-1.3.0.dev169765289}/PKG-INFO +33 -14
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/README.rst +14 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/augmentation/__init__.py +4 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/classifier.py +3 -8
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/__init__.py +4 -0
- braindecode-1.3.0.dev169765289/braindecode/datasets/chb_mit.py +172 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/hub.py +63 -80
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/nmt.py +38 -43
- braindecode-1.3.0.dev169765289/braindecode/datasets/siena.py +164 -0
- braindecode-1.3.0.dev169765289/braindecode/datasets/utils.py +67 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datautil/__init__.py +2 -0
- braindecode-1.3.0.dev169765289/braindecode/datautil/util.py +155 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/eegneuralnet.py +20 -48
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/atcnet.py +12 -12
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/attentionbasenet.py +5 -5
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/attn_sleep.py +10 -8
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/bendr.py +2 -2
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/biot.py +27 -25
- braindecode-1.3.0.dev169765289/braindecode/models/config.py +233 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/contrawr.py +2 -2
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/ctnet.py +34 -34
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/deep4.py +4 -4
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/deepsleepnet.py +4 -4
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eegconformer.py +28 -23
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eeginception_erp.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eeginception_mi.py +3 -3
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eegitnet.py +3 -3
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eegnet.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eegnex.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eegsimpleconv.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eegtcnet.py +3 -3
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/fbcnet.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/fblightconvnet.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/fbmsnet.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/hybrid.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/ifnet.py +2 -2
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/labram.py +40 -40
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/luna.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/medformer.py +15 -15
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/msvtnet.py +10 -10
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/patchedtransformer.py +48 -48
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/sccnet.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/shallow_fbcsp.py +4 -2
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/signal_jepa.py +4 -4
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/sinc_shallow.py +1 -2
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/sleep_stager_blanco_2020.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/sleep_stager_chambon_2018.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/sparcnet.py +4 -4
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/sstdpn.py +2 -2
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/summary.csv +17 -17
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/syncnet.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/tcn.py +3 -3
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/tidnet.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/tsinception.py +1 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/usleep.py +3 -3
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/util.py +154 -14
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/blocks.py +3 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/regressor.py +3 -7
- braindecode-1.3.0.dev169765289/braindecode/version.py +1 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289/braindecode.egg-info}/PKG-INFO +33 -14
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode.egg-info/SOURCES.txt +4 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode.egg-info/requires.txt +16 -10
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/api.rst +7 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/cite.rst +9 -2
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/conf.py +11 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/attention.rst +5 -5
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/lbm.rst +5 -5
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/models_categorization.rst +8 -8
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/models_table.rst +2 -2
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/whats_new.rst +17 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/pyproject.toml +20 -14
- braindecode-1.3.0.dev169361694/braindecode/datautil/util.py +0 -41
- braindecode-1.3.0.dev169361694/braindecode/version.py +0 -1
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/LICENSE.txt +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/MANIFEST.in +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/NOTICE.txt +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/__init__.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/augmentation/base.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/augmentation/functional.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/augmentation/transforms.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/base.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/bcicomp.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/bids.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/experimental.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/hub_validation.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/mne.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/moabb.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/registry.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/sleep_physionet.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/tuh.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/xy.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datautil/channel_utils.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datautil/hub_formats.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datautil/serialization.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/functional/functions.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/__init__.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/base.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eegminer.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/models/eegsym.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/__init__.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/activation.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/attention.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/convolution.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/filter.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/layers.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/linear.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/stats.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/util.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/preprocessing/__init__.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/preprocessing/mne_preprocess.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/preprocessing/preprocess.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/preprocessing/util.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/preprocessing/windowers.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/samplers/base.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/training/__init__.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/training/losses.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/training/scoring.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/util.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/visualization/gradients.py +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/Makefile +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/help.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/index.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/install/install.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/install/install_pip.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/install/install_source.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/gnn.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/categorization/spd.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/models.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/setup.cfg +0 -0
{braindecode-1.3.0.dev169361694/braindecode.egg-info → braindecode-1.3.0.dev169765289}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: braindecode
|
|
3
|
-
Version: 1.3.0.
|
|
3
|
+
Version: 1.3.0.dev169765289
|
|
4
4
|
Summary: Deep learning software to decode EEG, ECG or MEG signals
|
|
5
5
|
Author-email: Robin Tibor Schirrmeister <robintibor@gmail.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Alexandre Gramfort <agramfort@meta.com>
|
|
6
6
|
Maintainer-email: Alexandre Gramfort <agramfort@meta.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Robin Tibor Schirrmeister <robintibor@gmail.com>
|
|
@@ -14,44 +14,47 @@ Classifier: Intended Audience :: Developers
|
|
|
14
14
|
Classifier: Intended Audience :: Science/Research
|
|
15
15
|
Classifier: Topic :: Software Development :: Build Tools
|
|
16
16
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
-
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Requires-Python: >=3.11
|
|
21
22
|
Description-Content-Type: text/x-rst
|
|
22
23
|
License-File: LICENSE.txt
|
|
23
24
|
License-File: NOTICE.txt
|
|
24
|
-
Requires-Dist: mne>=1.
|
|
25
|
+
Requires-Dist: mne>=1.11.0
|
|
25
26
|
Requires-Dist: mne_bids>=0.16
|
|
26
27
|
Requires-Dist: numpy
|
|
27
28
|
Requires-Dist: pandas
|
|
28
29
|
Requires-Dist: scipy
|
|
29
30
|
Requires-Dist: matplotlib
|
|
30
31
|
Requires-Dist: h5py
|
|
31
|
-
Requires-Dist: skorch>=1.
|
|
32
|
-
Requires-Dist: torch
|
|
33
|
-
Requires-Dist: torchaudio
|
|
32
|
+
Requires-Dist: skorch>=1.3.0
|
|
33
|
+
Requires-Dist: torch>=2.0
|
|
34
|
+
Requires-Dist: torchaudio>=2.0
|
|
34
35
|
Requires-Dist: einops
|
|
35
36
|
Requires-Dist: joblib
|
|
36
|
-
Requires-Dist: torchinfo
|
|
37
|
+
Requires-Dist: torchinfo
|
|
37
38
|
Requires-Dist: wfdb
|
|
38
|
-
Requires-Dist: h5py
|
|
39
39
|
Requires-Dist: linear_attention_transformer
|
|
40
40
|
Requires-Dist: docstring_inheritance
|
|
41
41
|
Requires-Dist: rotary_embedding_torch
|
|
42
42
|
Provides-Extra: moabb
|
|
43
|
-
Requires-Dist: moabb>=1.2
|
|
43
|
+
Requires-Dist: moabb>=1.4.2; extra == "moabb"
|
|
44
44
|
Provides-Extra: eegprep
|
|
45
|
-
Requires-Dist: eegprep[eeglabio]>=0.
|
|
45
|
+
Requires-Dist: eegprep[eeglabio]>=0.2.23; extra == "eegprep"
|
|
46
46
|
Provides-Extra: hub
|
|
47
47
|
Requires-Dist: huggingface_hub[torch]>=0.20.0; extra == "hub"
|
|
48
|
-
Requires-Dist: zarr
|
|
48
|
+
Requires-Dist: zarr>=3.0; extra == "hub"
|
|
49
49
|
Provides-Extra: tests
|
|
50
50
|
Requires-Dist: pytest; extra == "tests"
|
|
51
51
|
Requires-Dist: pytest-cov; extra == "tests"
|
|
52
52
|
Requires-Dist: codecov; extra == "tests"
|
|
53
53
|
Requires-Dist: pytest_cases; extra == "tests"
|
|
54
54
|
Requires-Dist: mypy; extra == "tests"
|
|
55
|
+
Provides-Extra: typing
|
|
56
|
+
Requires-Dist: exca==0.4; extra == "typing"
|
|
57
|
+
Requires-Dist: numpydantic>=1.7; extra == "typing"
|
|
55
58
|
Provides-Extra: docs
|
|
56
59
|
Requires-Dist: sphinx_gallery; extra == "docs"
|
|
57
60
|
Requires-Dist: sphinx_rtd_theme; extra == "docs"
|
|
@@ -70,14 +73,21 @@ Requires-Dist: seaborn; extra == "docs"
|
|
|
70
73
|
Requires-Dist: pre-commit; extra == "docs"
|
|
71
74
|
Requires-Dist: openneuro-py; extra == "docs"
|
|
72
75
|
Requires-Dist: plotly; extra == "docs"
|
|
76
|
+
Requires-Dist: shap; extra == "docs"
|
|
77
|
+
Requires-Dist: nbformat; extra == "docs"
|
|
73
78
|
Provides-Extra: all
|
|
74
79
|
Requires-Dist: braindecode[moabb]; extra == "all"
|
|
75
|
-
Requires-Dist: braindecode[hub]; extra == "all"
|
|
76
80
|
Requires-Dist: braindecode[tests]; extra == "all"
|
|
77
81
|
Requires-Dist: braindecode[docs]; extra == "all"
|
|
82
|
+
Requires-Dist: braindecode[hub]; extra == "all"
|
|
78
83
|
Requires-Dist: braindecode[eegprep]; extra == "all"
|
|
84
|
+
Requires-Dist: braindecode[typing]; extra == "all"
|
|
79
85
|
Dynamic: license-file
|
|
80
86
|
|
|
87
|
+
.. image:: https://zenodo.org/badge/232335424.svg
|
|
88
|
+
:target: https://doi.org/10.5281/zenodo.8214376
|
|
89
|
+
:alt: DOI
|
|
90
|
+
|
|
81
91
|
.. image:: https://badges.gitter.im/braindecodechat/community.svg
|
|
82
92
|
:alt: Join the chat at https://gitter.im/braindecodechat/community
|
|
83
93
|
:target: https://gitter.im/braindecodechat/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
|
@@ -93,6 +103,7 @@ Dynamic: license-file
|
|
|
93
103
|
:target: https://codecov.io/gh/braindecode/braindecode
|
|
94
104
|
:alt: Code Coverage
|
|
95
105
|
|
|
106
|
+
|
|
96
107
|
.. |Braindecode| image:: https://user-images.githubusercontent.com/42702466/177958779-b00628aa-9155-4c51-96d1-d8c345aff575.svg
|
|
97
108
|
.. _braindecode: braindecode.org/
|
|
98
109
|
|
|
@@ -149,7 +160,15 @@ https://gitter.im/braindecodechat/community
|
|
|
149
160
|
Citing
|
|
150
161
|
======
|
|
151
162
|
|
|
152
|
-
If you use
|
|
163
|
+
If you use Braindecode in scientific work, please cite the software using the Zenodo DOI shown in the badge below:
|
|
164
|
+
|
|
165
|
+
.. image:: https://zenodo.org/badge/232335424.svg
|
|
166
|
+
:target: https://doi.org/10.5281/zenodo.8214376
|
|
167
|
+
:alt: DOI
|
|
168
|
+
|
|
169
|
+
Additionally, we highly encourage you to cite the article that originally introduced
|
|
170
|
+
the Braindecode library and has served as a foundational reference for many works
|
|
171
|
+
on deep learning with EEG recordings. Please use the following reference:
|
|
153
172
|
|
|
154
173
|
.. code-block:: bibtex
|
|
155
174
|
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
.. image:: https://zenodo.org/badge/232335424.svg
|
|
2
|
+
:target: https://doi.org/10.5281/zenodo.8214376
|
|
3
|
+
:alt: DOI
|
|
4
|
+
|
|
1
5
|
.. image:: https://badges.gitter.im/braindecodechat/community.svg
|
|
2
6
|
:alt: Join the chat at https://gitter.im/braindecodechat/community
|
|
3
7
|
:target: https://gitter.im/braindecodechat/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
|
@@ -13,6 +17,7 @@
|
|
|
13
17
|
:target: https://codecov.io/gh/braindecode/braindecode
|
|
14
18
|
:alt: Code Coverage
|
|
15
19
|
|
|
20
|
+
|
|
16
21
|
.. |Braindecode| image:: https://user-images.githubusercontent.com/42702466/177958779-b00628aa-9155-4c51-96d1-d8c345aff575.svg
|
|
17
22
|
.. _braindecode: braindecode.org/
|
|
18
23
|
|
|
@@ -69,7 +74,15 @@ https://gitter.im/braindecodechat/community
|
|
|
69
74
|
Citing
|
|
70
75
|
======
|
|
71
76
|
|
|
72
|
-
If you use
|
|
77
|
+
If you use Braindecode in scientific work, please cite the software using the Zenodo DOI shown in the badge below:
|
|
78
|
+
|
|
79
|
+
.. image:: https://zenodo.org/badge/232335424.svg
|
|
80
|
+
:target: https://doi.org/10.5281/zenodo.8214376
|
|
81
|
+
:alt: DOI
|
|
82
|
+
|
|
83
|
+
Additionally, we highly encourage you to cite the article that originally introduced
|
|
84
|
+
the Braindecode library and has served as a foundational reference for many works
|
|
85
|
+
on deep learning with EEG recordings. Please use the following reference:
|
|
73
86
|
|
|
74
87
|
.. code-block:: bibtex
|
|
75
88
|
|
|
@@ -5,8 +5,10 @@ Utilities for data augmentation.
|
|
|
5
5
|
from . import functional
|
|
6
6
|
from .base import AugmentedDataLoader, Compose, IdentityTransform, Transform
|
|
7
7
|
from .transforms import (
|
|
8
|
+
AmplitudeScale,
|
|
8
9
|
BandstopFilter,
|
|
9
10
|
ChannelsDropout,
|
|
11
|
+
ChannelsReref,
|
|
10
12
|
ChannelsShuffle,
|
|
11
13
|
ChannelsSymmetry,
|
|
12
14
|
FrequencyShift,
|
|
@@ -46,5 +48,7 @@ __all__ = [
|
|
|
46
48
|
"Mixup",
|
|
47
49
|
"SegmentationReconstruction",
|
|
48
50
|
"MaskEncoding",
|
|
51
|
+
"AmplitudeScale",
|
|
52
|
+
"ChannelsReref",
|
|
49
53
|
"functional",
|
|
50
54
|
]
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
import warnings
|
|
10
10
|
|
|
11
|
-
import numpy as np
|
|
12
11
|
from skorch import NeuralNet
|
|
13
12
|
from skorch.callbacks import EpochScoring
|
|
14
13
|
from skorch.classifier import NeuralNetClassifier
|
|
@@ -237,13 +236,9 @@ class EEGClassifier(_EEGNeuralNet, NeuralNetClassifier):
|
|
|
237
236
|
num_workers=self.get_iterator(X, training=False).loader.num_workers,
|
|
238
237
|
)
|
|
239
238
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
assert set(classes_y) <= set(classes)
|
|
244
|
-
else:
|
|
245
|
-
classes = classes_y
|
|
246
|
-
return len(classes)
|
|
239
|
+
@property
|
|
240
|
+
def mode(self):
|
|
241
|
+
return "classification"
|
|
247
242
|
|
|
248
243
|
# Only add the 'accuracy' callback if we are not in cropped mode.
|
|
249
244
|
@property
|
{braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/__init__.py
RENAMED
|
@@ -11,9 +11,11 @@ from .base import (
|
|
|
11
11
|
)
|
|
12
12
|
from .bcicomp import BCICompetitionIVDataset4
|
|
13
13
|
from .bids import BIDSDataset, BIDSEpochsDataset
|
|
14
|
+
from .chb_mit import CHBMIT
|
|
14
15
|
from .mne import create_from_mne_epochs, create_from_mne_raw
|
|
15
16
|
from .moabb import BNCI2014_001, HGD, MOABBDataset
|
|
16
17
|
from .nmt import NMT
|
|
18
|
+
from .siena import SIENA
|
|
17
19
|
from .sleep_physio_challe_18 import SleepPhysionetChallenge2018
|
|
18
20
|
from .sleep_physionet import SleepPhysionet
|
|
19
21
|
from .tuh import TUH, TUHAbnormal
|
|
@@ -34,7 +36,9 @@ __all__ = [
|
|
|
34
36
|
"create_from_mne_epochs",
|
|
35
37
|
"TUH",
|
|
36
38
|
"TUHAbnormal",
|
|
39
|
+
"SIENA",
|
|
37
40
|
"NMT",
|
|
41
|
+
"CHBMIT",
|
|
38
42
|
"SleepPhysionet",
|
|
39
43
|
"SleepPhysionetChallenge2018",
|
|
40
44
|
"create_from_X_y",
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This dataset is a BIDS-compatible version of the CHB-MIT Scalp EEG Database.
|
|
3
|
+
|
|
4
|
+
It reorganizes the file structure to comply with the BIDS specification. To this effect:
|
|
5
|
+
|
|
6
|
+
The data from subject chb21 was moved to sub-01/ses-02.
|
|
7
|
+
Metadata was organized according to BIDS.
|
|
8
|
+
Data in the EEG edf files was modified to keep only the 18 channels from a double banana bipolar montage.
|
|
9
|
+
Annotations were formatted as BIDS-score compatible `tsv` files.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
# Authors: Dan, Jonathan
|
|
13
|
+
# Shoeb, Ali (Data collector)
|
|
14
|
+
# Bruno Aristimunha <b.aristimunha@gmail.com>
|
|
15
|
+
#
|
|
16
|
+
# License: BSD (3-clause)
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
from mne.datasets import fetch_dataset
|
|
22
|
+
|
|
23
|
+
from braindecode.datasets import BIDSDataset
|
|
24
|
+
from braindecode.datasets.utils import _correct_dataset_path
|
|
25
|
+
|
|
26
|
+
CHB_MIT_URL = "https://zenodo.org/records/10259996/files/BIDS_CHB-MIT.zip"
|
|
27
|
+
CHB_MIT_archive_name = "chb_mit_bids.zip"
|
|
28
|
+
CHB_MIT_folder_name = "CHB-MIT-BIDS-eeg-dataset"
|
|
29
|
+
CHB_MIT_dataset_name = "CHB-MIT-EEG-Corpus"
|
|
30
|
+
|
|
31
|
+
CHB_MIT_dataset_params = {
|
|
32
|
+
"dataset_name": CHB_MIT_dataset_name,
|
|
33
|
+
"url": CHB_MIT_URL,
|
|
34
|
+
"archive_name": CHB_MIT_archive_name,
|
|
35
|
+
"folder_name": CHB_MIT_folder_name,
|
|
36
|
+
"hash": "078f4e110e40d10fef1a38a892571ad24666c488e8118a01002c9224909256ed", # sha256
|
|
37
|
+
"config_key": CHB_MIT_dataset_name,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class CHBMIT(BIDSDataset):
|
|
42
|
+
"""The Children's Hospital Boston EEG Dataset.
|
|
43
|
+
|
|
44
|
+
This database, collected at the Children's Hospital Boston, consists of EEG recordings
|
|
45
|
+
from pediatric subjects with intractable seizures. Subjects were monitored for up to
|
|
46
|
+
several days following withdrawal of anti-seizure medication in order to characterize
|
|
47
|
+
their seizures and assess their candidacy for surgical intervention.
|
|
48
|
+
|
|
49
|
+
Description of the contents of the dataset
|
|
50
|
+
|
|
51
|
+
Each folder (sub-01, sub-01, etc.) contains between 9 and 42 continuous .edf
|
|
52
|
+
files from a single subject. Hardware limitations resulted in gaps between
|
|
53
|
+
consecutively-numbered .edf files, during which the signals were not recorded;
|
|
54
|
+
in most cases, the gaps are 10 seconds or less, but occasionally there are much
|
|
55
|
+
longer gaps. In order to protect the privacy of the subjects, all protected health
|
|
56
|
+
information (PHI) in the original .edf files has been replaced with surrogate information
|
|
57
|
+
in the files provided here. Dates in the original .edf files have been replaced by
|
|
58
|
+
surrogate dates, but the time relationships between the individual files belonging
|
|
59
|
+
to each case have been preserved. In most cases, the .edf files contain exactly one
|
|
60
|
+
hour of digitized EEG signals, although those belonging to case sub-10 are two hours
|
|
61
|
+
long, and those belonging to cases sub-04, sub-06, sub-07, sub-09, and sub-23 are
|
|
62
|
+
four hours long; occasionally, files in which seizures are recorded are shorter.
|
|
63
|
+
|
|
64
|
+
The EEG is recorded at 256 Hz with a 16-bit resolution. The recordings are
|
|
65
|
+
referenced in a double banana bipolar montage with 18 channels from the 10-20 electrode system.
|
|
66
|
+
|
|
67
|
+
This BIDS-compatible version of the dataset was published by Jonathan Dan [Dan2025]_
|
|
68
|
+
and is based on the original CHB MIT EEG Database [Guttag2010]_, [Shoeb2009]_.
|
|
69
|
+
|
|
70
|
+
.. versionadded:: 1.3
|
|
71
|
+
|
|
72
|
+
Parameters
|
|
73
|
+
----------
|
|
74
|
+
root : pathlib.Path | str
|
|
75
|
+
The root of the BIDS path.
|
|
76
|
+
subjects : str | array-like of str | None
|
|
77
|
+
The subject ID. Corresponds to "sub".
|
|
78
|
+
sessions : str | array-like of str | None
|
|
79
|
+
The acquisition session. Corresponds to "ses".
|
|
80
|
+
tasks : str | array-like of str | None
|
|
81
|
+
The experimental task. Corresponds to "task".
|
|
82
|
+
acquisitions: str | array-like of str | None
|
|
83
|
+
The acquisition parameters. Corresponds to "acq".
|
|
84
|
+
runs : str | array-like of str | None
|
|
85
|
+
The run number. Corresponds to "run".
|
|
86
|
+
processings : str | array-like of str | None
|
|
87
|
+
The processing label. Corresponds to "proc".
|
|
88
|
+
recordings : str | array-like of str | None
|
|
89
|
+
The recording name. Corresponds to "rec".
|
|
90
|
+
spaces : str | array-like of str | None
|
|
91
|
+
The coordinate space for anatomical and sensor location
|
|
92
|
+
files (e.g., ``*_electrodes.tsv``, ``*_markers.mrk``).
|
|
93
|
+
Corresponds to "space".
|
|
94
|
+
Note that valid values for ``space`` must come from a list
|
|
95
|
+
of BIDS keywords as described in the BIDS specification.
|
|
96
|
+
splits : str | array-like of str | None
|
|
97
|
+
The split of the continuous recording file for ``.fif`` data.
|
|
98
|
+
Corresponds to "split".
|
|
99
|
+
descriptions : str | array-like of str | None
|
|
100
|
+
This corresponds to the BIDS entity ``desc``. It is used to provide
|
|
101
|
+
additional information for derivative data, e.g., preprocessed data
|
|
102
|
+
may be assigned ``description='cleaned'``.
|
|
103
|
+
suffixes : str | array-like of str | None
|
|
104
|
+
The filename suffix. This is the entity after the
|
|
105
|
+
last ``_`` before the extension. E.g., ``'channels'``.
|
|
106
|
+
The following filename suffix's are accepted:
|
|
107
|
+
'meg', 'markers', 'eeg', 'ieeg', 'T1w',
|
|
108
|
+
'participants', 'scans', 'electrodes', 'coordsystem',
|
|
109
|
+
'channels', 'events', 'headshape', 'digitizer',
|
|
110
|
+
'beh', 'physio', 'stim'
|
|
111
|
+
extensions : str | array-like of str | None
|
|
112
|
+
The extension of the filename. E.g., ``'.json'``.
|
|
113
|
+
By default, uses the ones accepted by :func:`mne_bids.read_raw_bids`.
|
|
114
|
+
datatypes : str | array-like of str | None
|
|
115
|
+
The BIDS data type, e.g., ``'anat'``, ``'func'``, ``'eeg'``, ``'meg'``,
|
|
116
|
+
``'ieeg'``.
|
|
117
|
+
check : bool
|
|
118
|
+
If ``True``, only returns paths that conform to BIDS. If ``False``
|
|
119
|
+
(default), the ``.check`` attribute of the returned
|
|
120
|
+
:class:`mne_bids.BIDSPath` object will be set to ``True`` for paths that
|
|
121
|
+
do conform to BIDS, and to ``False`` for those that don't.
|
|
122
|
+
preload : bool
|
|
123
|
+
If True, preload the data. Defaults to False.
|
|
124
|
+
n_jobs : int
|
|
125
|
+
Number of jobs to run in parallel. Defaults to 1.
|
|
126
|
+
|
|
127
|
+
References
|
|
128
|
+
----------
|
|
129
|
+
.. [Guttag2010] Guttag, J. (2010). CHB-MIT Scalp EEG Database (version 1.0.0).
|
|
130
|
+
PhysioNet. RRID:SCR_007345. https://doi.org/10.13026/C2K01R
|
|
131
|
+
.. [Shoeb2009] Ali Shoeb. Application of Machine Learning to Epileptic
|
|
132
|
+
Seizure Onset Detection and Treatment. PhD Thesis,
|
|
133
|
+
Massachusetts Institute of Technology, September 2009.
|
|
134
|
+
.. [Dan2025] Dan, J., Pale, U., Amirshahi, A., Cappelletti, W.,
|
|
135
|
+
Ingolfsson, T. M., Wang, X., ... & Ryvlin, P. (2025).
|
|
136
|
+
SzCORE: seizure community open-source research evaluatio
|
|
137
|
+
framework for the validation of electroencephalography-based
|
|
138
|
+
automated seizure detection algorithms. Epilepsia, 66, 14-24.
|
|
139
|
+
"""
|
|
140
|
+
|
|
141
|
+
def __init__(self, root=None, *args, **kwargs):
|
|
142
|
+
# Download dataset if not present
|
|
143
|
+
if root is None:
|
|
144
|
+
path_root = fetch_dataset(
|
|
145
|
+
dataset_params=CHB_MIT_dataset_params,
|
|
146
|
+
path=None,
|
|
147
|
+
processor="unzip",
|
|
148
|
+
force_update=False,
|
|
149
|
+
)
|
|
150
|
+
# First time we fetch the dataset, we need to move the files to the
|
|
151
|
+
# correct directory.
|
|
152
|
+
path_root = _correct_dataset_path(
|
|
153
|
+
path_root, CHB_MIT_archive_name, "BIDS_CHB-MIT"
|
|
154
|
+
)
|
|
155
|
+
else:
|
|
156
|
+
# Validate that the provided root is a valid BIDS dataset
|
|
157
|
+
if not Path(f"{root}/participants.tsv").exists():
|
|
158
|
+
raise ValueError(
|
|
159
|
+
f"The provided root directory {root} does not contain a valid "
|
|
160
|
+
"BIDS dataset (missing participants.tsv). Please ensure the "
|
|
161
|
+
"root points directly to the BIDS dataset directory."
|
|
162
|
+
)
|
|
163
|
+
path_root = root
|
|
164
|
+
|
|
165
|
+
kwargs["root"] = path_root
|
|
166
|
+
|
|
167
|
+
super().__init__(
|
|
168
|
+
*args,
|
|
169
|
+
extensions=".edf",
|
|
170
|
+
check=False,
|
|
171
|
+
**kwargs,
|
|
172
|
+
)
|
{braindecode-1.3.0.dev169361694 → braindecode-1.3.0.dev169765289}/braindecode/datasets/hub.py
RENAMED
|
@@ -21,18 +21,9 @@ import mne
|
|
|
21
21
|
import numpy as np
|
|
22
22
|
import pandas as pd
|
|
23
23
|
import scipy
|
|
24
|
+
from mne._fiff.meas_info import Info
|
|
24
25
|
from mne.utils import _soft_import
|
|
25
26
|
|
|
26
|
-
# TODO: Simplify this logic in the future with zarr v3+ only
|
|
27
|
-
# Optional imports for Hub functionality
|
|
28
|
-
try:
|
|
29
|
-
from numcodecs import Blosc, GZip, Zstd
|
|
30
|
-
|
|
31
|
-
NUMCODECS_AVAILABLE = True
|
|
32
|
-
except ImportError:
|
|
33
|
-
NUMCODECS_AVAILABLE = False
|
|
34
|
-
Blosc = GZip = Zstd = None
|
|
35
|
-
|
|
36
27
|
if TYPE_CHECKING:
|
|
37
28
|
from .base import BaseDataset
|
|
38
29
|
|
|
@@ -397,9 +388,8 @@ class HubDatasetMixin:
|
|
|
397
388
|
f"{output_path} already exists. Set overwrite=True to replace it."
|
|
398
389
|
)
|
|
399
390
|
|
|
400
|
-
# Create zarr store (zarr
|
|
401
|
-
|
|
402
|
-
root = zarr.group(store=store, overwrite=False)
|
|
391
|
+
# Create zarr store (zarr v3 API)
|
|
392
|
+
root = zarr.open(str(output_path), mode="w")
|
|
403
393
|
|
|
404
394
|
# Validate uniformity across all datasets using shared validation
|
|
405
395
|
dataset_type, _, _ = hub_validation.validate_dataset_uniformity(self.datasets)
|
|
@@ -444,7 +434,7 @@ class HubDatasetMixin:
|
|
|
444
434
|
data = ds.windows.get_data()
|
|
445
435
|
metadata = ds.windows.metadata
|
|
446
436
|
description = ds.description
|
|
447
|
-
info_dict =
|
|
437
|
+
info_dict = ds.windows.info.to_json_dict()
|
|
448
438
|
target_name = ds.target_name if hasattr(ds, "target_name") else None
|
|
449
439
|
|
|
450
440
|
# Save using inlined function
|
|
@@ -457,7 +447,7 @@ class HubDatasetMixin:
|
|
|
457
447
|
raw = ds.raw
|
|
458
448
|
metadata = ds.metadata
|
|
459
449
|
description = ds.description
|
|
460
|
-
info_dict =
|
|
450
|
+
info_dict = ds.raw.info.to_json_dict()
|
|
461
451
|
targets_from = ds.targets_from
|
|
462
452
|
last_target_only = ds.last_target_only
|
|
463
453
|
|
|
@@ -477,7 +467,7 @@ class HubDatasetMixin:
|
|
|
477
467
|
# Get continuous raw data from RawDataset
|
|
478
468
|
raw = ds.raw
|
|
479
469
|
description = ds.description
|
|
480
|
-
info_dict =
|
|
470
|
+
info_dict = ds.raw.info.to_json_dict()
|
|
481
471
|
target_name = ds.target_name if hasattr(ds, "target_name") else None
|
|
482
472
|
|
|
483
473
|
# Save using inlined function
|
|
@@ -530,9 +520,8 @@ class HubDatasetMixin:
|
|
|
530
520
|
if not input_path.exists():
|
|
531
521
|
raise FileNotFoundError(f"{input_path} does not exist.")
|
|
532
522
|
|
|
533
|
-
# Open zarr store (zarr
|
|
534
|
-
|
|
535
|
-
root = zarr.group(store=store)
|
|
523
|
+
# Open zarr store (zarr v3 API)
|
|
524
|
+
root = zarr.open(str(input_path), mode="r")
|
|
536
525
|
|
|
537
526
|
n_datasets = root.attrs["n_datasets"]
|
|
538
527
|
dataset_type = root.attrs["dataset_type"]
|
|
@@ -554,7 +543,7 @@ class HubDatasetMixin:
|
|
|
554
543
|
)
|
|
555
544
|
|
|
556
545
|
# Convert to MNE objects and create dataset
|
|
557
|
-
info =
|
|
546
|
+
info = Info.from_json_dict(info_dict)
|
|
558
547
|
events = np.column_stack(
|
|
559
548
|
[
|
|
560
549
|
metadata["i_start_in_trial"].values,
|
|
@@ -580,7 +569,7 @@ class HubDatasetMixin:
|
|
|
580
569
|
|
|
581
570
|
# Convert to MNE objects and create dataset
|
|
582
571
|
# Data is already in continuous format [n_channels, n_timepoints]
|
|
583
|
-
info =
|
|
572
|
+
info = Info.from_json_dict(info_dict)
|
|
584
573
|
raw = mne.io.RawArray(data, info)
|
|
585
574
|
ds = EEGWindowsDataset(
|
|
586
575
|
raw=raw,
|
|
@@ -598,7 +587,7 @@ class HubDatasetMixin:
|
|
|
598
587
|
|
|
599
588
|
# Convert to MNE objects and create dataset
|
|
600
589
|
# Data is in continuous format [n_channels, n_timepoints]
|
|
601
|
-
info =
|
|
590
|
+
info = Info.from_json_dict(info_dict)
|
|
602
591
|
raw = mne.io.RawArray(data, info)
|
|
603
592
|
ds = RawDataset(raw, description)
|
|
604
593
|
if target_name is not None:
|
|
@@ -632,48 +621,22 @@ class HubDatasetMixin:
|
|
|
632
621
|
# =============================================================================
|
|
633
622
|
|
|
634
623
|
|
|
635
|
-
# TODO: remove when this MNE is solved https://github.com/mne-tools/mne-python/issues/13487
|
|
636
|
-
def _mne_info_to_dict(info):
|
|
637
|
-
"""Convert MNE Info object to dictionary for JSON serialization."""
|
|
638
|
-
return {
|
|
639
|
-
"ch_names": info["ch_names"],
|
|
640
|
-
"sfreq": float(info["sfreq"]),
|
|
641
|
-
"ch_types": [str(ch_type) for ch_type in info.get_channel_types()],
|
|
642
|
-
"lowpass": float(info["lowpass"]) if info["lowpass"] is not None else None,
|
|
643
|
-
"highpass": float(info["highpass"]) if info["highpass"] is not None else None,
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
def _dict_to_mne_info(info_dict):
|
|
648
|
-
"""Convert dictionary back to MNE Info object."""
|
|
649
|
-
info = mne.create_info(
|
|
650
|
-
ch_names=info_dict["ch_names"],
|
|
651
|
-
sfreq=info_dict["sfreq"],
|
|
652
|
-
ch_types=info_dict["ch_types"],
|
|
653
|
-
)
|
|
654
|
-
|
|
655
|
-
# Use _unlock() to set filter info when reconstructing from saved metadata
|
|
656
|
-
# This is necessary because MNE protects these fields to prevent users from
|
|
657
|
-
# setting filter parameters without actually filtering the data
|
|
658
|
-
with info._unlock():
|
|
659
|
-
if info_dict.get("lowpass") is not None:
|
|
660
|
-
info["lowpass"] = info_dict["lowpass"]
|
|
661
|
-
if info_dict.get("highpass") is not None:
|
|
662
|
-
info["highpass"] = info_dict["highpass"]
|
|
663
|
-
|
|
664
|
-
return info
|
|
665
|
-
|
|
666
|
-
|
|
667
624
|
def _save_windows_to_zarr(
|
|
668
625
|
grp, data, metadata, description, info, compressor, target_name
|
|
669
626
|
):
|
|
670
627
|
"""Save windowed data to Zarr group (low-level function)."""
|
|
671
628
|
# Save data with chunking for random access
|
|
672
|
-
|
|
629
|
+
# In Zarr v3, use create_array with compressors parameter
|
|
630
|
+
data_array = data.astype(np.float32)
|
|
631
|
+
|
|
632
|
+
# Zarr v3 expects compressors as a list
|
|
633
|
+
compressors_list = [compressor] if compressor is not None else None
|
|
634
|
+
|
|
635
|
+
grp.create_array(
|
|
673
636
|
"data",
|
|
674
|
-
data=
|
|
675
|
-
chunks=(1,
|
|
676
|
-
|
|
637
|
+
data=data_array,
|
|
638
|
+
chunks=(1, data_array.shape[1], data_array.shape[2]),
|
|
639
|
+
compressors=compressors_list,
|
|
677
640
|
)
|
|
678
641
|
|
|
679
642
|
# Save metadata
|
|
@@ -704,11 +667,17 @@ def _save_eegwindows_to_zarr(
|
|
|
704
667
|
|
|
705
668
|
# Save continuous data with chunking optimized for window extraction
|
|
706
669
|
# Chunk size: all channels, 10000 timepoints for efficient random access
|
|
707
|
-
|
|
670
|
+
# In Zarr v3, use create_array with compressors parameter
|
|
671
|
+
continuous_float = continuous_data.astype(np.float32)
|
|
672
|
+
|
|
673
|
+
# Zarr v3 expects compressors as a list
|
|
674
|
+
compressors_list = [compressor] if compressor is not None else None
|
|
675
|
+
|
|
676
|
+
grp.create_array(
|
|
708
677
|
"data",
|
|
709
|
-
data=
|
|
710
|
-
chunks=(
|
|
711
|
-
|
|
678
|
+
data=continuous_float,
|
|
679
|
+
chunks=(continuous_float.shape[0], min(10000, continuous_float.shape[1])),
|
|
680
|
+
compressors=compressors_list,
|
|
712
681
|
)
|
|
713
682
|
|
|
714
683
|
# Save metadata
|
|
@@ -803,11 +772,17 @@ def _save_raw_to_zarr(grp, raw, description, info, target_name, compressor):
|
|
|
803
772
|
|
|
804
773
|
# Save continuous data with chunking optimized for efficient access
|
|
805
774
|
# Chunk size: all channels, 10000 timepoints for efficient random access
|
|
806
|
-
|
|
775
|
+
# In Zarr v3, use create_array with compressors parameter
|
|
776
|
+
continuous_float = continuous_data.astype(np.float32)
|
|
777
|
+
|
|
778
|
+
# Zarr v3 expects compressors as a list
|
|
779
|
+
compressors_list = [compressor] if compressor is not None else None
|
|
780
|
+
|
|
781
|
+
grp.create_array(
|
|
807
782
|
"data",
|
|
808
|
-
data=
|
|
809
|
-
chunks=(
|
|
810
|
-
|
|
783
|
+
data=continuous_float,
|
|
784
|
+
chunks=(continuous_float.shape[0], min(10000, continuous_float.shape[1])),
|
|
785
|
+
compressors=compressors_list,
|
|
811
786
|
)
|
|
812
787
|
|
|
813
788
|
# Save description
|
|
@@ -849,27 +824,35 @@ def _load_raw_from_zarr(grp, preload):
|
|
|
849
824
|
|
|
850
825
|
|
|
851
826
|
def _create_compressor(compression, compression_level):
|
|
852
|
-
"""Create a Zarr compressor
|
|
827
|
+
"""Create a Zarr v3 compressor codec.
|
|
828
|
+
|
|
829
|
+
Returns compressor dict compatible with Zarr v3 create_array API.
|
|
830
|
+
|
|
831
|
+
Parameters
|
|
832
|
+
----------
|
|
833
|
+
compression : str or None
|
|
834
|
+
Compression algorithm: "blosc", "zstd", "gzip", or None.
|
|
835
|
+
compression_level : int
|
|
836
|
+
Compression level (0-9).
|
|
837
|
+
|
|
838
|
+
Returns
|
|
839
|
+
-------
|
|
840
|
+
dict or None
|
|
841
|
+
Compressor configuration dict or None if no compression.
|
|
842
|
+
"""
|
|
853
843
|
if zarr is False:
|
|
854
844
|
raise ImportError(
|
|
855
845
|
"Zarr is not installed. Install with: pip install braindecode[hub]"
|
|
856
846
|
)
|
|
857
847
|
|
|
858
|
-
if not
|
|
859
|
-
raise ImportError(
|
|
860
|
-
"numcodecs is not installed. Install with: pip install braindecode[hub]"
|
|
861
|
-
)
|
|
862
|
-
|
|
863
|
-
# Zarr v2 uses numcodecs compressors
|
|
864
|
-
if compression == "blosc":
|
|
865
|
-
return Blosc(cname="zstd", clevel=compression_level)
|
|
866
|
-
elif compression == "zstd":
|
|
867
|
-
return Zstd(level=compression_level)
|
|
868
|
-
elif compression == "gzip":
|
|
869
|
-
return GZip(level=compression_level)
|
|
870
|
-
else:
|
|
848
|
+
if compression is None or compression not in ("blosc", "zstd", "gzip"):
|
|
871
849
|
return None
|
|
872
850
|
|
|
851
|
+
# Map blosc to zstd (Zarr v3 uses zstd as the primary implementation)
|
|
852
|
+
name = "zstd" if compression == "blosc" else compression
|
|
853
|
+
|
|
854
|
+
return {"name": name, "configuration": {"level": compression_level}}
|
|
855
|
+
|
|
873
856
|
|
|
874
857
|
# TODO: improve content
|
|
875
858
|
def _generate_readme_content(
|