How to use Lab Streaming Layer (LSL) for data streaming for NIRS
Real Time Data Streaming with LSL
In this article you can find instructions on how to receive data in real time via LSL, for the purpose of implementing your own real time analysis. If you are interested in a real time analysis solution, consider Turbo Satori, a dedicated fNIRS BCI and Neurofeedback software, which is available for purchase. NIRx does not provide custom scripts/support in how to analyze the data in real time.
Lab Streaming Layer (LSL) is protocol that consists of a collection of libraries and tools that allow for real-time data and triggering streaming as well as multi-modal time-synchronization. The communication can be controlled using different programming languages (C, C++, Python, Java, C#, Matlab) and under different platforms (Mac, Windows, Unix). LSL requires that any software sending or receiving data is on the same network (could be the same computer, for example).
LSL with Aurora and NIRStar
NIRx allows users to stream data in real time using LSL. Both raw data and hemoglobin concentration data are streamed. For more information on the structure of the streamed data, refer to the NIRStar and Aurora manuals.
The LSL stream is automatically enabled in Aurora - the user doesn't need to do anything to turn the stream on.
The LSL stream must be enabled in NIRStar. To do so, navigate to 'Configure Hardware>Data Streaming'. Under 'Lab Streaming Layer', toggle the 'Enable LSL Streaming' button.
Any triggers that are received in NIRStar and Aurora are sent out on an LSL stream called 'NIRStar Triggers'. Note that the triggers are sampled at the same rate as the fNIRS data.
-
Implementing Real Time Data Streaming with LSL
To download the LSL library for streaming data in various applications, see the github repository here.
-
We provide instructions for streaming NIRx data in MATLAB below.
-
If using a mac and you run into an error, according to the LSL Matlab Github repository:
"On MacOS, you may still get an error similar to Invalid MEX-file [...] lsl_loadlib_.mexmaci64; Reason: image not found.. To fix this run the following command in a Terminal window from within the liblsl-Matlab directory: install_name_tool -add_rpath "@loader_path/" bin/lsl_loadlib_.mexmaci64"
Source and original post: Nirx Help Center
The content published here is the exclusive responsibility of the authors.