mne-qt-browser


Namemne-qt-browser JSON
Version 0.6.2 PyPI version JSON
download
home_page
SummaryA new backend based on pyqtgraph for the 2D-Data-Browser in MNE-Python
upload_time2024-03-19 13:09:56
maintainer
docs_urlNone
author
requires_python>=3.9
licenseBSD 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": "",
    "name": "mne-qt-browser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "neuroscience,psychology,science",
    "author": "",
    "author_email": "Martin Schulz <dev@mgschulz.de>",
    "download_url": "https://files.pythonhosted.org/packages/a5/db/cc5fecfa19e96fc15a806df1e722635195d2c998fc961dba6a37005381e4/mne_qt_browser-0.6.2.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.2",
    "project_urls": {
        "changelog": "http://github.com/mne-tools/mne-qt-browser/releases",
        "homepage": "https://mne.tools/mne-bids-pipeline",
        "repository": "https://github.com/mne-tools/mne-bids-pipeline"
    },
    "split_keywords": [
        "neuroscience",
        "psychology",
        "science"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "233126975ad8b0433448aefd4bbdf5bbde5f59e4e3f29c869c4464c0e9903429",
                "md5": "dfef0326143493e4dac338bc3fd14af8",
                "sha256": "dd143462cfa2d9088a26b4b469fd398e0d2216761bdff1387eb920920a9e4e19"
            },
            "downloads": -1,
            "filename": "mne_qt_browser-0.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dfef0326143493e4dac338bc3fd14af8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 74366,
            "upload_time": "2024-03-19T13:09:53",
            "upload_time_iso_8601": "2024-03-19T13:09:53.971417Z",
            "url": "https://files.pythonhosted.org/packages/23/31/26975ad8b0433448aefd4bbdf5bbde5f59e4e3f29c869c4464c0e9903429/mne_qt_browser-0.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a5dbcc5fecfa19e96fc15a806df1e722635195d2c998fc961dba6a37005381e4",
                "md5": "79657c11b884eb5b880123398ec951cc",
                "sha256": "4dc265e3eb5d8577c4da11e8a2bf5aeb7c7e2f73fa54d594a8b2d0e0b04ae5d4"
            },
            "downloads": -1,
            "filename": "mne_qt_browser-0.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "79657c11b884eb5b880123398ec951cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 59220,
            "upload_time": "2024-03-19T13:09:56",
            "upload_time_iso_8601": "2024-03-19T13:09:56.039444Z",
            "url": "https://files.pythonhosted.org/packages/a5/db/cc5fecfa19e96fc15a806df1e722635195d2c998fc961dba6a37005381e4/mne_qt_browser-0.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-19 13:09:56",
    "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"
}
        
Elapsed time: 0.22149s