API References๐
This is the reference for classes (CamelCase names) and functions
(underscore_case names) of mne_lsl grouped thematically.
Most-used classes๐
The main objects offer efficient communication with numerical streams.
Stream๐
A Stream uses an MNE-like API to efficiently interacts with a
numerical stream. Stream objects inherit from the abstract object
BaseStream.
Stream object representing a single LSL stream. |
EpochsStream๐
An EpochsStream can be used to create epochs from a Stream.
Stream object representing a single real-time stream of epochs. |
Player๐
A Player can mock a real-time stream from any MNE readable file.
Class for creating a mock LSL stream. |
LSL (low-level)๐
If the high-level API is not sufficient, the low-level API interface directly with liblsl, with a similar API to pylsl.
Compared to pylsl, mne_lsl.lsl pulls a chunk of numerical data
faster thanks to numpy. In numbers, pulling a 1024 samples chunk with 65 channels in
double precision (float64) to python takes:
4.33 ms ยฑ 37.5 ยตs with
pylsldefault behavior471 ns ยฑ 1.7 ns with
pylslusing andarrayasdest_objto prevent memory re-allocation268 ns ยฑ 0.357 ns with
mne_lsl.lslwhich usesnumpy.frombuffer()under the hood
More importantly, pylsl default behavior pulls a chunk in linear time O(n),
scalings with the number of values; while mne_lsl.lsl pulls a chunk in constant time
O(1). Additional details on the differences with pylsl and mne_lsl can be
found here.
Base Stream information object, storing the declaration of a stream. |
|
An inlet to retrieve data and metadata on the network. |
|
An outlet to share data and metadata on the network. |
|
Version of the binary LSL library. |
|
Version of the LSL protocol. |
|
Obtain a local system timestamp in seconds. |
|
Resolve streams on the network. |
Abstraction layer๐
An abstraction layer is provided to create a Stream object that uses a different
communication protocol than LSL. An object inheriting from
BaseStream will be compatible with other objects from
mne-lsl. For instance, it will be possible to epoch the stream with
EpochsStream.
Stream object representing a single real-time stream. |
Utilities๐
Logging utilities are available to interact with mne_lsl logger.
Add a file handler to the logger. |
|
Set the log level for the logger. |
Development utilities are available to help debug a setup.
Print the system information for debugging. |
Legacy๐
Legacy classes and functions will be replaced with backward incompatible equivalent in future versions.
Class for visualizing the signals coming from an LSL stream. |