Stream Viewer#

Visualize real-time EEG data from Wearable Sensing devices using MNE-LSL’s StreamViewer.


Launch LSL Stream Viewer#

MNE-LSL StreamViewer

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

Once your LSL stream is running (see LSL Setup), use the following code with the stream name to start StreamViewer and visualize the data in real-time:

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

stream_name = "WS-default"  # Or DSI-24, DSI-VR300, WS-default

viewer = StreamViewer(stream_name=stream_name)
viewer.start()

Finding Your Stream Name

If unsure of your stream name, check the LSL GUI or use stream discovery to list available streams.


Customize the Viewer by Channel and Duration#

The StreamViewer can be customized to display specific channels and adjust the time window shown using the GUI tools, or programmatically as follows:

Customize StreamViewer with specific channels and time window#
from mne_lsl.stream import StreamViewer

stream_name = "WS-default"  # Change to your stream name
viewer = StreamViewer(
    stream_name=stream_name,
    window_duration=10.0,  # Show 10 seconds
    picks=['Cz'],  # Specific channels
)
viewer.start()

View Filtered Streams from StreamLSL#

If you want to visualize filtered data, first create a StreamLSL object, apply filters, and then pass it to StreamViewer:

Visualize filtered streams in real-time#
from mne_lsl.stream import StreamLSL, StreamViewer

stream_name = "WS-default"  # Change to your stream name

# Filter the stream using StreamLSL built in methods
stream = StreamLSL(bufsize=10, name=stream_name).connect()
stream.filter(l_freq=1.0, h_freq=40.0)
stream.notch_filter(freqs=60.0)

# Visualize the filtered stream
viewer = StreamViewer(stream=stream)
viewer.start()

stream.disconnect()

Next Steps#

Now that you can visualize your data in real-time:

  1. Apply filtering - Clean signals and remove noise

  2. Create epochs - Extract event-related segments

  3. Build BCIs - Develop neurofeedback and classification systems

  4. MNE-Python analysis - Offline analysis and advanced processing


Troubleshooting#

Window won’t open: See Installation and ensure dependencies are met.

Choppy display: Reduce window duration or number of channels.

No signal: Check stream is running and accessible.


Resources#