Spaces:
Build error
Build error
Yann Bouteiller
commited on
Commit
·
0671861
1
Parent(s):
11677c4
Added lsl stream for raw signal
Browse files- portiloop/capture.py +13 -5
portiloop/capture.py
CHANGED
|
@@ -1191,13 +1191,20 @@ class Capture:
|
|
| 1191 |
|
| 1192 |
if lsl:
|
| 1193 |
from pylsl import StreamInfo, StreamOutlet
|
| 1194 |
-
lsl_info = StreamInfo(name='Portiloop',
|
| 1195 |
-
type='EEG',
|
| 1196 |
channel_count=8,
|
| 1197 |
nominal_srate=self.frequency,
|
| 1198 |
channel_format='float32',
|
| 1199 |
source_id='portiloop1') # TODO: replace this by unique device identifier
|
| 1200 |
lsl_outlet = StreamOutlet(lsl_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1201 |
|
| 1202 |
buffer = []
|
| 1203 |
|
|
@@ -1228,6 +1235,10 @@ class Capture:
|
|
| 1228 |
|
| 1229 |
filtered_point = n_array.tolist()
|
| 1230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1231 |
with self._pause_detect_lock:
|
| 1232 |
pause = self._pause_detect
|
| 1233 |
if detector is not None and not pause:
|
|
@@ -1240,9 +1251,6 @@ class Capture:
|
|
| 1240 |
if test_stimulus:
|
| 1241 |
stimulator.test_stimulus()
|
| 1242 |
|
| 1243 |
-
if lsl:
|
| 1244 |
-
lsl_outlet.push_sample(filtered_point[-1])
|
| 1245 |
-
|
| 1246 |
buffer += filtered_point
|
| 1247 |
if len(buffer) >= 50:
|
| 1248 |
|
|
|
|
| 1191 |
|
| 1192 |
if lsl:
|
| 1193 |
from pylsl import StreamInfo, StreamOutlet
|
| 1194 |
+
lsl_info = StreamInfo(name='Portiloop Filtered',
|
| 1195 |
+
type='Filtered EEG',
|
| 1196 |
channel_count=8,
|
| 1197 |
nominal_srate=self.frequency,
|
| 1198 |
channel_format='float32',
|
| 1199 |
source_id='portiloop1') # TODO: replace this by unique device identifier
|
| 1200 |
lsl_outlet = StreamOutlet(lsl_info)
|
| 1201 |
+
lsl_info_raw = StreamInfo(name='Portiloop Raw Data',
|
| 1202 |
+
type='Raw EEG signal',
|
| 1203 |
+
channel_count=8,
|
| 1204 |
+
nominal_srate=self.frequency,
|
| 1205 |
+
channel_format='float32',
|
| 1206 |
+
source_id='portiloop1') # TODO: replace this by unique device identifier
|
| 1207 |
+
lsl_outlet_raw = StreamOutlet(lsl_info_raw)
|
| 1208 |
|
| 1209 |
buffer = []
|
| 1210 |
|
|
|
|
| 1235 |
|
| 1236 |
filtered_point = n_array.tolist()
|
| 1237 |
|
| 1238 |
+
if lsl:
|
| 1239 |
+
lsl_outlet_raw.push_sample(point)
|
| 1240 |
+
lsl_outlet.push_sample(filtered_point[-1])
|
| 1241 |
+
|
| 1242 |
with self._pause_detect_lock:
|
| 1243 |
pause = self._pause_detect
|
| 1244 |
if detector is not None and not pause:
|
|
|
|
| 1251 |
if test_stimulus:
|
| 1252 |
stimulator.test_stimulus()
|
| 1253 |
|
|
|
|
|
|
|
|
|
|
| 1254 |
buffer += filtered_point
|
| 1255 |
if len(buffer) >= 50:
|
| 1256 |
|