Skip to main content

Python package for browsing video and audio time-synchronized to MEG/EEG data

Project description

Video and audio browser extension for MNE-Python's Qt data browser

Documentation Status

This is an open-source Python package for browsing video and audio time-synchronized to MEG/EEG data. It serves as an add-on for mne-qt-browser, which is part of MNE-Python, an open-source Python package for exploring, visualizing, and analyzing human neurophysiological data.

This project also complements Helsinki VideoMEG project by supporting video and audio files recorded with their software.

VideoMEG browser screenshot Screenshot of the browser extension showing a black video frame and a test audio file synchronized with MNE-Python's sample MEG data.

Features

  • Time-synchronized video browsing and playback with MEG/EEG data
  • Time-synchronized audio browsing and playback with MEG/EEG data
  • Support for multiple video and MEG files simultaneously (only one audio file with multiple channels at a time)
  • Support for Helsinki VideoMEG project format files
  • Standard video format support (MP4, AVI, etc.) via OpenCV (for audio only Helsinki VideoMEG format is currently supported)

Documentation

Documentation contains installation instructions (same as below), public API reference, and some of the usage examples available in the GitHub. A bit of the code structure and implementation details are also documented.

Installation

In addition to MNE-Python, this project requires package OpenCV for standard video file (such as .mp4) reading and sounddevice for audio playback. Recommended way to install MNE-Python and thus this package is using conda.

Using conda (recommended)

  1. Create a new conda environment (named mne-videobrowser) with this package and all dependencies installed:

    conda create --channel=conda-forge --strict-channel-priority --name=mne-videobrowser mne-videobrowser
    
  2. Activate the environment:

    conda activate mne-videobrowser
    
  3. Only on linux: If you do not have PortAudio library, which is dependency of sounddevice installed, install it. For example on Ubuntu/Debian:

    sudo apt install libportaudio2
    

Using pip

  1. Activate your desired Python environment (documentation for virtual environments).

  2. Install this package, all dependencies will be installed automatically, except for a Qt binding, so you need to specify that in the command line as well if you don't have one (we recommend PySide6):

    pip install mne-videobrowser PySide6
    
  3. Only on linux: If you do not have PortAudio library, which is dependency of sounddevice installed, install it. For example on Ubuntu/Debian:

    sudo apt install libportaudio2
    

See usage examples in GitHub.

For developers

Installation for development

  1. Clone this repository and navigate to project root.

  2. Run

    conda env create -f environment.yml
    

    This will create a conda environment mne-videobrowser-dev, that has development dependencies and the package installed in editable mode, which ensures that changes in source code are reflected to the installed package.

  3. Activate the environment:

    conda activate mne-videobrowser-dev
    
  4. Only on linux: If you do not have PortAudio library, which is dependency of sounddevice installed, install it. For example on Ubuntu/Debian:

    sudo apt install libportaudio2
    

Running tests

Tests are located in directory tests/ and they run using package pytest (included in development dependencies).

You can run all the tests with:

pytest

You can also selectively run tests in a specific file/class/method. See pytest documentation for details.

Building documentation

Documentation source files are located in docs/source/ and built documentation in docs/build/. Documentation is mostly automatically generated from the source code docstrings using sphinx. To build the documentation:

cd docs
make html  # on Windows use 'make.bat html'

Then view the built html documentation by opening file docs/build/html/index.html in a web browser.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mne_videobrowser-0.2.0.tar.gz (474.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mne_videobrowser-0.2.0-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file mne_videobrowser-0.2.0.tar.gz.

File metadata

  • Download URL: mne_videobrowser-0.2.0.tar.gz
  • Upload date:
  • Size: 474.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for mne_videobrowser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 517c582345fa9da08750e8f52ba2ddc2a38f8b6371a644c5e6f853029f2f9b00
MD5 b9ae66ccce852c39ebdcfa5e51b97e12
BLAKE2b-256 809f725adbf1244a7a7c32297d5ed3c59f3000fca0a68d7c5bc0bd346700feb1

See more details on using hashes here.

File details

Details for the file mne_videobrowser-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mne_videobrowser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b4bf2d1f04446715f023dfbe0e81e000f2355ebe49f5206e5cf1464a55fdf0c
MD5 d4d9ff6c33e42d4c3707ca25d64538b1
BLAKE2b-256 02af9df3babe4b78c11d4626f30ac6fb16c226a76cc542e87a98c4ff892d4e2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page