Stream Viewer#
Visualize real-time EEG data from Wearable Sensing devices using MNE-LSL’s StreamViewer.
Launch LSL Stream Viewer#
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:
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:
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:
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:
Apply filtering - Clean signals and remove noise
Create epochs - Extract event-related segments
Build BCIs - Develop neurofeedback and classification systems
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.