Braindecode 1.3.0.dev176089716__tar.gz → 1.3.0.dev176122045__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.
Files changed (144) hide show
  1. {braindecode-1.3.0.dev176089716/braindecode.egg-info → braindecode-1.3.0.dev176122045}/PKG-INFO +1 -1
  2. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/__init__.py +0 -2
  3. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/summary.csv +0 -1
  4. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/util.py +0 -1
  5. braindecode-1.3.0.dev176122045/braindecode/preprocessing/__init__.py +61 -0
  6. braindecode-1.3.0.dev176122045/braindecode/preprocessing/mne_preprocess.py +77 -0
  7. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/preprocessing/preprocess.py +6 -16
  8. braindecode-1.3.0.dev176122045/braindecode/version.py +1 -0
  9. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045/braindecode.egg-info}/PKG-INFO +1 -1
  10. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode.egg-info/SOURCES.txt +0 -1
  11. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/api.rst +17 -107
  12. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/conf.py +0 -27
  13. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/whats_new.rst +0 -4
  14. braindecode-1.3.0.dev176089716/braindecode/models/medformer.py +0 -758
  15. braindecode-1.3.0.dev176089716/braindecode/preprocessing/__init__.py +0 -266
  16. braindecode-1.3.0.dev176089716/braindecode/preprocessing/mne_preprocess.py +0 -209
  17. braindecode-1.3.0.dev176089716/braindecode/version.py +0 -1
  18. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/LICENSE.txt +0 -0
  19. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/MANIFEST.in +0 -0
  20. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/NOTICE.txt +0 -0
  21. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/README.rst +0 -0
  22. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/__init__.py +0 -0
  23. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/augmentation/__init__.py +0 -0
  24. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/augmentation/base.py +0 -0
  25. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/augmentation/functional.py +0 -0
  26. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/augmentation/transforms.py +0 -0
  27. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/classifier.py +0 -0
  28. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/__init__.py +0 -0
  29. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/base.py +0 -0
  30. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/bbci.py +0 -0
  31. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/bcicomp.py +0 -0
  32. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/bids.py +0 -0
  33. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/experimental.py +0 -0
  34. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/mne.py +0 -0
  35. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/moabb.py +0 -0
  36. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/nmt.py +0 -0
  37. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
  38. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/sleep_physionet.py +0 -0
  39. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/tuh.py +0 -0
  40. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datasets/xy.py +0 -0
  41. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datautil/__init__.py +0 -0
  42. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datautil/channel_utils.py +0 -0
  43. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datautil/serialization.py +0 -0
  44. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/datautil/util.py +0 -0
  45. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/eegneuralnet.py +0 -0
  46. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/functional/__init__.py +0 -0
  47. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/functional/functions.py +0 -0
  48. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/functional/initialization.py +0 -0
  49. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/atcnet.py +0 -0
  50. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/attentionbasenet.py +0 -0
  51. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/attn_sleep.py +0 -0
  52. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/base.py +0 -0
  53. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/bendr.py +0 -0
  54. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/biot.py +0 -0
  55. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/contrawr.py +0 -0
  56. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/ctnet.py +0 -0
  57. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/deep4.py +0 -0
  58. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/deepsleepnet.py +0 -0
  59. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eegconformer.py +0 -0
  60. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eeginception_erp.py +0 -0
  61. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eeginception_mi.py +0 -0
  62. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eegitnet.py +0 -0
  63. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eegminer.py +0 -0
  64. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eegnet.py +0 -0
  65. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eegnex.py +0 -0
  66. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eegsimpleconv.py +0 -0
  67. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eegsym.py +0 -0
  68. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/eegtcnet.py +0 -0
  69. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/fbcnet.py +0 -0
  70. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/fblightconvnet.py +0 -0
  71. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/fbmsnet.py +0 -0
  72. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/hybrid.py +0 -0
  73. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/ifnet.py +0 -0
  74. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/labram.py +0 -0
  75. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/msvtnet.py +0 -0
  76. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/patchedtransformer.py +0 -0
  77. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/sccnet.py +0 -0
  78. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/shallow_fbcsp.py +0 -0
  79. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/signal_jepa.py +0 -0
  80. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/sinc_shallow.py +0 -0
  81. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
  82. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
  83. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/sparcnet.py +0 -0
  84. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/sstdpn.py +0 -0
  85. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/syncnet.py +0 -0
  86. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/tcn.py +0 -0
  87. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/tidnet.py +0 -0
  88. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/tsinception.py +0 -0
  89. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/models/usleep.py +0 -0
  90. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/__init__.py +0 -0
  91. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/activation.py +0 -0
  92. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/attention.py +0 -0
  93. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/blocks.py +0 -0
  94. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/convolution.py +0 -0
  95. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/filter.py +0 -0
  96. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/layers.py +0 -0
  97. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/linear.py +0 -0
  98. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/parametrization.py +0 -0
  99. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/stats.py +0 -0
  100. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/util.py +0 -0
  101. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/modules/wrapper.py +0 -0
  102. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
  103. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/preprocessing/util.py +0 -0
  104. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/preprocessing/windowers.py +0 -0
  105. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/regressor.py +0 -0
  106. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/samplers/__init__.py +0 -0
  107. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/samplers/base.py +0 -0
  108. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/samplers/ssl.py +0 -0
  109. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/training/__init__.py +0 -0
  110. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/training/callbacks.py +0 -0
  111. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/training/losses.py +0 -0
  112. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/training/scoring.py +0 -0
  113. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/util.py +0 -0
  114. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/visualization/__init__.py +0 -0
  115. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/visualization/confusion_matrices.py +0 -0
  116. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode/visualization/gradients.py +0 -0
  117. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode.egg-info/dependency_links.txt +0 -0
  118. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode.egg-info/requires.txt +0 -0
  119. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/braindecode.egg-info/top_level.txt +0 -0
  120. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/Makefile +0 -0
  121. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/_templates/autosummary/class.rst +0 -0
  122. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/_templates/autosummary/function.rst +0 -0
  123. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/cite.rst +0 -0
  124. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/help.rst +0 -0
  125. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/index.rst +0 -0
  126. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/install/install.rst +0 -0
  127. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/install/install_pip.rst +0 -0
  128. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/install/install_source.rst +0 -0
  129. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/attention.rst +0 -0
  130. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/channel.rst +0 -0
  131. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/convolution.rst +0 -0
  132. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/filterbank.rst +0 -0
  133. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/gnn.rst +0 -0
  134. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/interpretable.rst +0 -0
  135. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/lbm.rst +0 -0
  136. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/recurrent.rst +0 -0
  137. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/categorization/spd.rst +0 -0
  138. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/models.rst +0 -0
  139. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/models_categorization.rst +0 -0
  140. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/models_table.rst +0 -0
  141. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/models/models_visualization.rst +0 -0
  142. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/docs/sg_execution_times.rst +0 -0
  143. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/pyproject.toml +0 -0
  144. {braindecode-1.3.0.dev176089716 → braindecode-1.3.0.dev176122045}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 1.3.0.dev176089716
3
+ Version: 1.3.0.dev176122045
4
4
  Summary: Deep learning software to decode EEG, ECG or MEG signals
5
5
  Author-email: Robin Tibor Schirrmeister <robintibor@gmail.com>
6
6
  Maintainer-email: Alexandre Gramfort <agramfort@meta.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Robin Tibor Schirrmeister <robintibor@gmail.com>
@@ -28,7 +28,6 @@ from .fbmsnet import FBMSNet
28
28
  from .hybrid import HybridNet
29
29
  from .ifnet import IFNet
30
30
  from .labram import Labram
31
- from .medformer import MEDFormer
32
31
  from .msvtnet import MSVTNet
33
32
  from .patchedtransformer import PBT
34
33
  from .sccnet import SCCNet
@@ -83,7 +82,6 @@ __all__ = [
83
82
  "HybridNet",
84
83
  "IFNet",
85
84
  "Labram",
86
- "MEDFormer",
87
85
  "MSVTNet",
88
86
  "PBT",
89
87
  "SCCNet",
@@ -41,4 +41,3 @@ IFNet,Motor Imagery,Classification,250,"n_chans, n_outputs, n_times, sfreq",9860
41
41
  PBT,General,Classification,250,"n_chans, n_outputs, n_times",818948,"PBT(n_chans=22, n_outputs=4, n_times=1000, sfreq=250)","Large Brain Model"
42
42
  SSTDPN,Motor Imagery,Classification,250,"n_chans, n_outputs, n_times",19502,"SSTDPN(n_chans=22, n_outputs=4, n_times=1000)","Convolution,Small Attention"
43
43
  BENDR,General,"Classification,Embedding",250,"n_chans, n_times, n_outputs",157141049,"BENDR(n_chans=22, n_outputs=4, n_times=1000)","Large Brain Model,Convolution"
44
- MEDFormer,General,Classification,250,"n_chans, n_outputs, n_times",5313924,"MEDFormer(n_chans=22, n_outputs=4, n_times=1000)","Large Brain Model,Convolution"
@@ -99,7 +99,6 @@ models_mandatory_parameters = [
99
99
  ("PBT", ["n_chans", "n_outputs", "n_times"], None),
100
100
  ("SSTDPN", ["n_chans", "n_outputs", "n_times", "sfreq"], None),
101
101
  ("BENDR", ["n_chans", "n_outputs", "n_times"], None),
102
- ("MEDFormer", ["n_chans", "n_outputs", "n_times"], None),
103
102
  ]
104
103
 
105
104
  ################################################################
@@ -0,0 +1,61 @@
1
+ from .eegprep_preprocess import (
2
+ EEGPrep,
3
+ ReinterpolateRemovedChannels,
4
+ RemoveBadChannels,
5
+ RemoveBadChannelsNoLocs,
6
+ RemoveBadWindows,
7
+ RemoveBursts,
8
+ RemoveCommonAverageReference,
9
+ RemoveDCOffset,
10
+ RemoveDrifts,
11
+ RemoveFlatChannels,
12
+ Resampling,
13
+ )
14
+ from .mne_preprocess import ( # type: ignore[attr-defined]
15
+ Crop,
16
+ DropChannels,
17
+ Filter,
18
+ Pick,
19
+ Resample,
20
+ SetEEGReference,
21
+ )
22
+ from .preprocess import (
23
+ Preprocessor,
24
+ exponential_moving_demean,
25
+ exponential_moving_standardize,
26
+ filterbank,
27
+ preprocess,
28
+ )
29
+ from .windowers import (
30
+ create_fixed_length_windows,
31
+ create_windows_from_events,
32
+ create_windows_from_target_channels,
33
+ )
34
+
35
+ __all__ = [
36
+ "exponential_moving_demean",
37
+ "exponential_moving_standardize",
38
+ "filterbank",
39
+ "preprocess",
40
+ "Preprocessor",
41
+ "Resample",
42
+ "DropChannels",
43
+ "SetEEGReference",
44
+ "Filter",
45
+ "Pick",
46
+ "Crop",
47
+ "EEGPrep",
48
+ "RemoveDCOffset",
49
+ "Resampling",
50
+ "RemoveFlatChannels",
51
+ "RemoveDrifts",
52
+ "RemoveBadChannels",
53
+ "RemoveBadChannelsNoLocs",
54
+ "RemoveBursts",
55
+ "RemoveBadWindows",
56
+ "ReinterpolateRemovedChannels",
57
+ "RemoveCommonAverageReference",
58
+ "create_windows_from_events",
59
+ "create_fixed_length_windows",
60
+ "create_windows_from_target_channels",
61
+ ]
@@ -0,0 +1,77 @@
1
+ """Preprocessor objects based on mne methods."""
2
+
3
+ # Authors: Bruna Lopes <brunajaflopes@gmail.com>
4
+ # Bruno Aristimunha <b.aristimunha@gmail.com>
5
+ #
6
+ # License: BSD-3
7
+ import inspect
8
+
9
+ import mne.io
10
+
11
+ from braindecode.preprocessing.preprocess import Preprocessor
12
+ from braindecode.util import _update_moabb_docstring
13
+
14
+
15
+ def _generate_init_method(func):
16
+ """
17
+ Generate an __init__ method for a class based on the function's signature.
18
+ """
19
+ parameters = list(inspect.signature(func).parameters.values())
20
+ param_names = [param.name for param in parameters]
21
+
22
+ def init_method(self, *args, **kwargs):
23
+ for name, value in zip(param_names, args):
24
+ setattr(self, name, value)
25
+ for name, value in kwargs.items():
26
+ setattr(self, name, value)
27
+ self.kwargs = kwargs
28
+
29
+ init_method.__signature__ = inspect.signature(func)
30
+ return init_method
31
+
32
+
33
+ def _generate_mne_pre_processor(function):
34
+ """
35
+ Generate a class based on an MNE function for preprocessing.
36
+ """
37
+ class_name = "".join(word.title() for word in function.__name__.split("_")).replace(
38
+ "Eeg", "EEG"
39
+ )
40
+ import_path = f"{function.__module__}.{function.__name__}"
41
+ doc = f" See more details in {import_path}"
42
+
43
+ base_classes = (Preprocessor,)
44
+ class_attrs = {
45
+ "__init__": _generate_init_method(function),
46
+ "__doc__": _update_moabb_docstring(function, doc),
47
+ "fn": function.__name__,
48
+ }
49
+ generated_class = type(class_name, base_classes, class_attrs)
50
+
51
+ return generated_class
52
+
53
+
54
+ # List of MNE functions to generate classes for
55
+ mne_functions = [
56
+ mne.filter.resample,
57
+ mne.io.Raw.drop_channels,
58
+ mne.io.Raw.filter,
59
+ mne.io.Raw.crop,
60
+ mne.io.Raw.pick,
61
+ mne.io.Raw.set_eeg_reference,
62
+ ]
63
+
64
+ # Automatically generate and add classes to the global namespace
65
+ for function in mne_functions:
66
+ class_obj = _generate_mne_pre_processor(function)
67
+ globals()[class_obj.__name__] = class_obj
68
+
69
+ # Define __all__ based on the generated class names
70
+ __all__ = [
71
+ class_obj.__name__
72
+ for class_obj in globals().values()
73
+ if isinstance(class_obj, type)
74
+ ]
75
+
76
+ # Clean up unnecessary variables
77
+ del mne_functions, function, class_obj
@@ -85,7 +85,7 @@ class Preprocessor(object):
85
85
 
86
86
  def apply(self, raw_or_epochs: BaseRaw | BaseEpochs):
87
87
  try:
88
- return self._try_apply(raw_or_epochs)
88
+ self._try_apply(raw_or_epochs)
89
89
  except RuntimeError:
90
90
  # Maybe the function needs the data to be loaded and the data was
91
91
  # not loaded yet. Not all MNE functions need data to be loaded,
@@ -93,20 +93,15 @@ class Preprocessor(object):
93
93
  # without preloading data which can make the overall preprocessing
94
94
  # pipeline substantially faster.
95
95
  raw_or_epochs.load_data()
96
- return self._try_apply(raw_or_epochs)
96
+ self._try_apply(raw_or_epochs)
97
97
 
98
98
  def _try_apply(self, raw_or_epochs):
99
99
  if callable(self.fn):
100
- result = self.fn(raw_or_epochs, **self.kwargs)
101
- # For standalone functions that return a new object, propagate it back
102
- if result is not None and result is not raw_or_epochs:
103
- return result
104
- return raw_or_epochs
100
+ self.fn(raw_or_epochs, **self.kwargs)
105
101
  else:
106
102
  if not hasattr(raw_or_epochs, self.fn):
107
103
  raise AttributeError(f"MNE object does not have a {self.fn} method.")
108
104
  getattr(raw_or_epochs, self.fn)(**self.kwargs)
109
- return raw_or_epochs
110
105
 
111
106
 
112
107
  def preprocess(
@@ -256,21 +251,16 @@ def _preprocess(
256
251
  if raw_or_epochs.preload and copy_data:
257
252
  raw_or_epochs._data = raw_or_epochs._data.copy()
258
253
  for preproc in preprocessors:
259
- raw_or_epochs = preproc.apply(raw_or_epochs)
260
- return raw_or_epochs
254
+ preproc.apply(raw_or_epochs)
261
255
 
262
256
  if hasattr(ds, "raw"):
263
257
  if isinstance(ds, EEGWindowsDataset):
264
258
  warn(
265
259
  f"Applying preprocessors {preprocessors} to the mne.io.Raw of an EEGWindowsDataset."
266
260
  )
267
- processed = _preprocess_raw_or_epochs(ds.raw, preprocessors)
268
- if processed is not ds.raw:
269
- ds.raw = processed
261
+ _preprocess_raw_or_epochs(ds.raw, preprocessors)
270
262
  elif hasattr(ds, "windows"):
271
- processed = _preprocess_raw_or_epochs(ds.windows, preprocessors)
272
- if processed is not ds.windows:
273
- ds.windows = processed
263
+ _preprocess_raw_or_epochs(ds.windows, preprocessors)
274
264
  else:
275
265
  raise ValueError(
276
266
  "Can only preprocess concatenation of RecordDataset, "
@@ -0,0 +1 @@
1
+ __version__ = "1.3.0.dev176122045"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 1.3.0.dev176089716
3
+ Version: 1.3.0.dev176122045
4
4
  Summary: Deep learning software to decode EEG, ECG or MEG signals
5
5
  Author-email: Robin Tibor Schirrmeister <robintibor@gmail.com>
6
6
  Maintainer-email: Alexandre Gramfort <agramfort@meta.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Robin Tibor Schirrmeister <robintibor@gmail.com>
@@ -66,7 +66,6 @@ braindecode/models/fbmsnet.py
66
66
  braindecode/models/hybrid.py
67
67
  braindecode/models/ifnet.py
68
68
  braindecode/models/labram.py
69
- braindecode/models/medformer.py
70
69
  braindecode/models/msvtnet.py
71
70
  braindecode/models/patchedtransformer.py
72
71
  braindecode/models/sccnet.py
@@ -80,7 +80,6 @@ save and load models from the Hugging Face Hub, if the ``braindecode[hug]`` pack
80
80
  FBMSNet
81
81
  IFNet
82
82
  Labram
83
- MEDFormer
84
83
  MSVTNet
85
84
  PBT
86
85
  SCCNet
@@ -365,28 +364,37 @@ Preprocessing
365
364
 
366
365
  .. currentmodule:: braindecode.preprocessing
367
366
 
368
- Core Functions
369
- ''''''''''''''
370
-
371
367
  .. autosummary::
372
368
  :toctree: generated/
373
369
 
374
- preprocess
375
- Preprocessor
376
370
  create_windows_from_events
377
371
  create_fixed_length_windows
378
372
  create_windows_from_target_channels
379
373
  exponential_moving_demean
380
374
  exponential_moving_standardize
381
375
  filterbank
376
+ preprocess
377
+ Preprocessor
378
+ EEGPrep
382
379
 
383
- EEGPrep Pipeline
384
- ''''''''''''''''
380
+
381
+ Preprocessing Transform
382
+ ''''''''''''''''''''''''
383
+
384
+ These modules implement various preprocessing transforms that can be applied
385
+ to EEG data, including cropping, filtering, resampling, and channel selection.
386
+
387
+ :py:mod:`braindecode.preprocessing`:
388
+
389
+ .. currentmodule:: braindecode.preprocessing
385
390
 
386
391
  .. autosummary::
387
392
  :toctree: generated/
388
393
 
389
- EEGPrep
394
+ Crop
395
+ DropChannels
396
+ Filter
397
+ Pick
390
398
  ReinterpolateRemovedChannels
391
399
  RemoveBadChannels
392
400
  RemoveBadChannelsNoLocs
@@ -396,107 +404,9 @@ EEGPrep Pipeline
396
404
  RemoveDCOffset
397
405
  RemoveDrifts
398
406
  RemoveFlatChannels
399
-
400
- Signal Processing
401
- '''''''''''''''''
402
-
403
- .. autosummary::
404
- :toctree: generated/
405
-
406
407
  Resample
407
408
  Resampling
408
- Filter
409
- FilterData
410
- NotchFilter
411
- SavgolFilter
412
- ApplyHilbert
413
- Rescale
414
- OversampledTemporalProjection
415
-
416
- Channel Management
417
- ''''''''''''''''''
418
-
419
- .. autosummary::
420
- :toctree: generated/
421
-
422
- Pick
423
- PickChannels
424
- PickTypes
425
- DropChannels
426
- AddChannels
427
- CombineChannels
428
- RenameChannels
429
- ReorderChannels
430
- SetChannelTypes
431
- InterpolateBads
432
- InterpolateTo
433
- InterpolateBridgedElectrodes
434
- ComputeBridgedElectrodes
435
- EqualizeChannels
436
- EqualizeBads
437
- FindBadChannelsLof
438
-
439
- Reference & Montage
440
- '''''''''''''''''''
441
-
442
- .. autosummary::
443
- :toctree: generated/
444
-
445
409
  SetEEGReference
446
- SetBipolarReference
447
- AddReferenceChannels
448
- SetMontage
449
-
450
- SSP Projections
451
- '''''''''''''''
452
-
453
- .. autosummary::
454
- :toctree: generated/
455
-
456
- AddProj
457
- ApplyProj
458
- DelProj
459
-
460
- Data Transformation
461
- '''''''''''''''''''
462
-
463
- .. autosummary::
464
- :toctree: generated/
465
-
466
- Crop
467
- CropByAnnotations
468
- ComputeCurrentSourceDensity
469
- FixStimArtifact
470
- MaxwellFilter
471
- RealignRaw
472
- RegressArtifact
473
-
474
- Artifact Detection & Annotation
475
- ''''''''''''''''''''''''''''''''
476
-
477
- .. autosummary::
478
- :toctree: generated/
479
-
480
- AnnotateAmplitude
481
- AnnotateBreak
482
- AnnotateMovement
483
- AnnotateMuscleZscore
484
- AnnotateNan
485
-
486
- Metadata & Configuration
487
- '''''''''''''''''''''''''
488
-
489
- .. autosummary::
490
- :toctree: generated/
491
-
492
- Anonymize
493
- SetAnnotations
494
- SetMeasDate
495
- AddEvents
496
- FixMagCoilTypes
497
- ApplyGradientCompensation
498
-
499
-
500
410
 
501
411
 
502
412
  Data Utils
@@ -22,7 +22,6 @@ import inspect
22
22
  import os
23
23
  import os.path as op
24
24
  import sys
25
- import warnings
26
25
 
27
26
  import matplotlib
28
27
 
@@ -34,32 +33,6 @@ import sphinx_gallery # noqa
34
33
  from numpydoc import docscrape, numpydoc # noqa
35
34
  from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey
36
35
 
37
- # Merge MNE-Python references during build
38
- try:
39
- import logging
40
- import sys
41
- from pathlib import Path
42
-
43
- # Add current directory to path so we can import download_mne_references
44
- docs_dir = Path(__file__).parent.absolute()
45
- if str(docs_dir) not in sys.path:
46
- sys.path.insert(0, str(docs_dir))
47
-
48
- logger = logging.getLogger(__name__)
49
- from download_mne_references import update_references
50
-
51
- logger.info("Attempting to merge MNE-Python references...")
52
- result = update_references()
53
- if result:
54
- logger.info("MNE-Python references merged successfully or skipped gracefully")
55
- else:
56
- logger.warning("MNE references update returned False")
57
- except ImportError as e:
58
- warnings.warn(f"Could not import download_mne_references module: {e}")
59
- except Exception as e:
60
- # Don't fail the build if updating references fails; emit a warning
61
- warnings.warn(f"MNE references update encountered an issue: {e}")
62
-
63
36
  # -- General configuration ------------------------------------------------
64
37
 
65
38
  # If your documentation needs a minimal Sphinx version, state it here.
@@ -27,7 +27,6 @@ Enhancements
27
27
  - Adding :class:`braindecode.models.SSTDPN` (:gh:`790` by `Can Han`_ and `Bruno Aristimunha`_ )
28
28
  - Added :class:`braindecode.models.BENDR` (:gh:`802` by `Bruno Aristimunha`_ )
29
29
  - Adding a tutorial for fine-tuning a pre-trained foundation model (:gh:`794` by `Pierre Guetschel`_)
30
- - Added 25 new MNE preprocessing functions, expanding from 6 to 31 total preprocessing classes. New functions include: :class:`braindecode.preprocessing.NotchFilter`, :class:`braindecode.preprocessing.SavgolFilter`, :class:`braindecode.preprocessing.ApplyHilbert`, :class:`braindecode.preprocessing.InterpolateBads`, :class:`braindecode.preprocessing.InterpolateTo`, :class:`braindecode.preprocessing.RenameChannels`, :class:`braindecode.preprocessing.ReorderChannels`, :class:`braindecode.preprocessing.EqualizeChannels`, :class:`braindecode.preprocessing.AddChannels`, :class:`braindecode.preprocessing.SetMontage`, :class:`braindecode.preprocessing.AddReferenceChannels`, :class:`braindecode.preprocessing.AddProj`, :class:`braindecode.preprocessing.ApplyProj`, :class:`braindecode.preprocessing.DelProj`, :class:`braindecode.preprocessing.ComputeCurrentSourceDensity`, :class:`braindecode.preprocessing.FixStimArtifact`, :class:`braindecode.preprocessing.CropByAnnotations`, :class:`braindecode.preprocessing.Anonymize`, :class:`braindecode.preprocessing.SetAnnotations`, :class:`braindecode.preprocessing.SetChannelTypes`, :class:`braindecode.preprocessing.SetMeasDate`, :class:`braindecode.preprocessing.FixMagCoilTypes`, :class:`braindecode.preprocessing.ApplyGradientCompensation`, :class:`braindecode.preprocessing.AddEvents`, and :class:`braindecode.preprocessing.Rescale` (:gh:`801` by `Bruno Aristimunha`_)
31
30
  - Adding artifact removal preprocessing steps, incl. :class:`braindecode.preprocessing.EEGPrep` (:gh:`796` by `Christian Kothe`_)
32
31
  - Including huggingface hub mixin to all models (:gh:`795` by `Kuntal Kokate`_ )
33
32
  - Better inheritance between the different dataset classes (:gh:`806` by `Pierre Guetschel`_ )
@@ -35,9 +34,7 @@ Enhancements
35
34
  - Including missed tag in all the models and creating some test for it (:gh:`811` by `Bruno Aristimunha`_ )
36
35
  - Modify verbosity of create_window_from_events (:gh:`814` by `Matthew Chen`_)
37
36
  - Modify the interface of FBMSNet for consistency with FBCNet + Unit Tests (:gh:`819` by `Matthew Chen`_)
38
- - Adding :class:`braindecode.models.MEDFormer` (:gh:`821` by `Bruno Aristimunha`_ )
39
37
  - Adding :class:`braindecode.models.EEGSym` model (:gh:`697` by `Pierre Guetschel`_ and `Bruno Aristimunha`_ )
40
- - Adding tutorial for :func:`braindecode.preprocessing.windowers.create_fixed_length_windows` (:gh:`746` by `Aniela Bulicz` and `Arina Schippers` and `Aron van Zuijlen`)
41
38
 
42
39
 
43
40
  API changes
@@ -425,4 +422,3 @@ Authors
425
422
  .. _Christian Kothe: https://github.com/chkothe
426
423
  .. _Kuntal Kokate: https://github.com/Kkuntal990
427
424
  .. _Matthew Chen: https://github.com/MatthewChen37
428
- .. _Aniela Bulicz: github.com/AryaDro