mne-rt 1.0.0__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 (57) hide show
  1. mne_rt-1.0.0/.gitattributes +53 -0
  2. mne_rt-1.0.0/.gitignore +219 -0
  3. mne_rt-1.0.0/LICENSE +21 -0
  4. mne_rt-1.0.0/MANIFEST.in +13 -0
  5. mne_rt-1.0.0/PKG-INFO +245 -0
  6. mne_rt-1.0.0/README.md +154 -0
  7. mne_rt-1.0.0/environment.yml +59 -0
  8. mne_rt-1.0.0/pyproject.toml +207 -0
  9. mne_rt-1.0.0/setup.cfg +4 -0
  10. mne_rt-1.0.0/src/mne_rt/__init__.py +104 -0
  11. mne_rt-1.0.0/src/mne_rt/_logging.py +158 -0
  12. mne_rt-1.0.0/src/mne_rt/cli.py +951 -0
  13. mne_rt-1.0.0/src/mne_rt/combiners.py +427 -0
  14. mne_rt-1.0.0/src/mne_rt/config_methods.yml +261 -0
  15. mne_rt-1.0.0/src/mne_rt/lsl_output.py +238 -0
  16. mne_rt-1.0.0/src/mne_rt/modalities.py +1023 -0
  17. mne_rt-1.0.0/src/mne_rt/osc.py +247 -0
  18. mne_rt-1.0.0/src/mne_rt/protocols/__init__.py +42 -0
  19. mne_rt-1.0.0/src/mne_rt/protocols/linear_trend.py +240 -0
  20. mne_rt-1.0.0/src/mne_rt/protocols/multiband.py +166 -0
  21. mne_rt-1.0.0/src/mne_rt/protocols/operant.py +303 -0
  22. mne_rt-1.0.0/src/mne_rt/protocols/percentile.py +210 -0
  23. mne_rt-1.0.0/src/mne_rt/protocols/rl_protocol.py +314 -0
  24. mne_rt-1.0.0/src/mne_rt/protocols/sham.py +183 -0
  25. mne_rt-1.0.0/src/mne_rt/protocols/staircase.py +278 -0
  26. mne_rt-1.0.0/src/mne_rt/protocols/threshold.py +247 -0
  27. mne_rt-1.0.0/src/mne_rt/protocols/transfer.py +359 -0
  28. mne_rt-1.0.0/src/mne_rt/protocols/zscores.py +239 -0
  29. mne_rt-1.0.0/src/mne_rt/rt_epochs.py +491 -0
  30. mne_rt-1.0.0/src/mne_rt/rt_stream.py +2498 -0
  31. mne_rt-1.0.0/src/mne_rt/tools/__init__.py +11 -0
  32. mne_rt-1.0.0/src/mne_rt/tools/asr.py +262 -0
  33. mne_rt-1.0.0/src/mne_rt/tools/bad_channel_detector.py +401 -0
  34. mne_rt-1.0.0/src/mne_rt/tools/bids_io.py +337 -0
  35. mne_rt-1.0.0/src/mne_rt/tools/gedai.py +363 -0
  36. mne_rt-1.0.0/src/mne_rt/tools/lms.py +153 -0
  37. mne_rt-1.0.0/src/mne_rt/tools/maxwell.py +464 -0
  38. mne_rt-1.0.0/src/mne_rt/tools/orica.py +278 -0
  39. mne_rt-1.0.0/src/mne_rt/tools/riemannian_potato.py +241 -0
  40. mne_rt-1.0.0/src/mne_rt/tools/simulation.py +501 -0
  41. mne_rt-1.0.0/src/mne_rt/tools/tools.py +990 -0
  42. mne_rt-1.0.0/src/mne_rt/viz/__init__.py +47 -0
  43. mne_rt-1.0.0/src/mne_rt/viz/brain_plot.py +1132 -0
  44. mne_rt-1.0.0/src/mne_rt/viz/butterfly_plot.py +745 -0
  45. mne_rt-1.0.0/src/mne_rt/viz/compare_evoked.py +964 -0
  46. mne_rt-1.0.0/src/mne_rt/viz/epoch_plot.py +785 -0
  47. mne_rt-1.0.0/src/mne_rt/viz/nf_plot.py +540 -0
  48. mne_rt-1.0.0/src/mne_rt/viz/raw_plot.py +1647 -0
  49. mne_rt-1.0.0/src/mne_rt/viz/tfr_plot.py +1153 -0
  50. mne_rt-1.0.0/src/mne_rt/viz/topo_plot.py +893 -0
  51. mne_rt-1.0.0/src/mne_rt/viz/topomap_plot.py +634 -0
  52. mne_rt-1.0.0/src/mne_rt.egg-info/PKG-INFO +245 -0
  53. mne_rt-1.0.0/src/mne_rt.egg-info/SOURCES.txt +55 -0
  54. mne_rt-1.0.0/src/mne_rt.egg-info/dependency_links.txt +1 -0
  55. mne_rt-1.0.0/src/mne_rt.egg-info/entry_points.txt +2 -0
  56. mne_rt-1.0.0/src/mne_rt.egg-info/requires.txt +69 -0
  57. mne_rt-1.0.0/src/mne_rt.egg-info/top_level.txt +1 -0
@@ -0,0 +1,53 @@
1
+ # Python files
2
+ *.py diff=python text
3
+ *.pyi diff=python text
4
+ *.ipynb filter=lfs diff=lfs merge=lfs -text
5
+ # USD Files
6
+ *.usd filter=lfs diff=lfs merge=lfs -text
7
+ *.usda filter=lfs diff=lfs merge=lfs -text
8
+ *.usdc filter=lfs diff=lfs merge=lfs -text
9
+ *.usdz filter=lfs diff=lfs merge=lfs -text
10
+ # Shader files (in case you're using shaders)
11
+ *.cginc text
12
+ *.shader text
13
+ # Text and YAML files
14
+ *.txt text
15
+ *.md text
16
+ *.yaml text
17
+ *.yml text
18
+ # JSON (commonly used in USD workflows)
19
+ *.json filter=lfs diff=lfs merge=lfs -text
20
+ # Large asset files
21
+ # 3D models
22
+ *.3dm filter=lfs diff=lfs merge=lfs -text
23
+ *.3ds filter=lfs diff=lfs merge=lfs -text
24
+ *.blend filter=lfs diff=lfs merge=lfs -text
25
+ *.c4d filter=lfs diff=lfs merge=lfs -text
26
+ *.dae filter=lfs diff=lfs merge=lfs -text
27
+ *.dxf filter=lfs diff=lfs merge=lfs -text
28
+ *.fbx filter=lfs diff=lfs merge=lfs -text
29
+ *.ma filter=lfs diff=lfs merge=lfs -text
30
+ *.max filter=lfs diff=lfs merge=lfs -text
31
+ *.mb filter=lfs diff=lfs merge=lfs -text
32
+ *.obj filter=lfs diff=lfs merge=lfs -text
33
+ *.ply filter=lfs diff=lfs merge=lfs -text
34
+ *.stl filter=lfs diff=lfs merge=lfs -text
35
+ # Textures and images
36
+ *.bmp filter=lfs diff=lfs merge=lfs -text
37
+ *.exr filter=lfs diff=lfs merge=lfs -text
38
+ *.hdr filter=lfs diff=lfs merge=lfs -text
39
+ *.jpg filter=lfs diff=lfs merge=lfs -text
40
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
41
+ *.png filter=lfs diff=lfs merge=lfs -text
42
+ *.tga filter=lfs diff=lfs merge=lfs -text
43
+ *.tif filter=lfs diff=lfs merge=lfs -text
44
+ *.tiff filter=lfs diff=lfs merge=lfs -text
45
+ # Audio (if applicable)
46
+ *.wav filter=lfs diff=lfs merge=lfs -text
47
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
48
+ *.ogg filter=lfs diff=lfs merge=lfs -text
49
+ # Video files (if applicable)
50
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
51
+ *.mov filter=lfs diff=lfs merge=lfs -text
52
+ # Documents
53
+ *.pdf filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,219 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ material/
7
+ # C extensions
8
+ *.so
9
+ .DS_Store
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ build/
14
+ develop-eggs/
15
+ dist/
16
+ downloads/
17
+ eggs/
18
+ .eggs/
19
+ lib/
20
+ lib64/
21
+ parts/
22
+ sdist/
23
+ var/
24
+ wheels/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+
31
+ # PyInstaller
32
+ # Usually these files are written by a python script from a template
33
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py.cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ cover/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+ docs/build/
76
+ docs/_images/
77
+ docs/_sources/
78
+ docs/_downloads/
79
+ docs/_static/
80
+ docs/*.html
81
+ docs/*.js
82
+ docs/*.inv
83
+ notebooks/
84
+ test.ipynb
85
+
86
+ # PyBuilder
87
+ .pybuilder/
88
+ target/
89
+
90
+ # Jupyter Notebook
91
+ .ipynb_checkpoints
92
+
93
+ # IPython
94
+ profile_default/
95
+ ipython_config.py
96
+
97
+ # pyenv
98
+ # For a library or package, you might want to ignore these files since the code is
99
+ # intended to run in multiple environments; otherwise, check them in:
100
+ # .python-version
101
+
102
+ # pipenv
103
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
104
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
105
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
106
+ # install all needed dependencies.
107
+ #Pipfile.lock
108
+
109
+ # UV
110
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
111
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
112
+ # commonly ignored for libraries.
113
+ #uv.lock
114
+
115
+ # poetry
116
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
117
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
118
+ # commonly ignored for libraries.
119
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
120
+ #poetry.lock
121
+ #poetry.toml
122
+
123
+ # pdm
124
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
125
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
126
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
127
+ #pdm.lock
128
+ #pdm.toml
129
+ .pdm-python
130
+ .pdm-build/
131
+
132
+ # pixi
133
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
134
+ #pixi.lock
135
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
136
+ # in the .venv directory. It is recommended not to include this directory in version control.
137
+ .pixi
138
+
139
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
140
+ __pypackages__/
141
+
142
+ # Celery stuff
143
+ celerybeat-schedule
144
+ celerybeat.pid
145
+
146
+ # SageMath parsed files
147
+ *.sage.py
148
+
149
+ # Environments
150
+ .env
151
+ .envrc
152
+ .venv
153
+ env/
154
+ venv/
155
+ ENV/
156
+ env.bak/
157
+ venv.bak/
158
+
159
+ # Spyder project settings
160
+ .spyderproject
161
+ .spyproject
162
+
163
+ # Rope project settings
164
+ .ropeproject
165
+
166
+ # mkdocs documentation
167
+ /site
168
+
169
+ # mypy
170
+ .mypy_cache/
171
+ .dmypy.json
172
+ dmypy.json
173
+
174
+ # Pyre type checker
175
+ .pyre/
176
+
177
+ # pytype static type analyzer
178
+ .pytype/
179
+
180
+ # Cython debug symbols
181
+ cython_debug/
182
+
183
+ # PyCharm
184
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
185
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
186
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
187
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
188
+ #.idea/
189
+
190
+ # Abstra
191
+ # Abstra is an AI-powered process automation framework.
192
+ # Ignore directories containing user credentials, local state, and settings.
193
+ # Learn more at https://abstra.io/docs
194
+ .abstra/
195
+
196
+ # Visual Studio Code
197
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
198
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
199
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
200
+ # you could uncomment the following to ignore the entire vscode folder
201
+ # .vscode/
202
+
203
+ # Ruff stuff:
204
+ .ruff_cache/
205
+
206
+ # PyPI configuration file
207
+ .pypirc
208
+
209
+ # Cursor
210
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
211
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
212
+ # refer to https://docs.cursor.com/context/ignore-files
213
+ .cursorignore
214
+ .cursorindexingignore
215
+
216
+ # Marimo
217
+ marimo/_static/
218
+ marimo/_lsp/
219
+ __marimo__/
mne_rt-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 payamsash
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,13 @@
1
+ include LICENSE
2
+ include README.md
3
+ include pyproject.toml
4
+ include src/mne_rt/config_methods.yml
5
+
6
+ # Docs, examples and build artefacts are not needed to install the package
7
+ prune docs
8
+ prune build
9
+ prune tests
10
+ prune examples
11
+ prune paper
12
+ prune material
13
+ prune data
mne_rt-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,245 @@
1
+ Metadata-Version: 2.4
2
+ Name: mne-rt
3
+ Version: 1.0.0
4
+ Summary: MNE-RT — real-time M/EEG signal processing and analysis
5
+ Author-email: "Payam S. Shabestari" <payam.sadeghi74@gmail.com>
6
+ Maintainer-email: "Payam S. Shabestari" <payam.sadeghi74@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/payamsash/mne-rt
9
+ Project-URL: Documentation, https://payamsash.github.io/mne-rt/
10
+ Project-URL: Repository, https://github.com/payamsash/mne-rt
11
+ Project-URL: Bug Tracker, https://github.com/payamsash/mne-rt/issues
12
+ Keywords: neurofeedback,EEG,MEG,brain-computer interface,real-time,LSL,source localisation,signal processing
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Healthcare Industry
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
23
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
24
+ Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
25
+ Requires-Python: >=3.11
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: mne>=1.8
29
+ Requires-Dist: mne-lsl>=1.7
30
+ Requires-Dist: mne-connectivity>=0.7
31
+ Requires-Dist: mne-features>=0.3
32
+ Requires-Dist: mne-icalabel>=0.5
33
+ Requires-Dist: numpy<3,>=2.0
34
+ Requires-Dist: scipy>=1.13
35
+ Requires-Dist: matplotlib>=3.9
36
+ Requires-Dist: nibabel>=5.0
37
+ Requires-Dist: PyQt6>=6.7
38
+ Requires-Dist: pyqtgraph>=0.13
39
+ Requires-Dist: qtpy>=2.4
40
+ Requires-Dist: pyserial>=3.0
41
+ Requires-Dist: fooof>=1.0
42
+ Requires-Dist: pyunlocbox>=0.5.2
43
+ Requires-Dist: pactools>=0.3
44
+ Requires-Dist: pyyaml>=6.0
45
+ Requires-Dist: python-osc>=1.8
46
+ Requires-Dist: imageio[ffmpeg]>=2.28
47
+ Provides-Extra: viz
48
+ Requires-Dist: pyvista>=0.44; extra == "viz"
49
+ Requires-Dist: pyvistaqt>=0.11.1; extra == "viz"
50
+ Requires-Dist: vtk>=9.3; extra == "viz"
51
+ Provides-Extra: riemann
52
+ Requires-Dist: pyriemann>=0.7; extra == "riemann"
53
+ Provides-Extra: bids
54
+ Requires-Dist: mne-bids>=0.14; extra == "bids"
55
+ Provides-Extra: dev
56
+ Requires-Dist: pytest; extra == "dev"
57
+ Requires-Dist: pytest-cov; extra == "dev"
58
+ Provides-Extra: lint
59
+ Requires-Dist: ruff; extra == "lint"
60
+ Requires-Dist: mypy; extra == "lint"
61
+ Requires-Dist: pre-commit; extra == "lint"
62
+ Provides-Extra: docs
63
+ Requires-Dist: sphinx>=7; extra == "docs"
64
+ Requires-Dist: pydata-sphinx-theme>=0.14; extra == "docs"
65
+ Requires-Dist: sphinx-gallery>=0.15; extra == "docs"
66
+ Requires-Dist: numpydoc>=1.6; extra == "docs"
67
+ Requires-Dist: sphinx-autodoc-typehints>=1.25; extra == "docs"
68
+ Requires-Dist: sphinx-tabs>=3.4; extra == "docs"
69
+ Requires-Dist: sphinxcontrib-bibtex>=2.6; extra == "docs"
70
+ Requires-Dist: seaborn>=0.12; extra == "docs"
71
+ Provides-Extra: full
72
+ Requires-Dist: pyvista>=0.44; extra == "full"
73
+ Requires-Dist: pyvistaqt>=0.11.1; extra == "full"
74
+ Requires-Dist: vtk>=9.3; extra == "full"
75
+ Requires-Dist: pyriemann>=0.7; extra == "full"
76
+ Requires-Dist: mne-bids>=0.14; extra == "full"
77
+ Requires-Dist: pytest; extra == "full"
78
+ Requires-Dist: pytest-cov; extra == "full"
79
+ Requires-Dist: ruff; extra == "full"
80
+ Requires-Dist: mypy; extra == "full"
81
+ Requires-Dist: pre-commit; extra == "full"
82
+ Requires-Dist: sphinx>=7; extra == "full"
83
+ Requires-Dist: pydata-sphinx-theme>=0.14; extra == "full"
84
+ Requires-Dist: sphinx-gallery>=0.15; extra == "full"
85
+ Requires-Dist: numpydoc>=1.6; extra == "full"
86
+ Requires-Dist: sphinx-autodoc-typehints>=1.25; extra == "full"
87
+ Requires-Dist: sphinx-tabs>=3.4; extra == "full"
88
+ Requires-Dist: sphinxcontrib-bibtex>=2.6; extra == "full"
89
+ Requires-Dist: seaborn>=0.12; extra == "full"
90
+ Dynamic: license-file
91
+
92
+ <p align="center">
93
+ <img src="https://raw.githubusercontent.com/payamsash/mne-rt/main/docs/source/_static/mne_rt_logo.svg" alt="MNE-RT Logo" width="480"/>
94
+ </p>
95
+
96
+ <p align="center">
97
+ <strong>MNE-RT — Real-time M/EEG Signal Processing</strong><br>
98
+ From amplifier to 3-D brain display in a single, researcher-friendly API
99
+ </p>
100
+
101
+ <p align="center">
102
+ <a href="https://github.com/payamsash/mne-rt/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/github/license/payamsash/mne-rt?color=green"></a>
103
+ <a href="https://pypi.org/project/mne-rt/"><img alt="PyPI" src="https://img.shields.io/pypi/v/mne-rt?color=blue"></a>
104
+ <a href="https://pypi.org/project/mne-rt/"><img alt="Python" src="https://img.shields.io/pypi/pyversions/mne-rt"></a>
105
+ <a href="https://payamsash.github.io/mne-rt/"><img alt="Docs" src="https://img.shields.io/badge/docs-online-brightgreen?logo=readthedocs&logoColor=white"></a>
106
+ </p>
107
+
108
+ ---
109
+
110
+ **MNE-RT** is an open-source Python library for **real-time M/EEG signal
111
+ processing**, built on [MNE-Python](https://mne.tools) and
112
+ [MNE-LSL](https://mne.tools/mne-lsl). It covers the full closed-loop pipeline —
113
+ from amplifier to 3-D brain display — in a single API designed for neurofeedback,
114
+ BCI, and clinical or basic-science monitoring.
115
+
116
+ ## Highlights
117
+
118
+ | Feature | Details |
119
+ |---|---|
120
+ | **20 NF modalities** | Band power, ERD/ERS, laterality, Hjorth, spectral centroid, CFC, connectivity, graph Laplacian — sensor and source space |
121
+ | **10 adaptive protocols** | Z-score, threshold, percentile, staircase, operant, RL, sham, multi-band, and cross-session transfer |
122
+ | **5 artifact correction methods** | ASR, adaptive LMS, GEDAI, ORICA, real-time Maxwell/SSS (MEG) |
123
+ | **9 live visualisation windows** | Scrolling raw · NF signal · epoch overlays · scalp topo · 3-D brain · butterfly · ERP comparison · TFR heatmaps |
124
+ | **Feature combiners** | Weighted sum, geometric mean, z-scored norm, or any sklearn estimator |
125
+ | **External feedback output** | OSC (Max/MSP, SuperCollider) and LSL outlet (PsychoPy, OpenViBE, BCI2000) |
126
+ | **BIDS-compatible saving** | Session JSON + TSV with full metadata, artifact rate, and SNR |
127
+ | **CLI** | `mne-rt info` · `mne-rt demo` · `mne-rt baseline` · `mne-rt run` |
128
+ | **Mock mode** | Full pipeline without hardware via built-in LSL replay |
129
+
130
+ ## Installation
131
+
132
+ ```bash
133
+ pip install mne-rt # core package
134
+ pip install "mne-rt[full]" # + 3-D viz, dev tools, docs
135
+ ```
136
+
137
+ <details>
138
+ <summary>Other installation methods</summary>
139
+
140
+ **uv (fast Rust-based installer):**
141
+ ```bash
142
+ uv pip install mne-rt
143
+ uv pip install "mne-rt[full]"
144
+ ```
145
+
146
+ **Development install from source:**
147
+ ```bash
148
+ git clone https://github.com/payamsash/mne-rt.git
149
+ cd mne-rt
150
+ pip install -e ".[dev]"
151
+ ```
152
+
153
+ </details>
154
+
155
+ Verify:
156
+ ```bash
157
+ mne-rt info # prints MNE-RT and dependency versions
158
+ mne-rt demo # runs a 60-second mock neurofeedback session
159
+ ```
160
+
161
+ ## Quick start
162
+
163
+ ```python
164
+ from mne_rt import RTStream
165
+ from mne_rt.protocols import ZScoreProtocol
166
+
167
+ # 1 — Create a session object
168
+ nf = RTStream(
169
+ subject_id="sub01",
170
+ session="01",
171
+ subjects_dir="/data/subjects",
172
+ montage="easycap-M1",
173
+ )
174
+
175
+ # 2 — Connect to a live LSL stream (or replay a file without hardware)
176
+ nf.connect_to_lsl(mock_lsl=True)
177
+
178
+ # 3 — Record a resting-state baseline (bad channels, ICA, noise cov)
179
+ nf.record_baseline(duration=120)
180
+
181
+ # 4 — Run a closed-loop NF session
182
+ nf.record_main(
183
+ duration=300,
184
+ modality=["sensor_power", "erd_ers"],
185
+ protocol=ZScoreProtocol(direction="up", zscore_threshold=0.5),
186
+ show_nf_signal=True,
187
+ show_topo=True,
188
+ )
189
+
190
+ # 5 — Save results (BIDS-compatible JSON + TSV)
191
+ nf.save()
192
+ ```
193
+
194
+ ## CLI
195
+
196
+ ```bash
197
+ # Print version and all dependency versions
198
+ mne-rt info
199
+
200
+ # Quick demo — no amplifier needed
201
+ mne-rt demo --duration 60 --modality sensor_power erd_ers
202
+
203
+ # Record a resting-state baseline
204
+ mne-rt baseline --subject sub01 --subjects-dir /data --session 01
205
+
206
+ # Run a full session with artifact correction and live displays
207
+ mne-rt run --subject sub01 --subjects-dir /data --duration 600 \
208
+ --modality sensor_power erd_ers \
209
+ --artifact-correction asr \
210
+ --topo --brain
211
+ ```
212
+
213
+ ## Documentation
214
+
215
+ Full documentation (API reference, tutorials, visualization gallery) is available at
216
+ **[payamsash.github.io/mne-rt](https://payamsash.github.io/mne-rt/)**.
217
+
218
+ ## Cite
219
+
220
+ If you use MNE-RT in your research, please cite:
221
+
222
+ ```bibtex
223
+ @inproceedings{shabestari2025advances,
224
+ title = {Advances on Real Time {M/EEG} Neural Feature Extraction},
225
+ author = {Shabestari, Payam S and Ribes, Delphine and D{\'e}fayes, Lara
226
+ and Cai, Danpeng and Groves, Emily and Behjat, Harry H
227
+ and Van de Ville, Dimitri and Kleinjung, Tobias
228
+ and Naas, Adrian and Henchoz, Nicolas and others},
229
+ booktitle = {2025 IEEE 38th International Symposium on Computer-Based
230
+ Medical Systems (CBMS)},
231
+ pages = {337--338},
232
+ year = {2025},
233
+ organization = {IEEE}
234
+ }
235
+ ```
236
+
237
+ ## Acknowledgements
238
+
239
+ Development was supported by the
240
+ [Swiss National Science Foundation](https://www.snf.ch/en) (grant 208164 —
241
+ *Advancing Neurofeedback in Tinnitus*).
242
+
243
+ ## License
244
+
245
+ [MIT License](LICENSE) — © 2025 Payam S. Shabestari