mne-nodes 0.1.0a4__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 (105) hide show
  1. mne_nodes-0.1.0a4/.gitignore +19 -0
  2. mne_nodes-0.1.0a4/CONTRIBUTING.md +27 -0
  3. mne_nodes-0.1.0a4/LICENSE +29 -0
  4. mne_nodes-0.1.0a4/PKG-INFO +98 -0
  5. mne_nodes-0.1.0a4/README.md +56 -0
  6. mne_nodes-0.1.0a4/docs/Makefile +25 -0
  7. mne_nodes-0.1.0a4/docs/make.bat +35 -0
  8. mne_nodes-0.1.0a4/docs/source/_static/versions.json +7 -0
  9. mne_nodes-0.1.0a4/docs/source/api/index.rst +8 -0
  10. mne_nodes-0.1.0a4/docs/source/api/parameter_widgets.rst +30 -0
  11. mne_nodes-0.1.0a4/docs/source/conf.py +95 -0
  12. mne_nodes-0.1.0a4/docs/source/development/index.rst +1 -0
  13. mne_nodes-0.1.0a4/docs/source/documentation/custom_modules.rst +23 -0
  14. mne_nodes-0.1.0a4/docs/source/documentation/functions.rst +16 -0
  15. mne_nodes-0.1.0a4/docs/source/documentation/index.rst +0 -0
  16. mne_nodes-0.1.0a4/docs/source/documentation/settings.rst +7 -0
  17. mne_nodes-0.1.0a4/docs/source/index.rst +35 -0
  18. mne_nodes-0.1.0a4/docs/source/install/index.rst +1 -0
  19. mne_nodes-0.1.0a4/mne_nodes/__init__.py +35 -0
  20. mne_nodes-0.1.0a4/mne_nodes/__main__.py +92 -0
  21. mne_nodes-0.1.0a4/mne_nodes/conftest.py +320 -0
  22. mne_nodes-0.1.0a4/mne_nodes/core_functions/__init__.py +5 -0
  23. mne_nodes-0.1.0a4/mne_nodes/core_functions/core_functions.py +59 -0
  24. mne_nodes-0.1.0a4/mne_nodes/core_functions/core_functions_config.json +114 -0
  25. mne_nodes-0.1.0a4/mne_nodes/development/Makefile +14 -0
  26. mne_nodes-0.1.0a4/mne_nodes/development/__init__.py +5 -0
  27. mne_nodes-0.1.0a4/mne_nodes/development/animations.py +50 -0
  28. mne_nodes-0.1.0a4/mne_nodes/development/base_widget_tester.py +191 -0
  29. mne_nodes-0.1.0a4/mne_nodes/development/console_widget_speed.py +74 -0
  30. mne_nodes-0.1.0a4/mne_nodes/development/development_considerations.md +137 -0
  31. mne_nodes-0.1.0a4/mne_nodes/development/param_tester.py +126 -0
  32. mne_nodes-0.1.0a4/mne_nodes/development/run_function_Importer.py +19 -0
  33. mne_nodes-0.1.0a4/mne_nodes/development/run_interaction_widgets.py +30 -0
  34. mne_nodes-0.1.0a4/mne_nodes/extra/__init__.py +5 -0
  35. mne_nodes-0.1.0a4/mne_nodes/extra/mne_pipeline_icon_dark.png +0 -0
  36. mne_nodes-0.1.0a4/mne_nodes/extra/mne_pipeline_icon_light.png +0 -0
  37. mne_nodes-0.1.0a4/mne_nodes/extra/mne_pipeline_logo_evee_smaller.jpg +0 -0
  38. mne_nodes-0.1.0a4/mne_nodes/extra/wip_overview.png +0 -0
  39. mne_nodes-0.1.0a4/mne_nodes/gui/__init__.py +5 -0
  40. mne_nodes-0.1.0a4/mne_nodes/gui/base_widgets.py +1818 -0
  41. mne_nodes-0.1.0a4/mne_nodes/gui/code_editor.py +160 -0
  42. mne_nodes-0.1.0a4/mne_nodes/gui/console.py +382 -0
  43. mne_nodes-0.1.0a4/mne_nodes/gui/dialogs.py +138 -0
  44. mne_nodes-0.1.0a4/mne_nodes/gui/function_widgets.py +745 -0
  45. mne_nodes-0.1.0a4/mne_nodes/gui/gui_utils.py +781 -0
  46. mne_nodes-0.1.0a4/mne_nodes/gui/loading_widgets.py +1267 -0
  47. mne_nodes-0.1.0a4/mne_nodes/gui/main_window.py +217 -0
  48. mne_nodes-0.1.0a4/mne_nodes/gui/models.py +1089 -0
  49. mne_nodes-0.1.0a4/mne_nodes/gui/node/__init__.py +0 -0
  50. mne_nodes-0.1.0a4/mne_nodes/gui/node/base_node.py +920 -0
  51. mne_nodes-0.1.0a4/mne_nodes/gui/node/node_defaults.py +47 -0
  52. mne_nodes-0.1.0a4/mne_nodes/gui/node/node_picker.py +40 -0
  53. mne_nodes-0.1.0a4/mne_nodes/gui/node/node_scene.py +174 -0
  54. mne_nodes-0.1.0a4/mne_nodes/gui/node/node_viewer.py +1938 -0
  55. mne_nodes-0.1.0a4/mne_nodes/gui/node/nodegraphqt_license.md +22 -0
  56. mne_nodes-0.1.0a4/mne_nodes/gui/node/nodes.py +255 -0
  57. mne_nodes-0.1.0a4/mne_nodes/gui/node/nodes_readme.md +12 -0
  58. mne_nodes-0.1.0a4/mne_nodes/gui/node/pipes.py +541 -0
  59. mne_nodes-0.1.0a4/mne_nodes/gui/node/ports.py +475 -0
  60. mne_nodes-0.1.0a4/mne_nodes/gui/parameter_widgets.py +1937 -0
  61. mne_nodes-0.1.0a4/mne_nodes/gui/syntax_highlight.py +241 -0
  62. mne_nodes-0.1.0a4/mne_nodes/pipeline/__init__.py +5 -0
  63. mne_nodes-0.1.0a4/mne_nodes/pipeline/controller.py +832 -0
  64. mne_nodes-0.1.0a4/mne_nodes/pipeline/data_import.py +38 -0
  65. mne_nodes-0.1.0a4/mne_nodes/pipeline/exception_handling.py +98 -0
  66. mne_nodes-0.1.0a4/mne_nodes/pipeline/execution.py +397 -0
  67. mne_nodes-0.1.0a4/mne_nodes/pipeline/function_utils.py +72 -0
  68. mne_nodes-0.1.0a4/mne_nodes/pipeline/io.py +90 -0
  69. mne_nodes-0.1.0a4/mne_nodes/pipeline/pipeline_utils.py +204 -0
  70. mne_nodes-0.1.0a4/mne_nodes/pipeline/settings.py +153 -0
  71. mne_nodes-0.1.0a4/mne_nodes/pipeline/streams.py +92 -0
  72. mne_nodes-0.1.0a4/mne_nodes/pytest.ini +4 -0
  73. mne_nodes-0.1.0a4/mne_nodes/tests/__init__.py +5 -0
  74. mne_nodes-0.1.0a4/mne_nodes/tests/_test_process.py +18 -0
  75. mne_nodes-0.1.0a4/mne_nodes/tests/_test_utils.py +36 -0
  76. mne_nodes-0.1.0a4/mne_nodes/tests/test_base_widgets.py +581 -0
  77. mne_nodes-0.1.0a4/mne_nodes/tests/test_code_editor.py +51 -0
  78. mne_nodes-0.1.0a4/mne_nodes/tests/test_console.py +161 -0
  79. mne_nodes-0.1.0a4/mne_nodes/tests/test_controller.py +114 -0
  80. mne_nodes-0.1.0a4/mne_nodes/tests/test_execution.py +78 -0
  81. mne_nodes-0.1.0a4/mne_nodes/tests/test_io.py +127 -0
  82. mne_nodes-0.1.0a4/mne_nodes/tests/test_main_window.py +48 -0
  83. mne_nodes-0.1.0a4/mne_nodes/tests/test_nodes.py +134 -0
  84. mne_nodes-0.1.0a4/mne_nodes/tests/test_parameter_widgets.py +244 -0
  85. mne_nodes-0.1.0a4/mne_nodes/tests/test_worker_dialog.py +80 -0
  86. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/README +5 -0
  87. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/code/make_tiny_bids_dataset.py +142 -0
  88. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/dataset_description.json +10 -0
  89. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/participants.json +33 -0
  90. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/participants.tsv +2 -0
  91. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_coordsystem.json +24 -0
  92. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_electrodes.tsv +65 -0
  93. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_space-CapTrak_coordsystem.json +24 -0
  94. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_space-CapTrak_electrodes.tsv +70 -0
  95. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_task-rest_channels.tsv +70 -0
  96. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_task-rest_eeg.eeg +0 -0
  97. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_task-rest_eeg.json +18 -0
  98. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_task-rest_eeg.vhdr +255 -0
  99. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_task-rest_eeg.vmrk +13 -0
  100. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_task-rest_events.json +15 -0
  101. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/eeg/sub-01_ses-eeg_task-rest_events.tsv +3 -0
  102. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/ses-eeg/sub-01_ses-eeg_scans.tsv +2 -0
  103. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/sub-01_sessions.json +9 -0
  104. mne_nodes-0.1.0a4/mne_nodes/tests/tiny_bids/sub-01/sub-01_sessions.tsv +2 -0
  105. mne_nodes-0.1.0a4/pyproject.toml +99 -0
@@ -0,0 +1,19 @@
1
+ # Python
2
+ __pycache__/
3
+ .pytest_cache/
4
+ *.egg-info/
5
+ dist/
6
+ .venv/
7
+ venv/
8
+ .ipynb_checkpoints/
9
+
10
+ # PyCharm Project-Settings
11
+ .idea/
12
+
13
+ # VSCode
14
+ .vscode/
15
+
16
+ # Documentation
17
+ docs/build/
18
+ docs/generated/
19
+ docs/source/generated
@@ -0,0 +1,27 @@
1
+ # Contributing to mne-nodes
2
+
3
+ _**Contributions are very welcome! Thank you for taking the time to contribute to mne-nodes.**_
4
+
5
+ ## Scope
6
+ mne-nodes is supposed to be a **GUI framework** for building and running MEG/EEG workflows.
7
+ It should not contain any analysis logic (core-functions being the exception during early development).
8
+ All analysis logic should be implemented in separate, importable Python modules/packages and maintained in their own repositories (for example on GitHub).
9
+
10
+ ## Development Setup
11
+ 1. Fork this repository on GitHub
12
+ 2. Move to the folder where you want to clone to
13
+ 3. Clone **your forked repository** with git from a
14
+ terminal: `git clone <url you get from the green clone-button from your forked repository on GitHub>`
15
+ 4. Add a remote branch _upstream_ to git for
16
+ updates from the main-branch: `git remote add upstream https://github.com/marsipu/mne-nodes.git`
17
+ 5. Install your forked version including development dependencies with pip: `pip install -e .[test,docs]`
18
+ 6. Install the pre-commit hooks with: `pre-commit install`
19
+
20
+ **Alternative:** You can also use [mne-dev-setup](https://github.com/marsipu/mne-dev-setup) for the setup of a development environment.
21
+
22
+ ## Workflow for contributing
23
+ 1. Create a branch for changes: `git checkout -b <branch-name>`
24
+ 2. Commit changes: `git commit -am "<your commit message>"`
25
+ 3. Push changes to your forked repository on GitHub: `git push`
26
+ 4. Make a new _pull request_ from your new feature branch
27
+ 5. After review, your changes can be merged into the main-branch
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) authors of mne-nodes
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,98 @@
1
+ Metadata-Version: 2.4
2
+ Name: mne-nodes
3
+ Version: 0.1.0a4
4
+ Summary: A GUI with Node-Layout for data analysis MNE-Python
5
+ Project-URL: Homepage, https://github.com/marsipu/mne-nodes
6
+ Project-URL: Repository, https://github.com/marsipu/mne-nodes.git
7
+ Author-email: "Martin G. Schulz" <dev@mgschulz.de>
8
+ License-Expression: BSD-3-Clause
9
+ License-File: LICENSE
10
+ Keywords: eeg,gui,heidelberg,meg,mne-python,pipeline
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Topic :: Scientific/Engineering
15
+ Requires-Python: >=3.10
16
+ Requires-Dist: autoreject
17
+ Requires-Dist: darkdetect
18
+ Requires-Dist: filelock
19
+ Requires-Dist: h5io
20
+ Requires-Dist: h5netcdf
21
+ Requires-Dist: mne
22
+ Requires-Dist: mne-bids
23
+ Requires-Dist: mne-connectivity
24
+ Requires-Dist: mne-qt-browser
25
+ Requires-Dist: nibabel
26
+ Requires-Dist: psutil
27
+ Requires-Dist: pyobjc-framework-cocoa; sys_platform == 'Darwin'
28
+ Requires-Dist: pyvistaqt
29
+ Requires-Dist: qtawesome
30
+ Requires-Dist: qtpy
31
+ Requires-Dist: tqdm
32
+ Requires-Dist: vtk
33
+ Provides-Extra: docs
34
+ Requires-Dist: pydata-sphinx-theme; extra == 'docs'
35
+ Requires-Dist: sphinx; extra == 'docs'
36
+ Provides-Extra: test
37
+ Requires-Dist: pre-commit; extra == 'test'
38
+ Requires-Dist: pytest; extra == 'test'
39
+ Requires-Dist: pytest-qt; extra == 'test'
40
+ Requires-Dist: ruff; extra == 'test'
41
+ Description-Content-Type: text/markdown
42
+
43
+ [![CIs](https://github.com/marsipu/mne-nodes/actions/workflows/run_tests.yml/badge.svg)](https://github.com/marsipu/mne-nodes/actions/workflows/run_tests.yml)
44
+
45
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/marsipu/mne-nodes/main.svg?badge_token=jA6ZWC-DQXm_QrZFVi3a-w)](https://results.pre-commit.ci/latest/github/marsipu/mne-nodes/main?badge_token=jA6ZWC-DQXm_QrZFVi3a-w)
46
+
47
+ # mne-nodes
48
+ ![Overview](mne_nodes/extra/wip_overview.png "Overview of the mne-nodes GUI")
49
+
50
+ ## A Node-GUI for [MNE-Python](https://mne.tools/stable/index.html)
51
+ This is a GUI to facilitate offline MEG/EEG data processing with MNE-python.
52
+ To visualize the data-flow a node-based approach is used.
53
+
54
+ ## Installation
55
+ 1. Install MNE-python as instructed in the [documentation](https://mne.tools/stable/install/index.html)
56
+ 2. Open the command prompt and activate the conda-environment where you installed mne-python (or just open the command prompt when you installed mne-python with an [installer](https://mne.tools/stable/install/installers.html#installers))
57
+ 3. Install **mne-nodes**:
58
+ - Install the latest release with `pip install mne-nodes`
59
+
60
+ or
61
+
62
+ - Install the development version with `pip install git+https://github.com/marsipu/mne-nodes.git@main`
63
+
64
+
65
+ ## Update
66
+ Run `pip install --upgrade --no-deps --force-reinstall git+https://github.com/marsipu/mne-nodes.git@main`
67
+ for an update to the development version
68
+ or `pip install --upgrade mne-nodes` for the latest release.
69
+
70
+ ## Start
71
+ Run `mne_nodes` in the terminal of your conda-environment where you installed mne-python and mne-nodes
72
+
73
+ **or**
74
+
75
+ run \_\_main\_\_.py from the terminal or an IDE like PyCharm, VSCode, Atom,
76
+ etc.
77
+
78
+
79
+ ## Bug-Report/Feature-Request
80
+ Please report bugs on GitHub as an [issue](https://github.com/marsipu/mne-nodes/issues/new?template=bug_report.yml).
81
+ And if you got ideas on how to improve the pipeline or some feature-requests,
82
+ you are welcome to open an [issue](https://github.com/marsipu/mne-nodes/issues/new?template=feature_request.yml) as well.
83
+
84
+ ## Contribute
85
+ Contributions on bug fixes and implementation of new features are very welcome.
86
+ Have a look at the [contributing guidelines](CONTRIBUTING.md) for more information on how to contribute.
87
+
88
+ ## Acknowledgments
89
+ - This application serves as a GUI for [MNE-Python](https://mne.tools/stable/index.html)
90
+ > A. Gramfort, M. Luessi, E. Larson, D. Engemann, D. Strohmeier, C. Brodbeck, L. Parkkonen, M. Hämäläinen, MNE software for processing MEG and EEG data, NeuroImage, Volume 86, 1 February 2014, Pages 446-460, ISSN 1053-8119, [DOI](https://doi.org/10.1016/j.neuroimage.2013.10.027)
91
+ - [mne-bids](https://mne.tools/mne-bids/) is used to read and write data in BIDS format and the tiny-bids-dataset is used for testing.
92
+ - [mne-bids-pipeline](https://mne.tools/mne-bids-pipeline/) served as inspiration for the processing steps and their implementation of bids-derivatives.
93
+ - Code from [NodeGraphQt](https://github.com/jchanvfx/NodeGraphQt) was used to implement the node-gui.
94
+ - The colorpalettes for light and dark theme are inspired from [PyQtDarkTheme](https://github.com/5yutan5/PyQtDarkTheme).
95
+ - The development was supported by Code Completion and Coding Agents (e.g. GitHub Copilot)
96
+
97
+ ## License
98
+ The `mne-nodes` project is licensed under the [BSD\-3\-Clause license](LICENSE). It uses PySide6, which is licensed under the LGPL. When using [`qtpy`](https://github.com/spyder-ide/qtpy) with alternative Qt backends (e.g. PyQt6), the applicable licensing obligations are determined by the chosen backend.
@@ -0,0 +1,56 @@
1
+ [![CIs](https://github.com/marsipu/mne-nodes/actions/workflows/run_tests.yml/badge.svg)](https://github.com/marsipu/mne-nodes/actions/workflows/run_tests.yml)
2
+
3
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/marsipu/mne-nodes/main.svg?badge_token=jA6ZWC-DQXm_QrZFVi3a-w)](https://results.pre-commit.ci/latest/github/marsipu/mne-nodes/main?badge_token=jA6ZWC-DQXm_QrZFVi3a-w)
4
+
5
+ # mne-nodes
6
+ ![Overview](mne_nodes/extra/wip_overview.png "Overview of the mne-nodes GUI")
7
+
8
+ ## A Node-GUI for [MNE-Python](https://mne.tools/stable/index.html)
9
+ This is a GUI to facilitate offline MEG/EEG data processing with MNE-python.
10
+ To visualize the data-flow a node-based approach is used.
11
+
12
+ ## Installation
13
+ 1. Install MNE-python as instructed in the [documentation](https://mne.tools/stable/install/index.html)
14
+ 2. Open the command prompt and activate the conda-environment where you installed mne-python (or just open the command prompt when you installed mne-python with an [installer](https://mne.tools/stable/install/installers.html#installers))
15
+ 3. Install **mne-nodes**:
16
+ - Install the latest release with `pip install mne-nodes`
17
+
18
+ or
19
+
20
+ - Install the development version with `pip install git+https://github.com/marsipu/mne-nodes.git@main`
21
+
22
+
23
+ ## Update
24
+ Run `pip install --upgrade --no-deps --force-reinstall git+https://github.com/marsipu/mne-nodes.git@main`
25
+ for an update to the development version
26
+ or `pip install --upgrade mne-nodes` for the latest release.
27
+
28
+ ## Start
29
+ Run `mne_nodes` in the terminal of your conda-environment where you installed mne-python and mne-nodes
30
+
31
+ **or**
32
+
33
+ run \_\_main\_\_.py from the terminal or an IDE like PyCharm, VSCode, Atom,
34
+ etc.
35
+
36
+
37
+ ## Bug-Report/Feature-Request
38
+ Please report bugs on GitHub as an [issue](https://github.com/marsipu/mne-nodes/issues/new?template=bug_report.yml).
39
+ And if you got ideas on how to improve the pipeline or some feature-requests,
40
+ you are welcome to open an [issue](https://github.com/marsipu/mne-nodes/issues/new?template=feature_request.yml) as well.
41
+
42
+ ## Contribute
43
+ Contributions on bug fixes and implementation of new features are very welcome.
44
+ Have a look at the [contributing guidelines](CONTRIBUTING.md) for more information on how to contribute.
45
+
46
+ ## Acknowledgments
47
+ - This application serves as a GUI for [MNE-Python](https://mne.tools/stable/index.html)
48
+ > A. Gramfort, M. Luessi, E. Larson, D. Engemann, D. Strohmeier, C. Brodbeck, L. Parkkonen, M. Hämäläinen, MNE software for processing MEG and EEG data, NeuroImage, Volume 86, 1 February 2014, Pages 446-460, ISSN 1053-8119, [DOI](https://doi.org/10.1016/j.neuroimage.2013.10.027)
49
+ - [mne-bids](https://mne.tools/mne-bids/) is used to read and write data in BIDS format and the tiny-bids-dataset is used for testing.
50
+ - [mne-bids-pipeline](https://mne.tools/mne-bids-pipeline/) served as inspiration for the processing steps and their implementation of bids-derivatives.
51
+ - Code from [NodeGraphQt](https://github.com/jchanvfx/NodeGraphQt) was used to implement the node-gui.
52
+ - The colorpalettes for light and dark theme are inspired from [PyQtDarkTheme](https://github.com/5yutan5/PyQtDarkTheme).
53
+ - The development was supported by Code Completion and Coding Agents (e.g. GitHub Copilot)
54
+
55
+ ## License
56
+ The `mne-nodes` project is licensed under the [BSD\-3\-Clause license](LICENSE). It uses PySide6, which is licensed under the LGPL. When using [`qtpy`](https://github.com/spyder-ide/qtpy) with alternative Qt backends (e.g. PyQt6), the applicable licensing obligations are determined by the chosen backend.
@@ -0,0 +1,25 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21
+
22
+ view:
23
+ @python -c "import webbrowser; webbrowser.open_new_tab('file://$(PWD)/build/html/index.html')"
24
+
25
+ show: view
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "name": "0.4 (development)",
4
+ "version": "dev",
5
+ "url": "https://github.com/marsipu/mne-nodes"
6
+ }
7
+ ]
@@ -0,0 +1,8 @@
1
+ .. automodule:: mne_nodes.gui.parameter_widgets
2
+ :no-members:
3
+ :no-inherited-members:
4
+
5
+ .. toctree::
6
+ :maxdepth: 2
7
+
8
+ parameter_widgets.rst
@@ -0,0 +1,30 @@
1
+ Parameter Widgets
2
+ =================
3
+
4
+ .. currentmodule:: mne_nodes.gui.parameter_widgets
5
+
6
+ All parameter GUI classes expose fully typed constructors to simplify
7
+ configuration and documentation. Refer to the class docstrings for the
8
+ annotated arguments.
9
+
10
+ .. automodule:: mne_nodes.gui.parameter_widgets
11
+ :no-members:
12
+ :no-inherited-members:
13
+
14
+ .. autosummary::
15
+ :toctree: ../generated
16
+
17
+ Param
18
+ BoolGui
19
+ CheckListGui
20
+ ComboGui
21
+ DictGui
22
+ FloatGui
23
+ FuncGui
24
+ IntGui
25
+ LabelGui
26
+ ListGui
27
+ MultiTypeGui
28
+ SliderGui
29
+ StringGui
30
+ DualTupleGui
@@ -0,0 +1,95 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Configuration file for the Sphinx documentation builder.
3
+ #
4
+ # This file only contains a selection of the most common options. For a full
5
+ # list see the documentation:
6
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
7
+
8
+ # -- Path setup --------------------------------------------------------------
9
+
10
+ # If extensions (or modules to document with autodoc) are in another directory,
11
+ # add these directories to sys.path here. If the directory is relative to the
12
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
13
+ #
14
+ from datetime import datetime, timezone
15
+ from importlib.metadata import version
16
+
17
+ # import sys
18
+
19
+ # from os.path import dirname, abspath, join
20
+
21
+ # curdir = dirname(__file__)
22
+ # sys.path.append(abspath(join(curdir, "..", "..", "mne_nodes")))
23
+
24
+ # # Import module because of annoying import problem on CIs
25
+ from mne_nodes.gui import parameter_widgets
26
+
27
+ module_list = list()
28
+ module_list.append(parameter_widgets)
29
+
30
+ # -- Project information -----------------------------------------------------
31
+ project = "mne-nodes"
32
+ author = "Martin G. Schulz"
33
+
34
+ td = datetime.now(tz=timezone.utc)
35
+ copyright = (
36
+ f"2019-{datetime.now().year}, {author}, "
37
+ f'Last updated {td.strftime("%Y-%m-%d %H:%M %Z")}'
38
+ )
39
+
40
+ # The full version, including alpha/beta/rc tags
41
+ release = version("mne_nodes")
42
+ # The short X.Y version.
43
+ version = ".".join(release.split(".")[:2])
44
+
45
+ # -- General configuration ---------------------------------------------------
46
+
47
+ # Add any Sphinx extension module names here, as strings. They can be
48
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
49
+ # ones.
50
+ extensions = ["sphinx.ext.autodoc", "sphinx.ext.autosummary", "sphinx.ext.napoleon"]
51
+
52
+ # Add any paths that contain templates here, relative to this directory.
53
+ templates_path = ["_templates"]
54
+
55
+ # List of patterns, relative to source directory, that match files and
56
+ # directories to ignore when looking for source files.
57
+ # This pattern also affects html_static_path and html_extra_path.
58
+ exclude_patterns = []
59
+
60
+ # -- Options for HTML output -------------------------------------------------
61
+
62
+ # The theme to use for HTML and HTML Help pages. See the documentation for
63
+ # a list of builtin themes.
64
+ #
65
+ html_theme = "pydata_sphinx_theme"
66
+ switcher_version_match = "dev" if ".dev" in version else version
67
+ html_theme_options = {
68
+ "icon_links": [
69
+ dict(
70
+ name="GitHub",
71
+ url="https://github.com/marsipu/mne-nodes",
72
+ icon="fa-brands fa-square-github fa-fw",
73
+ ),
74
+ ],
75
+ "icon_links_label": "External Links",
76
+ "navbar_end": [
77
+ "theme-switcher",
78
+ "version-switcher",
79
+ "navbar-icon-links",
80
+ ],
81
+ "navbar_align": "left",
82
+ "navbar_persistent": ["search-button"],
83
+ "footer_start": ["copyright"],
84
+ "secondary_sidebar_items": ["page-toc", "edit-this-page"],
85
+ # Todo: Insert versions url from webpage
86
+ # "switcher": {
87
+ # "json_url": "<version-url>/versions.json",
88
+ # "version_match": switcher_version_match,
89
+ # },
90
+ }
91
+
92
+ # Add any paths that contain custom static files (such as style sheets) here,
93
+ # relative to this directory. They are copied after the builtin static files,
94
+ # so a file named "default.css" will overwrite the builtin "default.css".
95
+ html_static_path = ["_static"]
@@ -0,0 +1 @@
1
+ This is the development main page.
@@ -0,0 +1,23 @@
1
+ Custom Modules/Functions
2
+ ========================
3
+ To extend the functionality of **mne-nodes**, you can add custom modules.
4
+ .. ToDo: From the gui, you can add custom modules by
5
+
6
+ The configuration file (JSON) is expected to be in the same directory as the module.
7
+
8
+ Inputs
9
+ ------
10
+ The inputs are expected to be all arguments from the function without a default value (args).
11
+ Their name needs to be identical to the names of return statements from other functions.
12
+
13
+ Outputs
14
+ -------
15
+ Outputs need to be a name variable that is returned from the function. If you want to return static values, just define any variable so they can appear as outputs in the nodes.
16
+
17
+ Parameters
18
+ ----------
19
+
20
+
21
+ Plot Functions
22
+ --------------
23
+ There are mutliple possibilities to use plots in a custom function. For example you could plot a matplotlib plot interactively with the PyQt backend. Or you could decide to not show the plot and just save it to a file to use later. To make the plot interactively, make sure to set ``block=True`` for example in ``raw.plot(block=True)`` or with ``plt.show(block=True)``.
@@ -0,0 +1,16 @@
1
+ Functions
2
+ =========
3
+ Function names must be always unique.
4
+
5
+ Parameters
6
+ ==========
7
+ Parameters are stored per function, thus parameters with the same name can exist in different functions with different values.
8
+ The parameters are configured per function.
9
+
10
+ Parameter Names
11
+ ---------------
12
+ While parameters of different functions can have the same name, parameter names within a function must be unique.
13
+
14
+ Set a parameter to None
15
+ -----------------------
16
+ To set a parameter to None, uncheck the checkbox next to the parameter name. To allow this, *none_select* has to be set to ``True`` in the parameter configuration.
File without changes
@@ -0,0 +1,7 @@
1
+ Settings
2
+ ========
3
+ There are two different ways, application settings are stored in MNE-Nodes.
4
+ It depends on whether the settings is device-specific or project-specific.
5
+ For device-specific settings, such as the number of jobs or whether cuda is enabled, are stored either with *Settings* in a JSON file located in an OS-dependent directory.
6
+ The user-specific settings are used to store user preferences, such as the image format or the appearance of the GUI.
7
+ These settings are stored in the configuration file used to configure a project.
@@ -0,0 +1,35 @@
1
+ :html_theme.sidebar_secondary.remove:
2
+
3
+ .. title:: mne-nodes
4
+
5
+ .. The page title must be in rST for it to show in next/prev page buttons.
6
+ Therefore we add a special style rule to only this page that hides h1 tags
7
+
8
+ .. raw:: html
9
+
10
+ <style type="text/css">h1 {display:none;}</style>
11
+
12
+ Welcome to mne-nodes's documentation!
13
+ ===========================================
14
+
15
+ .. toctree::
16
+ :maxdepth: 2
17
+ :caption: Contents:
18
+
19
+
20
+
21
+
22
+ Indices and tables
23
+ ==================
24
+
25
+ * :ref:`genindex`
26
+ * :ref:`modindex`
27
+ * :ref:`search`
28
+
29
+ .. toctree::
30
+ :hidden:
31
+
32
+ Install <install/index>
33
+ Documentation <documentation/index>
34
+ API Reference <api/index>
35
+ Development <development/index>
@@ -0,0 +1 @@
1
+ How to install
@@ -0,0 +1,35 @@
1
+ """
2
+ Authors: Martin Schulz <dev@mgschulz.de>
3
+ License: BSD 3-Clause
4
+ GitHub: https://github.com/marsipu/mne-nodes
5
+ """
6
+
7
+ import os
8
+ import sys
9
+
10
+
11
+ # Global variables to check the platform
12
+ ismac = sys.platform.startswith("darwin")
13
+ iswin = sys.platform.startswith("win32")
14
+ islin = not ismac and not iswin
15
+
16
+ # Variable to store gui/headless mode, should not be imported directly
17
+ # but accessed via mne_nodes.gui_mode
18
+ gui_mode = True
19
+
20
+
21
+ # Check if running in debug mode
22
+ def debug_mode():
23
+ return os.environ.get("MNENODES_DEBUG", False) == "true"
24
+
25
+
26
+ # Keep reference to Qt-objects without parent for tests
27
+ # and to avoid garbage collection
28
+ _widgets = {
29
+ "main_window": None,
30
+ "viewer": None,
31
+ "plot_manager": None,
32
+ "dialogs": {},
33
+ "parameter_widgets": {},
34
+ "color_tester": None,
35
+ }
@@ -0,0 +1,92 @@
1
+ """
2
+ Authors: Martin Schulz <dev@mgschulz.de>
3
+ License: BSD 3-Clause
4
+ GitHub: https://github.com/marsipu/mne-nodes
5
+ """
6
+
7
+ import argparse
8
+ import logging
9
+ import sys
10
+
11
+ import qtpy
12
+ from qtpy.QtCore import QTimer, Qt
13
+ from qtpy.QtWidgets import QApplication
14
+
15
+ import mne_nodes
16
+ from mne_nodes.gui.gui_utils import set_app_font_size, set_app_theme
17
+ from mne_nodes.pipeline.controller import Controller
18
+ from mne_nodes.pipeline.exception_handling import UncaughtHook
19
+ from mne_nodes.pipeline.streams import init_streams, init_logging
20
+
21
+ app_name = "mne-nodes"
22
+ organization_name = "marsipu"
23
+ domain_name = "https://github.com/marsipu/mne-nodes"
24
+
25
+
26
+ def main() -> None:
27
+ # ToDo: Change Debug mode initialization (command-line, enviroment-variable, settings)
28
+ init_logging(mne_nodes.debug_mode())
29
+ logging.info("Starting MNE-Nodes...")
30
+ # Set gui_mode to true since starting as module always means gui-mode
31
+ mne_nodes.gui_mode = True
32
+ # Create QApplication
33
+ app = QApplication.instance()
34
+ if app is None:
35
+ app = QApplication(sys.argv)
36
+ app.setApplicationName(app_name)
37
+ app.setOrganizationName(organization_name)
38
+ app.setOrganizationDomain(domain_name)
39
+ # For Spyder to make console accessible again
40
+ app.lastWindowClosed.connect(app.quit)
41
+
42
+ # Avoid file-dialog-problems with custom file-managers in linux
43
+ if mne_nodes.islin:
44
+ app.setAttribute(Qt.ApplicationAttribute.AA_DontUseNativeDialogs, True)
45
+
46
+ # Initialize streams from stdout/stderr into Qt
47
+ init_streams()
48
+
49
+ # Show Qt-binding
50
+ logging.info(f"Using {qtpy.API_NAME} {qtpy.QT_VERSION}")
51
+
52
+ # Initialize Exception-Hook
53
+ if mne_nodes.debug_mode():
54
+ logging.info("Debug-Mode is activated")
55
+ else:
56
+ qt_exception_hook = UncaughtHook()
57
+ sys.excepthook = qt_exception_hook.exception_hook
58
+
59
+ # Set style and font
60
+ set_app_theme()
61
+ set_app_font_size()
62
+
63
+ # Initialize controller and main window
64
+ controller = Controller()
65
+
66
+ # Late import of MainWindow, since importing it at the top-level seems to cause Windows fatal access errors when opening dialogs in some cases.
67
+ from mne_nodes.gui.main_window import MainWindow
68
+
69
+ MainWindow(controller)
70
+
71
+ # Command-Line interrupt with Ctrl+C possible
72
+ timer = QTimer()
73
+ timer.timeout.connect(lambda: None)
74
+ timer.start(500)
75
+
76
+ sys.exit(app.exec())
77
+
78
+
79
+ if __name__ == "__main__":
80
+ # Parse command line arguments
81
+ parser = argparse.ArgumentParser(
82
+ prog="MNE-Nodes", description="A GUI with Nodes for MNE-Python"
83
+ )
84
+ parser.add_argument(
85
+ "--nogui", "-n", action="store_true", help="Run headless without GUI"
86
+ )
87
+ cli_args = parser.parse_args(sys.argv[1:])
88
+
89
+ if cli_args.nogui:
90
+ mne_nodes.gui_mode = False
91
+
92
+ main()