Name | mne-qt-browser JSON |
Version |
0.6.3
JSON |
| download |
home_page | None |
Summary | A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python |
upload_time | 2024-06-10 17:26:28 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | BSD 3-Clause License Copyright (c) 2021-2022, authors of mne-qt-browser All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
keywords |
neuroscience
psychology
science
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
# mne-qt-browser
## A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python.
![Screenshot of mne-qt-browser](https://github.com/mne-tools/mne-qt-browser/raw/main/screenshot.png)
This repository hosts the code for an alternative backend for plotting 2D-Data with
[MNE-Python](https://github.com/mne-tools/mne-python).
The backend is based on [pyqtgraph](https://github.com/pyqtgraph/pyqtgraph)
which uses Qt's [Graphics View Framework](https://doc.qt.io/qt-5/graphicsview.html)
for the plotting.
Development started as a [2021's Google Summer of Code Project](https://github.com/marsipu/gsoc2021).
## Installation
Install **full MNE-Python version 1.0 or greater** with the instructions provided [here](https://mne.tools/stable/install/mne_python.html#d-plotting-and-source-analysis) or install **minimal MNE-Python** with
### pip
```
pip install "mne>=1.0" matplotlib mne-qt-browser
```
or
### conda
```
conda install -c conda-forge mne-base matplotlib mne-qt-browser
```
## Update
Refer to the [MNE-Python documentation](https://mne.tools/stable/install/updating.html) for updating MNE-Python.
To update this package, do:
```
pip install -U mne-qt-browser
```
To update this package to the development version, do:
```
pip install -U --no-deps https://github.com/mne-tools/mne-qt-browser/archive/refs/heads/main.zip
```
## Usage
The backend supports plotting for the following MNE-Python methods:
- [`mne.io.Raw.plot()`](https://mne.tools/dev/generated/mne.io.Raw.html?highlight=raw%20plot#mne.io.Raw.plot)
- [`mne.Epochs.plot()`](https://mne.tools/dev/generated/mne.Epochs.html?highlight=epochs%20plot#mne.Epochs.plot)
- [`mne.preprocessing.ICA.plot_sources(raw)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources)
- [`mne.preprocessing.ICA.plot_sources(epochs)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources)
In the following example, we'll read M/EEG raw data from the MNE `sample` dataset
and plot it using the `qt`-backend.
(For mne-version >= 1.0 the `qt`-backend will be the default)
```python
from pathlib import Path
import mne
sample_dir = mne.datasets.sample.data_path()
raw_path = Path(sample_dir) / 'MEG' / 'sample' / 'sample_audvis_raw.fif'
raw = mne.io.read_raw(raw_path)
mne.viz.set_browser_backend('qt') # Enable mne-qt-browser backend if mne < 1.0
raw.plot(block=True)
```
If the plot is not showing, search for solutions in the
[troubleshooting](#troubleshooting) section below.
This will use the `mne-qt-browser` for the current Python session. If you
want to make this change permanent, so you don't have to use the
`set_browser_backend()` each time after restarting Python, run the following
line to modify your MNE configuration file:
```python
import mne
mne.set_config('MNE_BROWSER_BACKEND', 'qt')
```
## Troubleshooting
### Running from a script
If you are running a script containing `raw.plot()` like
```console
python example_script.py
```
the plot will not stay open when the script is done.
To solve this either change `raw.plot()` to `raw.plot(block=True)` or run the script with the interactive flag
```console
python -i example_script.py
```
### IPython
If the integration of the Qt event loop is not activated for IPython, a plot with `raw.plot()` will freeze.
Do avoid that either change `raw.plot()` to `raw.plot(block=True)` or activate the integration of the event loop with
```console
%gui qt5
```
### Report Bugs & Feature Requests
Please report bugs and feature requests in the [issues](https://github.com/mne-tools/mne-qt-browser/issues) of this repository.
### Development and testing
You can run a benchmark locally with:
```console
pytest -m benchmark mne_qt_browser
```
To run the PyQtGraph tests you have to run:
```
pytest mne_qt_browser/tests/test_pg_specific.py
```
Additionally, clone mne-python, and then run:
```console
pytest -m pgtest ../mne-python/mne/viz/tests
```
If you do not have OpenGL installed, this will currently raise errors, and
you'll need to add this line to `mne/conftest.py` after the `error::` line:
```raw
ignore:.*PyOpenGL was not found.*:RuntimeWarning
```
Raw data
{
"_id": null,
"home_page": null,
"name": "mne-qt-browser",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "neuroscience, psychology, science",
"author": null,
"author_email": "Martin Schulz <dev@mgschulz.de>",
"download_url": "https://files.pythonhosted.org/packages/c3/e8/b88c4893c8cc05d4b95770cac93a6ebe406eb812b46d1b44079422c63962/mne_qt_browser-0.6.3.tar.gz",
"platform": null,
"description": "# mne-qt-browser\n\n## A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python.\n\n![Screenshot of mne-qt-browser](https://github.com/mne-tools/mne-qt-browser/raw/main/screenshot.png)\n\nThis repository hosts the code for an alternative backend for plotting 2D-Data with \n[MNE-Python](https://github.com/mne-tools/mne-python).\n\nThe backend is based on [pyqtgraph](https://github.com/pyqtgraph/pyqtgraph) \nwhich uses Qt's [Graphics View Framework](https://doc.qt.io/qt-5/graphicsview.html)\nfor the plotting.\nDevelopment started as a [2021's Google Summer of Code Project](https://github.com/marsipu/gsoc2021).\n\n## Installation\nInstall **full MNE-Python version 1.0 or greater** with the instructions provided [here](https://mne.tools/stable/install/mne_python.html#d-plotting-and-source-analysis) or install **minimal MNE-Python** with\n### pip\n```\npip install \"mne>=1.0\" matplotlib mne-qt-browser\n```\nor\n### conda\n```\nconda install -c conda-forge mne-base matplotlib mne-qt-browser\n```\n\n## Update\nRefer to the [MNE-Python documentation](https://mne.tools/stable/install/updating.html) for updating MNE-Python.\nTo update this package, do:\n```\npip install -U mne-qt-browser\n```\nTo update this package to the development version, do:\n```\npip install -U --no-deps https://github.com/mne-tools/mne-qt-browser/archive/refs/heads/main.zip\n```\n\n## Usage\n\nThe backend supports plotting for the following MNE-Python methods:\n\n- [`mne.io.Raw.plot()`](https://mne.tools/dev/generated/mne.io.Raw.html?highlight=raw%20plot#mne.io.Raw.plot)\n- [`mne.Epochs.plot()`](https://mne.tools/dev/generated/mne.Epochs.html?highlight=epochs%20plot#mne.Epochs.plot)\n- [`mne.preprocessing.ICA.plot_sources(raw)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources)\n- [`mne.preprocessing.ICA.plot_sources(epochs)`](https://mne.tools/dev/generated/mne.preprocessing.ICA.html?highlight=ica%20plot_sources#mne.preprocessing.ICA.plot_sources)\n\nIn the following example, we'll read M/EEG raw data from the MNE `sample` dataset\nand plot it using the `qt`-backend.\n(For mne-version >= 1.0 the `qt`-backend will be the default)\n\n```python\nfrom pathlib import Path\nimport mne\n\nsample_dir = mne.datasets.sample.data_path()\nraw_path = Path(sample_dir) / 'MEG' / 'sample' / 'sample_audvis_raw.fif'\nraw = mne.io.read_raw(raw_path)\n\nmne.viz.set_browser_backend('qt') # Enable mne-qt-browser backend if mne < 1.0\nraw.plot(block=True)\n```\n\nIf the plot is not showing, search for solutions in the\n[troubleshooting](#troubleshooting) section below.\n\nThis will use the `mne-qt-browser` for the current Python session. If you\nwant to make this change permanent, so you don't have to use the\n`set_browser_backend()` each time after restarting Python, run the following\nline to modify your MNE configuration file:\n\n```python\nimport mne\nmne.set_config('MNE_BROWSER_BACKEND', 'qt')\n```\n\n## Troubleshooting\n\n### Running from a script\n\nIf you are running a script containing `raw.plot()` like\n\n```console\npython example_script.py\n```\n\nthe plot will not stay open when the script is done. \n\nTo solve this either change `raw.plot()` to `raw.plot(block=True)` or run the script with the interactive flag\n\n```console\npython -i example_script.py\n```\n\n### IPython\n\nIf the integration of the Qt event loop is not activated for IPython, a plot with `raw.plot()` will freeze.\nDo avoid that either change `raw.plot()` to `raw.plot(block=True)` or activate the integration of the event loop with\n\n```console\n%gui qt5\n```\n\n### Report Bugs & Feature Requests\n\nPlease report bugs and feature requests in the [issues](https://github.com/mne-tools/mne-qt-browser/issues) of this repository.\n\n### Development and testing\n\nYou can run a benchmark locally with:\n\n```console\npytest -m benchmark mne_qt_browser\n```\n\nTo run the PyQtGraph tests you have to run:\n```\npytest mne_qt_browser/tests/test_pg_specific.py\n```\n\nAdditionally, clone mne-python, and then run:\n\n```console\npytest -m pgtest ../mne-python/mne/viz/tests\n```\n\nIf you do not have OpenGL installed, this will currently raise errors, and\nyou'll need to add this line to `mne/conftest.py` after the `error::` line:\n\n```raw\n ignore:.*PyOpenGL was not found.*:RuntimeWarning\n```\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License Copyright (c) 2021-2022, authors of mne-qt-browser All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
"summary": "A new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python",
"version": "0.6.3",
"project_urls": {
"changelog": "https://github.com/mne-tools/mne-qt-browser/releases",
"homepage": "https://mne.tools/",
"repository": "https://github.com/mne-tools/mne-qt-browser"
},
"split_keywords": [
"neuroscience",
" psychology",
" science"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fb4e3535911f725155f5511e430cb26f15773213f2018404bac6c33e4cb29948",
"md5": "71ef22828c04540d2f10682ede8d83ea",
"sha256": "b865ae2d36344e33d9b10fb14074b322d9e762131f46a7b6e2a389c713069e83"
},
"downloads": -1,
"filename": "mne_qt_browser-0.6.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "71ef22828c04540d2f10682ede8d83ea",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 76123,
"upload_time": "2024-06-10T17:26:26",
"upload_time_iso_8601": "2024-06-10T17:26:26.635033Z",
"url": "https://files.pythonhosted.org/packages/fb/4e/3535911f725155f5511e430cb26f15773213f2018404bac6c33e4cb29948/mne_qt_browser-0.6.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c3e8b88c4893c8cc05d4b95770cac93a6ebe406eb812b46d1b44079422c63962",
"md5": "07c16ce17b0b476b52f2ee779e2cf653",
"sha256": "22bac360d9adb0143c5b768dca04138eaf19b571d8e6bf24684fc9b56f730278"
},
"downloads": -1,
"filename": "mne_qt_browser-0.6.3.tar.gz",
"has_sig": false,
"md5_digest": "07c16ce17b0b476b52f2ee779e2cf653",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 60677,
"upload_time": "2024-06-10T17:26:28",
"upload_time_iso_8601": "2024-06-10T17:26:28.444227Z",
"url": "https://files.pythonhosted.org/packages/c3/e8/b88c4893c8cc05d4b95770cac93a6ebe406eb812b46d1b44079422c63962/mne_qt_browser-0.6.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-10 17:26:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mne-tools",
"github_project": "mne-qt-browser",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "mne-qt-browser"
}