labrecorder 1.0.0rc0__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of labrecorder might be problematic. Click here for more details.
- LICENSE +21 -0
- LabRecorder.cfg +69 -0
- LabRecorderCLI.exe +0 -0
- README.md +184 -0
- labrecorder-1.0.0rc0.dist-info/METADATA +193 -0
- labrecorder-1.0.0rc0.dist-info/RECORD +11 -0
- labrecorder-1.0.0rc0.dist-info/WHEEL +5 -0
- labrecorder-1.0.0rc0.dist-info/licenses/LICENSE +21 -0
- labrecorder.cp312-win_amd64.pyd +0 -0
- lsl.dll +0 -0
- xdfwriter.lib +0 -0
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2012 Christian Kothe
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
LabRecorder.cfg
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
; === Storage Location ===
|
|
2
|
+
; the default file name can be something like C:\\Recordings\\untitled.xdf, but can also contain
|
|
3
|
+
; placeholders. Two placeholder formats are supported: Legacy and BIDS.
|
|
4
|
+
;
|
|
5
|
+
; For BIDS format, only a StudyRoot can be provided.
|
|
6
|
+
; If the full StorageLocation or PathTemplate is provided
|
|
7
|
+
; then it will be assumed that a non-BIDS format is being used.
|
|
8
|
+
;
|
|
9
|
+
; Legacy may contain a running number (incremented per experiment session) called %n, and a
|
|
10
|
+
; placeholder for a "block" label %b (if the config script provides a list of block names that
|
|
11
|
+
; consitute a session.
|
|
12
|
+
;
|
|
13
|
+
; For BIDS, the path may contain %p for participant label, %s for session label,
|
|
14
|
+
; %b for task label (same as block in Legacy), %a for name of acquisition parameter set, and %r index.
|
|
15
|
+
; The BIDS syntax is: path/to/StudyRoot/sub-%p/ses-%s/eeg/sub-%p_ses-%s_task-%b[_acq-%a]_run-%r_eeg.xdf
|
|
16
|
+
;
|
|
17
|
+
; If neither StorageLocation or StudyRoot is provided then the default root is QStandardPaths::DocumentsLocation/CurrentStudy/
|
|
18
|
+
; If neither StorageLocation or PathTemplate are provided, then the BIDS format is assumed, or the file template exp%n/block_%b.xdf if BIDS is unchecked.
|
|
19
|
+
|
|
20
|
+
; StorageLocation=C:/Recordings/CurrentStudy/sub-%p/ses-%s/behav/sub-%p_ses-%s_task-%b_acq-%a_run-%r_eeg.xdf
|
|
21
|
+
; StudyRoot=C:/Recordings/CurrentStudy/
|
|
22
|
+
; PathTemplate=exp%n/block_%b.xdf
|
|
23
|
+
|
|
24
|
+
; === Block Names ===
|
|
25
|
+
; This is optionally a list of blocks that make up a recording session. The blocks are displayed in
|
|
26
|
+
; a list box where the experiment can select a block before pressing record. If used, the blocks
|
|
27
|
+
; may serve as a reminder of where they are in the experiment, but more practically, can be
|
|
28
|
+
; used to determine the file name of the recording. Power users can define scriptable actions
|
|
29
|
+
; associated with selecting a block or pressing Start/Stop for a given block (e.g., for remote
|
|
30
|
+
; control).
|
|
31
|
+
; The syntax is as in: SessionBlocks = "Training","PreBaseline","MainSection","PostBaseline"
|
|
32
|
+
; SessionBlocks="T1", "T2", "T3"
|
|
33
|
+
|
|
34
|
+
; === BIDS modalities ===
|
|
35
|
+
; This is optionally a list of BIDS modalities to be added to the default list defined in the source code.
|
|
36
|
+
; Defaults are: "eeg", "ieeg", "meg", "beh"
|
|
37
|
+
; The selected value will replace the %m placeholder in the filename template.
|
|
38
|
+
; physio is an example from:
|
|
39
|
+
; https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/06-physiological-and-other-continuous-recordings.html
|
|
40
|
+
; BidsModalities="eeg", "ieeg", "meg", "beh", "physio"
|
|
41
|
+
|
|
42
|
+
; === Required Streams ===
|
|
43
|
+
; This is optionally a list of streams that are required for the recording;
|
|
44
|
+
; a warning is issued if one of the streams is not present when the record button is pressed
|
|
45
|
+
; The syntax is as in: RequiredStreams = "BioSemi (MyHostname)","PhaseSpace (MyHostname)","Eyelink (AnotherHostname)"
|
|
46
|
+
; where the format is identical to what the LabRecorder displays in the "Record from streams" list.
|
|
47
|
+
; There must not be any spaces within the parentheses.
|
|
48
|
+
; RequiredStreams="RequiredExample (PC-HOSTNAME)"
|
|
49
|
+
|
|
50
|
+
; === Online Sync ===
|
|
51
|
+
; A list of sync settings. Each setting follows the following format: "SrcStreamName (SrcHostName) post_FLAG"
|
|
52
|
+
; where post_FLAG is described here: https://github.com/sccn/liblsl/blob/master/src/common.h#L77-L89
|
|
53
|
+
; Note that it is not necessary to set any flags for correct storage because all of the post-processing synchronization
|
|
54
|
+
; can be achieved during file import using either the Matlab or Python importers.
|
|
55
|
+
; Examples:
|
|
56
|
+
; OnlineSync="ActiChamp-0 (DM-Laptop) post_ALL", "LiveAmpSN-054211-0237 (User-PC) post_ALL"
|
|
57
|
+
; OnlineSync=["ActiChamp-0 (User-PC)" post_ALL]
|
|
58
|
+
; OnlineSync="SendDataC (Testpc) post_ALL", "Test (Testpc) post_clocksync"
|
|
59
|
+
|
|
60
|
+
; === Remote Control Socket ===
|
|
61
|
+
; A list of options containing 2 possible values:
|
|
62
|
+
; RCSEnabled to control the state of the remote control stream on launch : 1/0; default 1
|
|
63
|
+
; RCSPort to set the port number for the socket; default 22345
|
|
64
|
+
RCSEnabled=1
|
|
65
|
+
RCSPort=22345
|
|
66
|
+
|
|
67
|
+
; === Auto Start Recording ===
|
|
68
|
+
; Set AutoStart to 1 to automatically start recording as soon as the config file has concluded parsing.
|
|
69
|
+
; AutoStart=1
|
LabRecorderCLI.exe
ADDED
|
Binary file
|
README.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
The LabRecorder is the default recording program that comes with LSL. It allows to record all streams on the lab network (or a subset) into a single file, with time synchronization between streams.
|
|
4
|
+
|
|
5
|
+
# File Format
|
|
6
|
+
|
|
7
|
+
The file format used by the LabRecorder is XDF. This is an open general-purpose format that was designed concurrently with LSL and supports all features of LSL streams. The project page is [here](https://github.com/sccn/xdf). There are importers for MATLAB, EEGLAB, BCILAB, Python, and MoBILAB.
|
|
8
|
+
|
|
9
|
+
# Getting LabRecorder
|
|
10
|
+
|
|
11
|
+
The [releases page](https://github.com/labstreaminglayer/App-LabRecorder/releases) contains archives of past LabRecorder builds. Try downloading and installing an archive that matches your platform. Note for Ubuntu users: The deb will install LabRecorder to `/usr/LabRecorder` though we might change this to `/usr/local/bin/LabRecorder` in the future.
|
|
12
|
+
|
|
13
|
+
If there are no archives matching your target platform, or the ones available don't run, then continue reading below. If the instructions don't help then please post an issue to the [repo's issues page](https://github.com/labstreaminglayer/App-LabRecorder/issues).
|
|
14
|
+
|
|
15
|
+
## Dependencies
|
|
16
|
+
|
|
17
|
+
For LabRecorder to work on your system, you might need to first install some dependencies, specifically liblsl and optionally Qt.
|
|
18
|
+
|
|
19
|
+
### Windows
|
|
20
|
+
|
|
21
|
+
The Windows archives ship with nearly all required dependencies. If you have not already installed it via another program, you may need to install the [Visual C++ Runtime Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170).
|
|
22
|
+
|
|
23
|
+
If you suspect you are missing a dependency, try running [DependenciesGui.exe](https://github.com/lucasg/Dependencies/releases) then navigating to the LabRecorder.exe. It's important to launch Dependencies.exe from the same environment that you would use to launch this application: if you launch this application by double-clicking the executable in Windows' finder then do the same on the Dependencies.exe icon; if you launch this application in a Terminal window, then use that same Terminal to launch Dependencies.
|
|
24
|
+
|
|
25
|
+
### MacOS
|
|
26
|
+
|
|
27
|
+
In the near future, many LSL Apps (especially LabRecorder) will not ship with their dependencies and will look for the dependencies to be installed on the system. The easiest way to manage the dependencies is by using [homebrew](https://brew.sh/):
|
|
28
|
+
|
|
29
|
+
* Install homebrew: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
|
30
|
+
* `brew install labstreaminglayer/tap/lsl`
|
|
31
|
+
* `brew install qt`
|
|
32
|
+
|
|
33
|
+
You can then install LabRecorder directly from homebrew: `brew install labrecorder`
|
|
34
|
+
|
|
35
|
+
Run it with `open /usr/local/opt/labrecorder/LabRecorder/LabRecorder.app`
|
|
36
|
+
|
|
37
|
+
### Linux Ubuntu
|
|
38
|
+
|
|
39
|
+
The Ubuntu releases do not typically ship with their dependencies, so you must download and install those:
|
|
40
|
+
|
|
41
|
+
* Download, extract, and install the latest [liblsl-{version}-{target}_amd64.deb from its release page](https://github.com/sccn/liblsl/releases)
|
|
42
|
+
* We hope to make this available via a package manager soon.
|
|
43
|
+
* Quick ref Ubuntu 24.04: `curl -L https://github.com/sccn/liblsl/releases/download/v1.17.4/liblsl-1.17.4-noble_amd64.deb -o liblsl.deb`
|
|
44
|
+
* Quick ref Ubuntu 22.04: `curl -L https://github.com/sccn/liblsl/releases/download/v1.17.4/liblsl-1.17.4-jammy_amd64.deb -o liblsl.deb`
|
|
45
|
+
* You can install liblsl directly by double-clicking on the deb, or with `sudo dpkg -i {filename}.deb` or `sudo apt install {filename}.deb`
|
|
46
|
+
* See the bottom of the [lsl build env docs](https://labstreaminglayer.readthedocs.io/dev/build_env.html).
|
|
47
|
+
* For most cases, this will amount to installing Qt and its dependencies:
|
|
48
|
+
* Ubuntu >= 22.04: `sudo apt-get install qt6-base-dev freeglut3-dev`
|
|
49
|
+
|
|
50
|
+
# Usage
|
|
51
|
+
|
|
52
|
+
The LabRecorder displays a list of currently present device streams under "Record from Streams". If you have turned on a device after you have already started the recorder, click the "Update" button to update the list (this takes ca. 2 seconds).
|
|
53
|
+
> For testing, you can use a "dummy" device from the `lslexamples` found in the [liblsl release assets](https://github.com/sccn/liblsl/releases) (for example SendData<!--, SendStringMarkers, and SendDataSimple-->).
|
|
54
|
+
|
|
55
|
+
If you cannot see streams that are provided on another computer, read the section Network Troubleshooting on the NetworkConnectivity page.
|
|
56
|
+
|
|
57
|
+
You can select which streams you want to record from and which not by checking the checkboxes next to them.
|
|
58
|
+
> 
|
|
59
|
+
|
|
60
|
+
Note that if you have multiple streams with the same name and host, it is impossible to check only 1. If any is checked then they will all be recorded.
|
|
61
|
+
|
|
62
|
+
The entry in "Saving to..." shows you the file name (or file name template) where your recording will be stored. You can change this by modifying the Study Root folder (e.g., by clicking the browse button) and the `File Name / Template` field. If the respective directory does not yet exist, it will be created automatically (except if you do not have the permissions to create it). The file name string may contain placeholders that will be replaced by the values in the fields below. Checking the BIDS box will automatically change the filename template to be BIDS compliant. If the file that you are trying to record to already exists, the existing file will be renamed (the string `_oldX` will be appended where X is the lowest number that is not yet occupied by another existing file). This way, it is impossible to accidentally overwrite data.
|
|
63
|
+
|
|
64
|
+
The Block/Task field can be overwriten or selected among a list of items found in the configuration file.
|
|
65
|
+
|
|
66
|
+
<!--If the checkbox "Enable scripted actions" is checked, then scripted actions that are defined in your current config file will be automatically invoked when you click Start, Stop, or select a block. This check box is by normally unchecked unless you have custom-tailored a configuration to your experiment or experimentation environment.-->
|
|
67
|
+
|
|
68
|
+
Click "Start" to start a recording. If everything goes well, the status bar will now display the time since you started the recording, and more importantly, the current file size (the number before the kb) will grow slowly. This is a way to check whether you are still in fact recording data. The recording program cannot be closed while you are recording (as a safety measure).
|
|
69
|
+
|
|
70
|
+
When you are done recording, click the "Stop" button. You can now close the program. See [the xdf repository](https://github.com/sccn/xdf) for tools and information on how to use the XDF files.
|
|
71
|
+
|
|
72
|
+
## Preparing a Full Study
|
|
73
|
+
|
|
74
|
+
When preparing a new study, it is a good idea to make a custom configuration file which at least sets up a custom storage location for the study. See the documentation in the file `LabRecorder.cfg` for how to do this -- it is very easy! <!--The file `sample_config.cfg` contains a somewhat more advanced setup for reference. By default, the file `default_config.cfg` is loaded at startup.--> You can override this by making a shortcut for the LabRecorder program (e.g. on the desktop) and appending in its properties the command-line arguments `-c name_of_you_config.cfg`. You can also create a batch script. You can also load the config while the program is already running, but this can easily be forgotten during an experiment, so we recommend to follow the shortcut route.
|
|
75
|
+
|
|
76
|
+
In addition to the storage location, if your experiment has multiple blocks (e.g., SubjectTraining, PreBaseline, MainBlock, PostBaseline or the like) you can make the recording process even more straightforward for the experimenters by setting up a default list of block names. Again, take a look at the existing config files.
|
|
77
|
+
|
|
78
|
+
Since it is too easy to forget to turn on or check all necessary recording devices for a study, we recommend to also make a list of "required" streams (by their name) and put it into the config file. These streams will be pre-checked when starting the program, and any missing stream will be displayed in red. If such a stream is still not green when starting the recording, the experimenter will get a message box to confirm that he/she really wants to record without including the device.
|
|
79
|
+
|
|
80
|
+
<!--Advanced users might consider automating further steps in the recording process (for example starting the experiment script itself), which can be done by assinging scripted actions in the configuration file. The file `sample_config.cfg` contains pre-defined actions to remote-control the SNAP experimentation environment. In particular, when you click a block, the corresponding SNAP .cfg file will be loaded, and when you click start, the module will be started. Keep in mind, however, that homegrown scripted actions carry the risk of accidentally crashing the recording program, so they need to be carefully tested. One subtle consideration is that the module definitions happen in the context of the main class of the LabRecorder.-->
|
|
81
|
+
|
|
82
|
+
<!--The following picture shows the the recorder fully configured for a particular study. The BioSemi device is displayed in red because it is not yet turned on. The file naming scheme is customized, and there are four blocks pre-configured with associated scripted actions.
|
|
83
|
+
> -->
|
|
84
|
+
|
|
85
|
+
## Remote Control
|
|
86
|
+
|
|
87
|
+
If you check the box to EnableRCS then LabRecorder exposes some rudimentary controls via TCP socket.
|
|
88
|
+
|
|
89
|
+
Currently supported commands include:
|
|
90
|
+
|
|
91
|
+
* `select all`
|
|
92
|
+
* `select none`
|
|
93
|
+
* `start`
|
|
94
|
+
* `stop`
|
|
95
|
+
* `update`
|
|
96
|
+
* `filename ...`
|
|
97
|
+
|
|
98
|
+
`filename` is followed by a series of space-delimited options enclosed in curly braces. e.g. {root:C:\root_data_dir}
|
|
99
|
+
|
|
100
|
+
* `root` - Sets the root data directory.
|
|
101
|
+
* `template` - sets the File Name / Template. Will unselect BIDS option. May contain wildcards.
|
|
102
|
+
* `task` - will replace %b in template
|
|
103
|
+
* `run` - will replace %n in template (not working?)
|
|
104
|
+
* `participant` - will replace %p in template
|
|
105
|
+
* `session` - will replace %s in template
|
|
106
|
+
* `acquisition` - will replace %a in template
|
|
107
|
+
* `modality` - will replace %m in template. suggested values: eeg, ieeg, meg, beh
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
For example, in Python:
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import socket
|
|
114
|
+
s = socket.create_connection(("localhost", 22345))
|
|
115
|
+
s.sendall(b"select all\n")
|
|
116
|
+
s.sendall(b"filename {root:C:\\Data\\} {template:exp%n\\%p_block_%b.xdf} {run:2} {participant:P003} {task:MemoryGuided}\n")
|
|
117
|
+
s.sendall(b"start\n")
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```Matlab
|
|
121
|
+
lr = tcpip('localhost', 22345);
|
|
122
|
+
fopen(lr)
|
|
123
|
+
fprintf(lr, 'select all');
|
|
124
|
+
fprintf(lr, ['filename {root:C:\Data\} '...
|
|
125
|
+
'{task:MemoryGuided} ' ...
|
|
126
|
+
'{template:s_%p_%n.xdf ' ...
|
|
127
|
+
'{modality:ieeg}']);
|
|
128
|
+
fprintf(lr, 'start');
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Misc Features
|
|
132
|
+
|
|
133
|
+
The LabRecorder has some useful features that can add robustness if things go wrong during the experiment:
|
|
134
|
+
|
|
135
|
+
If a network connectivity error happens while recording (e.g., a network cable pops out that connects to the source of a data stream), you have usually 6 minutes (think 5) to plug it back it in during which the data will be buffered on the sending machine. If it takes you longer to fix the problem, you will have some gap in your recording.
|
|
136
|
+
|
|
137
|
+
If a device program or computer crashes while recording, you will for sure lose data, but any device program that transmits an associated device serial number will be picked up automatically by the recorder when it comes back online (these programs are called "recoverable"), without a need to stop and re-start the recording.
|
|
138
|
+
|
|
139
|
+
You should check the health of your device to be sure, however, for example using an online stream viewer program (see, for example, ViewingStreamsInMatlab). Also, be sure to test whether it is in fact recoverable before relying on this feature (you can test this with a viewer by turning the device app off and back on).
|
|
140
|
+
|
|
141
|
+
If a device is displayed in red when you start recording (and it is checked), it will be added to the ongoing recording by the time when it comes online. This can be useful when a device can only be turned on while the recording is already in progress. Again, it is advisable to check that the device is in fact discoverable and added. The LabRecorder brings up a console window in the background which shows a list of all streams that are added to the recording -- this is a good place to check whether a late stream did get picked up successfully during a live recording.
|
|
142
|
+
|
|
143
|
+
# Build Instructions
|
|
144
|
+
|
|
145
|
+
Please follow the general [LSL App build instructions](https://labstreaminglayer.readthedocs.io/dev/app_build.html).
|
|
146
|
+
|
|
147
|
+
## Python bindings
|
|
148
|
+
|
|
149
|
+
LabRecorder includes optional Python bindings for the `recording` class (module name: `labrecorder`).
|
|
150
|
+
Enable them with `-DLABRECORDER_BUILD_PYTHON=ON` and make sure `pybind11` is installed on your system.
|
|
151
|
+
|
|
152
|
+
### Install pybind11
|
|
153
|
+
|
|
154
|
+
* macOS (Homebrew): `brew install pybind11`
|
|
155
|
+
* Ubuntu/Debian: `sudo apt-get install pybind11-dev`
|
|
156
|
+
* Windows: use vcpkg (`vcpkg install pybind11`) or a pybind11 CMake package on your PATH
|
|
157
|
+
|
|
158
|
+
### Configure + build
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
cmake -S . -B build -DLABRECORDER_BUILD_PYTHON=ON
|
|
162
|
+
cmake --build build --target labrecorder
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Usage (with pylsl)
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
import sys
|
|
169
|
+
from pylsl import resolve_streams
|
|
170
|
+
|
|
171
|
+
sys.path.append("build")
|
|
172
|
+
import labrecorder
|
|
173
|
+
|
|
174
|
+
streams = resolve_streams()
|
|
175
|
+
with labrecorder.Recording("out.xdf", streams):
|
|
176
|
+
input("Recording... press Enter to stop\n")
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Publish to PyPI
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
uv build
|
|
183
|
+
uv publish
|
|
184
|
+
```
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: labrecorder
|
|
3
|
+
Version: 1.0.0rc0
|
|
4
|
+
Summary: Python bindings for LabRecorder recording
|
|
5
|
+
Author: LabStreamingLayer Developers
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# Overview
|
|
11
|
+
|
|
12
|
+
The LabRecorder is the default recording program that comes with LSL. It allows to record all streams on the lab network (or a subset) into a single file, with time synchronization between streams.
|
|
13
|
+
|
|
14
|
+
# File Format
|
|
15
|
+
|
|
16
|
+
The file format used by the LabRecorder is XDF. This is an open general-purpose format that was designed concurrently with LSL and supports all features of LSL streams. The project page is [here](https://github.com/sccn/xdf). There are importers for MATLAB, EEGLAB, BCILAB, Python, and MoBILAB.
|
|
17
|
+
|
|
18
|
+
# Getting LabRecorder
|
|
19
|
+
|
|
20
|
+
The [releases page](https://github.com/labstreaminglayer/App-LabRecorder/releases) contains archives of past LabRecorder builds. Try downloading and installing an archive that matches your platform. Note for Ubuntu users: The deb will install LabRecorder to `/usr/LabRecorder` though we might change this to `/usr/local/bin/LabRecorder` in the future.
|
|
21
|
+
|
|
22
|
+
If there are no archives matching your target platform, or the ones available don't run, then continue reading below. If the instructions don't help then please post an issue to the [repo's issues page](https://github.com/labstreaminglayer/App-LabRecorder/issues).
|
|
23
|
+
|
|
24
|
+
## Dependencies
|
|
25
|
+
|
|
26
|
+
For LabRecorder to work on your system, you might need to first install some dependencies, specifically liblsl and optionally Qt.
|
|
27
|
+
|
|
28
|
+
### Windows
|
|
29
|
+
|
|
30
|
+
The Windows archives ship with nearly all required dependencies. If you have not already installed it via another program, you may need to install the [Visual C++ Runtime Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170).
|
|
31
|
+
|
|
32
|
+
If you suspect you are missing a dependency, try running [DependenciesGui.exe](https://github.com/lucasg/Dependencies/releases) then navigating to the LabRecorder.exe. It's important to launch Dependencies.exe from the same environment that you would use to launch this application: if you launch this application by double-clicking the executable in Windows' finder then do the same on the Dependencies.exe icon; if you launch this application in a Terminal window, then use that same Terminal to launch Dependencies.
|
|
33
|
+
|
|
34
|
+
### MacOS
|
|
35
|
+
|
|
36
|
+
In the near future, many LSL Apps (especially LabRecorder) will not ship with their dependencies and will look for the dependencies to be installed on the system. The easiest way to manage the dependencies is by using [homebrew](https://brew.sh/):
|
|
37
|
+
|
|
38
|
+
* Install homebrew: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
|
39
|
+
* `brew install labstreaminglayer/tap/lsl`
|
|
40
|
+
* `brew install qt`
|
|
41
|
+
|
|
42
|
+
You can then install LabRecorder directly from homebrew: `brew install labrecorder`
|
|
43
|
+
|
|
44
|
+
Run it with `open /usr/local/opt/labrecorder/LabRecorder/LabRecorder.app`
|
|
45
|
+
|
|
46
|
+
### Linux Ubuntu
|
|
47
|
+
|
|
48
|
+
The Ubuntu releases do not typically ship with their dependencies, so you must download and install those:
|
|
49
|
+
|
|
50
|
+
* Download, extract, and install the latest [liblsl-{version}-{target}_amd64.deb from its release page](https://github.com/sccn/liblsl/releases)
|
|
51
|
+
* We hope to make this available via a package manager soon.
|
|
52
|
+
* Quick ref Ubuntu 24.04: `curl -L https://github.com/sccn/liblsl/releases/download/v1.17.4/liblsl-1.17.4-noble_amd64.deb -o liblsl.deb`
|
|
53
|
+
* Quick ref Ubuntu 22.04: `curl -L https://github.com/sccn/liblsl/releases/download/v1.17.4/liblsl-1.17.4-jammy_amd64.deb -o liblsl.deb`
|
|
54
|
+
* You can install liblsl directly by double-clicking on the deb, or with `sudo dpkg -i {filename}.deb` or `sudo apt install {filename}.deb`
|
|
55
|
+
* See the bottom of the [lsl build env docs](https://labstreaminglayer.readthedocs.io/dev/build_env.html).
|
|
56
|
+
* For most cases, this will amount to installing Qt and its dependencies:
|
|
57
|
+
* Ubuntu >= 22.04: `sudo apt-get install qt6-base-dev freeglut3-dev`
|
|
58
|
+
|
|
59
|
+
# Usage
|
|
60
|
+
|
|
61
|
+
The LabRecorder displays a list of currently present device streams under "Record from Streams". If you have turned on a device after you have already started the recorder, click the "Update" button to update the list (this takes ca. 2 seconds).
|
|
62
|
+
> For testing, you can use a "dummy" device from the `lslexamples` found in the [liblsl release assets](https://github.com/sccn/liblsl/releases) (for example SendData<!--, SendStringMarkers, and SendDataSimple-->).
|
|
63
|
+
|
|
64
|
+
If you cannot see streams that are provided on another computer, read the section Network Troubleshooting on the NetworkConnectivity page.
|
|
65
|
+
|
|
66
|
+
You can select which streams you want to record from and which not by checking the checkboxes next to them.
|
|
67
|
+
> 
|
|
68
|
+
|
|
69
|
+
Note that if you have multiple streams with the same name and host, it is impossible to check only 1. If any is checked then they will all be recorded.
|
|
70
|
+
|
|
71
|
+
The entry in "Saving to..." shows you the file name (or file name template) where your recording will be stored. You can change this by modifying the Study Root folder (e.g., by clicking the browse button) and the `File Name / Template` field. If the respective directory does not yet exist, it will be created automatically (except if you do not have the permissions to create it). The file name string may contain placeholders that will be replaced by the values in the fields below. Checking the BIDS box will automatically change the filename template to be BIDS compliant. If the file that you are trying to record to already exists, the existing file will be renamed (the string `_oldX` will be appended where X is the lowest number that is not yet occupied by another existing file). This way, it is impossible to accidentally overwrite data.
|
|
72
|
+
|
|
73
|
+
The Block/Task field can be overwriten or selected among a list of items found in the configuration file.
|
|
74
|
+
|
|
75
|
+
<!--If the checkbox "Enable scripted actions" is checked, then scripted actions that are defined in your current config file will be automatically invoked when you click Start, Stop, or select a block. This check box is by normally unchecked unless you have custom-tailored a configuration to your experiment or experimentation environment.-->
|
|
76
|
+
|
|
77
|
+
Click "Start" to start a recording. If everything goes well, the status bar will now display the time since you started the recording, and more importantly, the current file size (the number before the kb) will grow slowly. This is a way to check whether you are still in fact recording data. The recording program cannot be closed while you are recording (as a safety measure).
|
|
78
|
+
|
|
79
|
+
When you are done recording, click the "Stop" button. You can now close the program. See [the xdf repository](https://github.com/sccn/xdf) for tools and information on how to use the XDF files.
|
|
80
|
+
|
|
81
|
+
## Preparing a Full Study
|
|
82
|
+
|
|
83
|
+
When preparing a new study, it is a good idea to make a custom configuration file which at least sets up a custom storage location for the study. See the documentation in the file `LabRecorder.cfg` for how to do this -- it is very easy! <!--The file `sample_config.cfg` contains a somewhat more advanced setup for reference. By default, the file `default_config.cfg` is loaded at startup.--> You can override this by making a shortcut for the LabRecorder program (e.g. on the desktop) and appending in its properties the command-line arguments `-c name_of_you_config.cfg`. You can also create a batch script. You can also load the config while the program is already running, but this can easily be forgotten during an experiment, so we recommend to follow the shortcut route.
|
|
84
|
+
|
|
85
|
+
In addition to the storage location, if your experiment has multiple blocks (e.g., SubjectTraining, PreBaseline, MainBlock, PostBaseline or the like) you can make the recording process even more straightforward for the experimenters by setting up a default list of block names. Again, take a look at the existing config files.
|
|
86
|
+
|
|
87
|
+
Since it is too easy to forget to turn on or check all necessary recording devices for a study, we recommend to also make a list of "required" streams (by their name) and put it into the config file. These streams will be pre-checked when starting the program, and any missing stream will be displayed in red. If such a stream is still not green when starting the recording, the experimenter will get a message box to confirm that he/she really wants to record without including the device.
|
|
88
|
+
|
|
89
|
+
<!--Advanced users might consider automating further steps in the recording process (for example starting the experiment script itself), which can be done by assinging scripted actions in the configuration file. The file `sample_config.cfg` contains pre-defined actions to remote-control the SNAP experimentation environment. In particular, when you click a block, the corresponding SNAP .cfg file will be loaded, and when you click start, the module will be started. Keep in mind, however, that homegrown scripted actions carry the risk of accidentally crashing the recording program, so they need to be carefully tested. One subtle consideration is that the module definitions happen in the context of the main class of the LabRecorder.-->
|
|
90
|
+
|
|
91
|
+
<!--The following picture shows the the recorder fully configured for a particular study. The BioSemi device is displayed in red because it is not yet turned on. The file naming scheme is customized, and there are four blocks pre-configured with associated scripted actions.
|
|
92
|
+
> -->
|
|
93
|
+
|
|
94
|
+
## Remote Control
|
|
95
|
+
|
|
96
|
+
If you check the box to EnableRCS then LabRecorder exposes some rudimentary controls via TCP socket.
|
|
97
|
+
|
|
98
|
+
Currently supported commands include:
|
|
99
|
+
|
|
100
|
+
* `select all`
|
|
101
|
+
* `select none`
|
|
102
|
+
* `start`
|
|
103
|
+
* `stop`
|
|
104
|
+
* `update`
|
|
105
|
+
* `filename ...`
|
|
106
|
+
|
|
107
|
+
`filename` is followed by a series of space-delimited options enclosed in curly braces. e.g. {root:C:\root_data_dir}
|
|
108
|
+
|
|
109
|
+
* `root` - Sets the root data directory.
|
|
110
|
+
* `template` - sets the File Name / Template. Will unselect BIDS option. May contain wildcards.
|
|
111
|
+
* `task` - will replace %b in template
|
|
112
|
+
* `run` - will replace %n in template (not working?)
|
|
113
|
+
* `participant` - will replace %p in template
|
|
114
|
+
* `session` - will replace %s in template
|
|
115
|
+
* `acquisition` - will replace %a in template
|
|
116
|
+
* `modality` - will replace %m in template. suggested values: eeg, ieeg, meg, beh
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
For example, in Python:
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
import socket
|
|
123
|
+
s = socket.create_connection(("localhost", 22345))
|
|
124
|
+
s.sendall(b"select all\n")
|
|
125
|
+
s.sendall(b"filename {root:C:\\Data\\} {template:exp%n\\%p_block_%b.xdf} {run:2} {participant:P003} {task:MemoryGuided}\n")
|
|
126
|
+
s.sendall(b"start\n")
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```Matlab
|
|
130
|
+
lr = tcpip('localhost', 22345);
|
|
131
|
+
fopen(lr)
|
|
132
|
+
fprintf(lr, 'select all');
|
|
133
|
+
fprintf(lr, ['filename {root:C:\Data\} '...
|
|
134
|
+
'{task:MemoryGuided} ' ...
|
|
135
|
+
'{template:s_%p_%n.xdf ' ...
|
|
136
|
+
'{modality:ieeg}']);
|
|
137
|
+
fprintf(lr, 'start');
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Misc Features
|
|
141
|
+
|
|
142
|
+
The LabRecorder has some useful features that can add robustness if things go wrong during the experiment:
|
|
143
|
+
|
|
144
|
+
If a network connectivity error happens while recording (e.g., a network cable pops out that connects to the source of a data stream), you have usually 6 minutes (think 5) to plug it back it in during which the data will be buffered on the sending machine. If it takes you longer to fix the problem, you will have some gap in your recording.
|
|
145
|
+
|
|
146
|
+
If a device program or computer crashes while recording, you will for sure lose data, but any device program that transmits an associated device serial number will be picked up automatically by the recorder when it comes back online (these programs are called "recoverable"), without a need to stop and re-start the recording.
|
|
147
|
+
|
|
148
|
+
You should check the health of your device to be sure, however, for example using an online stream viewer program (see, for example, ViewingStreamsInMatlab). Also, be sure to test whether it is in fact recoverable before relying on this feature (you can test this with a viewer by turning the device app off and back on).
|
|
149
|
+
|
|
150
|
+
If a device is displayed in red when you start recording (and it is checked), it will be added to the ongoing recording by the time when it comes online. This can be useful when a device can only be turned on while the recording is already in progress. Again, it is advisable to check that the device is in fact discoverable and added. The LabRecorder brings up a console window in the background which shows a list of all streams that are added to the recording -- this is a good place to check whether a late stream did get picked up successfully during a live recording.
|
|
151
|
+
|
|
152
|
+
# Build Instructions
|
|
153
|
+
|
|
154
|
+
Please follow the general [LSL App build instructions](https://labstreaminglayer.readthedocs.io/dev/app_build.html).
|
|
155
|
+
|
|
156
|
+
## Python bindings
|
|
157
|
+
|
|
158
|
+
LabRecorder includes optional Python bindings for the `recording` class (module name: `labrecorder`).
|
|
159
|
+
Enable them with `-DLABRECORDER_BUILD_PYTHON=ON` and make sure `pybind11` is installed on your system.
|
|
160
|
+
|
|
161
|
+
### Install pybind11
|
|
162
|
+
|
|
163
|
+
* macOS (Homebrew): `brew install pybind11`
|
|
164
|
+
* Ubuntu/Debian: `sudo apt-get install pybind11-dev`
|
|
165
|
+
* Windows: use vcpkg (`vcpkg install pybind11`) or a pybind11 CMake package on your PATH
|
|
166
|
+
|
|
167
|
+
### Configure + build
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
cmake -S . -B build -DLABRECORDER_BUILD_PYTHON=ON
|
|
171
|
+
cmake --build build --target labrecorder
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Usage (with pylsl)
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
import sys
|
|
178
|
+
from pylsl import resolve_streams
|
|
179
|
+
|
|
180
|
+
sys.path.append("build")
|
|
181
|
+
import labrecorder
|
|
182
|
+
|
|
183
|
+
streams = resolve_streams()
|
|
184
|
+
with labrecorder.Recording("out.xdf", streams):
|
|
185
|
+
input("Recording... press Enter to stop\n")
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Publish to PyPI
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
uv build
|
|
192
|
+
uv publish
|
|
193
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LabRecorder.cfg,sha256=Tev-IBoSpDvvjCoqTa-ZH-QbRL9beqUygKwSk3TF84k,4144
|
|
2
|
+
labrecorder.cp312-win_amd64.pyd,sha256=GCT3k7GXT2Wxxj8RqOP8iwlh_MHh19TkXmw5XxUR6ig,274944
|
|
3
|
+
LabRecorderCLI.exe,sha256=4KwWo6fkE-Ectq2uDOseAnXzl-XFi2QEAI1VIn3jNJY,117248
|
|
4
|
+
LICENSE,sha256=ump1McoxhpxPSQlEhVIyPxLDx00e04r_aDE7lTbVkdw,1093
|
|
5
|
+
lsl.dll,sha256=GogCu2igOyUiD9EzL2UNZ5Cq4MxRA-1YfzU173_-0vA,577024
|
|
6
|
+
README.md,sha256=w-1OQiC03y08t4Bk878n9wJu64lNLm7pfJKPi3wEB0k,13493
|
|
7
|
+
xdfwriter.lib,sha256=-fUN9W3wfkyS_XygN8EC7ZYufa1ztt3eeaaCjZ5Ncc4,238714
|
|
8
|
+
labrecorder-1.0.0rc0.dist-info/METADATA,sha256=C3PQ8FNrPs3_Czf1FyD8NmHA0WlrwRXHguxRgsjSKI0,13532
|
|
9
|
+
labrecorder-1.0.0rc0.dist-info/WHEEL,sha256=chqeLhPBtPdrOoreR34YMcofSk3yWDQhkrsDJ2n48LU,106
|
|
10
|
+
labrecorder-1.0.0rc0.dist-info/licenses/LICENSE,sha256=ump1McoxhpxPSQlEhVIyPxLDx00e04r_aDE7lTbVkdw,1093
|
|
11
|
+
labrecorder-1.0.0rc0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2012 Christian Kothe
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
Binary file
|
lsl.dll
ADDED
|
Binary file
|
xdfwriter.lib
ADDED
|
Binary file
|