High-Performance 3D Brain Visualization & Analysis
MNE Analyze Python is a cutting-edge desktop application designed for the visualization and analysis of MNE-Python source estimation data. Built on PySide6 for a modern, responsive user interface and wgpu-py (WebGPU) for next-generation hardware-accelerated 3D rendering, it offers a distinct performance advantage over traditional OpenGL-based viewers.
This tool is specifically engineered for researchers and clinicians working with MEG/EEG data who need to visualize cortical activity in real-time, explore raw signal recordings, and inspect source time courses with high fidelity.
- WebGPU Powered: Utilizes the latest graphics API standards via
wgpu-pyto render high-resolution cortical surfaces efficiently. - Dynamic Visualization: Real-time rendering of "Electric" source activity superimposed on the brain surface.
- Atlas Support: Toggle between dynamic source activation and static Atlas region visualization (e.g., Desikan-Killiany).
- Butterfly Traces: Overlay global signal traces directly on the 3D view for temporal context.
- Subject Configuration Panel: A dedicated sidebar allows you to easily manage and switch between files for a specific subject:
- Raw Recordings: Load
.fiffiles to inspect sensor-level data. - Surfaces: Import cortical surface geometries (
.gii,.obj, etc.). - Atlases: Load parcellation labels/annotations.
- Source Estimates (STC): Independently load Left Hemisphere (
-lh.stc) and Right Hemisphere (-rh.stc) source time courses.
- Raw Recordings: Load
- Raw Data Browser: A fully integrated, interaction-rich plot for exploring raw MEG/EEG sensor data. Features include zooming, panning, and time-locking with the 3D view.
- Source Traces Browser: A dedicated tab for visualizing source-level time courses (butterfly plots), automatically synchronized when you load an STC file.
- Time-Locked Playback: Scrub through time or play back the neural activity.
- Interactive Navigation: Intuitive camera controls for the 3D view.
- Keyboard Shortcuts: Rapidly toggle modes (T), traces (P), or playback (Space).
Before installing, ensure your system meets the following requirements:
- Operating System: macOS 12+, Windows 10/11, or modern Linux distribution.
- Python: Version 3.10 or higher.
- Graphics Hardware: A GPU compatible with WebGPU, Vulkan, Metal, or DirectX 12.
- Note: This application relies on
wgpu-pywhich accesses the GPU directly. Older integrated graphics requiring legacy OpenGL drivers may not work.
- Note: This application relies on
git clone https://github.com/your-username/mne-analyze-python.git
cd mne-analyze-pythonIt is highly recommended to use a virtual environment to manage dependencies.
Using venv:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activateUsing uv (Faster):
pip install uv
uv venv
source .venv/bin/activateInstall the package in editable mode to ensure all dependencies (including MNE, PySide6, and wgpu) are installed correctly.
pip install -e .Once installed, you can launch the application directly from the root directory:
python main.pyThe application window is divided into three main areas:
- Left Sidebar (Controls): Manage Visualization settings (
ElectricvsAtlas) and Subject Configuration. - Central View: The main 3D Brain Viewport.
- Tabs: Switch between the Brain View, Raw Browser (sensor data), and Source Traces (source data).
Use the Subject Configuration section in the top-left to load your files:
- Click the Folder Icon next to Recording to open a
.fiffile. This populate the "Raw Browser". - Click the Folder Icon next to Source (LH) or Source (RH) to load source estimates. This will populate the "Source Traces" tab and the 3D view.
- 3D View: Click and drag to rotate. Scroll to zoom. Right-click and drag to pan.
- Keyboard Shortcuts:
Space: Play / Pause animation.T: Toggle between Source Activation view and Atlas Region view.P: Toggle "Butterfly Traces" overlay on the 3D view.
- "WebGPU device not available": Ensure your GPU drivers are up to date and support Vulkan (Windows/Linux) or Metal (macOS).
- Performance Issues: If rendering is slow, check if the application is using your dedicated GPU instead of integrated graphics (common on laptops).
MIT License. See LICENSE for details.