MNE-LSL Integration#

MNE-LSL is a Python package that bridges MNE-Python with the Lab Streaming Layer (LSL) for real-time EEG data streaming, processing, and visualization.

MNE-LSL StreamViewer

StreamViewer displaying real-time EEG with eyes-closed alpha activity.#


Installation#

Install MNE-LSL using pip:

pip install mne-lsl

For real-time visualization with StreamViewer, install with Qt backend:

pip install mne-lsl PyQt5

Quick Navigation#

Processing

Connect, filter, and epoch streams

Connect a Device
Classification

Build closed-loop BCIs

Brain-Computer Interfaces
Visualization

Real-time EEG monitoring

Stream Viewer

Quick Examples#

View real-time data from your Wearable Sensing headset:

Launch StreamViewer for real-time monitoring#
from mne_lsl.stream import StreamViewer

stream_name = "DSI-24"  # Or DSI-VR300, DSI-7, WS-default
StreamViewer(stream_name=stream_name).start()

Replay pre-recorded data

This example replays data from an EDF file, such as those exported by DSI-Streamer, as an LSL stream for testing:

Replay EDF file as LSL stream for testing#
import time
from mne.io import read_raw_edf
from mne_lsl.player import PlayerLSL as Player

path_to_edf = "C:/path/to/your/data.edf"  # Replace with your EDF file path
raw = read_raw_edf(path_to_edf, preload=True)
player = Player(raw, chunk_size=200, n_repeat=1, name="example-edf-replay").start()

while player.running:
    time.sleep(0.5)

del player

Tutorial Sections#

Processing#

Classification#

Visualization#


Resources#