biosignal-device-interface 0.1.12b0__py3-none-any.whl → 0.1.311__py3-none-any.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.
- biosignal_device_interface/devices/core/base_device.py +3 -6
- biosignal_device_interface/devices/otb/otb_quattrocento_light.py +12 -10
- biosignal_device_interface/gui/device_template_widgets/core/base_multiple_devices_widget.py +7 -4
- biosignal_device_interface/gui/plot_widgets/biosignal_plot_widget.py +7 -3
- {biosignal_device_interface-0.1.12b0.dist-info → biosignal_device_interface-0.1.311.dist-info}/METADATA +3 -15
- {biosignal_device_interface-0.1.12b0.dist-info → biosignal_device_interface-0.1.311.dist-info}/RECORD +8 -8
- {biosignal_device_interface-0.1.12b0.dist-info → biosignal_device_interface-0.1.311.dist-info}/LICENSE +0 -0
- {biosignal_device_interface-0.1.12b0.dist-info → biosignal_device_interface-0.1.311.dist-info}/WHEEL +0 -0
|
@@ -247,13 +247,10 @@ class BaseDevice(QObject):
|
|
|
247
247
|
np.ndarray:
|
|
248
248
|
Extracted biosignal channels.
|
|
249
249
|
"""
|
|
250
|
-
|
|
250
|
+
biosignal_data = data[self._biosignal_channel_indices]
|
|
251
251
|
if milli_volts:
|
|
252
|
-
return
|
|
253
|
-
|
|
254
|
-
* self._conversion_factor_biosignal
|
|
255
|
-
)
|
|
256
|
-
return data[self._biosignal_channel_indices]
|
|
252
|
+
return biosignal_data * self._conversion_factor_biosignal
|
|
253
|
+
return biosignal_data
|
|
257
254
|
|
|
258
255
|
def _extract_auxiliary_data(
|
|
259
256
|
self, data: np.ndarray, milli_volts: bool = True
|
|
@@ -167,14 +167,13 @@ class OTBQuattrocentoLight(BaseDevice):
|
|
|
167
167
|
super()._read_data()
|
|
168
168
|
|
|
169
169
|
# Wait for connection response
|
|
170
|
-
if not self._is_connected
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
170
|
+
if not self._is_connected and (
|
|
171
|
+
self._interface.bytesAvailable() == len(CONNECTION_RESPONSE)
|
|
172
|
+
and self._interface.readAll() == CONNECTION_RESPONSE
|
|
173
|
+
):
|
|
174
|
+
self._is_connected = True
|
|
175
|
+
self.connect_toggled.emit(True)
|
|
176
|
+
return
|
|
178
177
|
if not self._is_streaming:
|
|
179
178
|
self.clear_socket()
|
|
180
179
|
return
|
|
@@ -204,8 +203,11 @@ class OTBQuattrocentoLight(BaseDevice):
|
|
|
204
203
|
|
|
205
204
|
# Emit the data
|
|
206
205
|
self.data_available.emit(processed_data)
|
|
207
|
-
|
|
208
|
-
self.
|
|
206
|
+
|
|
207
|
+
biosignal_data = self._extract_biosignal_data(processed_data)
|
|
208
|
+
self.biosignal_data_available.emit(biosignal_data)
|
|
209
|
+
auxiliary_data = self._extract_auxiliary_data(processed_data)
|
|
210
|
+
self.auxiliary_data_available.emit(auxiliary_data)
|
|
209
211
|
|
|
210
212
|
def get_device_information(self) -> Dict[str, Enum | int | float | str]: # type: ignore
|
|
211
213
|
return super().get_device_information()
|
|
@@ -49,9 +49,6 @@ class BaseMultipleDevicesWidget(QWidget):
|
|
|
49
49
|
|
|
50
50
|
self.device_stacked_widget = self.ui.deviceStackedWidget
|
|
51
51
|
self.device_selection_combo_box = self.ui.deviceSelectionComboBox
|
|
52
|
-
self.device_selection_combo_box.currentIndexChanged.connect(
|
|
53
|
-
self._update_stacked_widget
|
|
54
|
-
)
|
|
55
52
|
|
|
56
53
|
def get_device_information(self) -> Dict[str, Union[str, int]]:
|
|
57
54
|
return self._get_current_widget().get_device_information()
|
|
@@ -76,13 +73,16 @@ class BaseMultipleDevicesWidget(QWidget):
|
|
|
76
73
|
current_widget.stream_toggled.disconnect(self.stream_toggled)
|
|
77
74
|
|
|
78
75
|
except (TypeError, RuntimeError):
|
|
79
|
-
|
|
76
|
+
...
|
|
80
77
|
|
|
81
78
|
self.device_stacked_widget.setCurrentIndex(index)
|
|
82
79
|
current_widget = self._get_current_widget()
|
|
83
80
|
|
|
81
|
+
# Data arrived
|
|
84
82
|
current_widget.data_arrived.connect(self.data_arrived.emit)
|
|
83
|
+
# Biosignal data arrived
|
|
85
84
|
current_widget.biosignal_data_arrived.connect(self.biosignal_data_arrived.emit)
|
|
85
|
+
# Auxiliary data arrived
|
|
86
86
|
current_widget.auxiliary_data_arrived.connect(self.auxiliary_data_arrived.emit)
|
|
87
87
|
|
|
88
88
|
current_widget.connect_toggled.connect(self.connect_toggled)
|
|
@@ -97,6 +97,9 @@ class BaseMultipleDevicesWidget(QWidget):
|
|
|
97
97
|
self.device_selection_combo_box.addItem(DEVICE_NAME_DICT[device_type])
|
|
98
98
|
|
|
99
99
|
self._update_stacked_widget(0)
|
|
100
|
+
self.device_selection_combo_box.currentIndexChanged.connect(
|
|
101
|
+
self._update_stacked_widget
|
|
102
|
+
)
|
|
100
103
|
|
|
101
104
|
def _get_current_widget(self) -> BaseDeviceWidget:
|
|
102
105
|
return self.device_stacked_widget.currentWidget()
|
|
@@ -95,12 +95,16 @@ class BiosignalPlotWidget(QWidget):
|
|
|
95
95
|
def configure(
|
|
96
96
|
self,
|
|
97
97
|
lines: int,
|
|
98
|
-
|
|
98
|
+
sampling_frequency: int = 2000,
|
|
99
|
+
plot_sampling_frequency: int | None = None,
|
|
99
100
|
display_time: int = 10,
|
|
101
|
+
line_height: int = 50,
|
|
100
102
|
background_color: np.ndarray = np.array([18.0, 18.0, 18.0, 1]),
|
|
101
103
|
):
|
|
102
104
|
self.number_of_lines = lines
|
|
103
|
-
self.external_sampling_frequency =
|
|
105
|
+
self.external_sampling_frequency = sampling_frequency
|
|
106
|
+
if plot_sampling_frequency is not None:
|
|
107
|
+
self.internal_sampling_frequency_threshold = plot_sampling_frequency
|
|
104
108
|
|
|
105
109
|
if (
|
|
106
110
|
self.external_sampling_frequency
|
|
@@ -129,7 +133,7 @@ class BiosignalPlotWidget(QWidget):
|
|
|
129
133
|
)
|
|
130
134
|
|
|
131
135
|
self.space_for_each_line = min(
|
|
132
|
-
int(self.max_texture_size // self.number_of_lines // 1.5),
|
|
136
|
+
int(self.max_texture_size // self.number_of_lines // 1.5), line_height
|
|
133
137
|
)
|
|
134
138
|
|
|
135
139
|
self.canvas.configure(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: biosignal-device-interface
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.311
|
|
4
4
|
Summary: Python communication interface to many biosignal devices manufactured by several companies to easy integration in custom PySide6 applications.
|
|
5
5
|
License: CC BY-SA 4.0
|
|
6
6
|
Author: Dominik I. Braun
|
|
@@ -12,7 +12,6 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Requires-Dist: aenum (>=3.1.15,<4.0.0)
|
|
14
14
|
Requires-Dist: matplotlib (>=3.9.0,<4.0.0)
|
|
15
|
-
Requires-Dist: mindrove (>=0.0.10,<0.0.11)
|
|
16
15
|
Requires-Dist: numpy (>=1.26.4,<2.0.0)
|
|
17
16
|
Requires-Dist: psutil (>=5.9.8,<6.0.0)
|
|
18
17
|
Requires-Dist: pyside6 (>=6.7.0,<7.0.0)
|
|
@@ -34,7 +33,7 @@ Description-Content-Type: text/markdown
|
|
|
34
33
|
<p align="center">
|
|
35
34
|
Python communication interface to many biosignal devices manufactured by several companies to easy integration in custom PySide6 applications.
|
|
36
35
|
<br />
|
|
37
|
-
<a href="https://github.
|
|
36
|
+
<a href="https://nsquaredlab.github.io/Biosignal-Device-Interface/"><strong>Explore the docs »</strong></a>
|
|
38
37
|
</p>
|
|
39
38
|
</div>
|
|
40
39
|
|
|
@@ -46,9 +45,6 @@ Description-Content-Type: text/markdown
|
|
|
46
45
|
<ol>
|
|
47
46
|
<li>
|
|
48
47
|
<a href="#about-the-project">About The Project</a>
|
|
49
|
-
<ul>
|
|
50
|
-
<li><a href="#built-with">Built With</a></li>
|
|
51
|
-
</ul>
|
|
52
48
|
</li>
|
|
53
49
|
<li><a href="#contact">Contact</a></li>
|
|
54
50
|
<li>
|
|
@@ -69,14 +65,6 @@ Description-Content-Type: text/markdown
|
|
|
69
65
|
|
|
70
66
|
Give a brief introduction into the project.
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
### Built With
|
|
75
|
-
|
|
76
|
-
* Python 3.10 / 3.11
|
|
77
|
-
* PySide6 - Version ^6.7.0
|
|
78
|
-
* Vispy - Version ^0.14.0
|
|
79
|
-
|
|
80
68
|
<!-- CONTACT -->
|
|
81
69
|
### Contact
|
|
82
70
|
|
|
@@ -120,7 +108,7 @@ pip install git+https://github.com/NsquaredLab/Biosignal-Device-Interface.git
|
|
|
120
108
|
<!-- USAGE EXAMPLES -->
|
|
121
109
|
## Usage
|
|
122
110
|
|
|
123
|
-
Examples of how you can use this package can be found in our [examples gallery](https://github.
|
|
111
|
+
Examples of how you can use this package can be found in our [examples gallery](https://nsquaredlab.github.io/Biosignal-Device-Interface/auto_examples/index.html).
|
|
124
112
|
|
|
125
113
|
|
|
126
114
|
<!-- LICENSE -->
|
|
@@ -8,20 +8,20 @@ biosignal_device_interface/constants/devices/otb/otb_quattrocento_light_constant
|
|
|
8
8
|
biosignal_device_interface/constants/plots/color_palette.py,sha256=dobhXqcAfYKHQBDUhiNmM4i0foJFO8Vr1TNTbVOi1nE,1057
|
|
9
9
|
biosignal_device_interface/devices/__init__.py,sha256=GeMVzLhgpe4-gvHMNx6K-r9lCSIeOl1i5OfgR871YTk,461
|
|
10
10
|
biosignal_device_interface/devices/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
biosignal_device_interface/devices/core/base_device.py,sha256=
|
|
11
|
+
biosignal_device_interface/devices/core/base_device.py,sha256=g15i4esoXQF_-q_-_rc0VYkv-PJOMbiYzEzF7mGsNZA,14114
|
|
12
12
|
biosignal_device_interface/devices/otb/__init__.py,sha256=pAUX9VPnRudoLZ_H6Kt2prjHyMbKJCt9DEjo8mfivCw,750
|
|
13
13
|
biosignal_device_interface/devices/otb/otb_muovi.py,sha256=4MelQXgDcpkh_dx0HwFt-QAdjsFBFDqkeR-v0PWXqc0,10340
|
|
14
|
-
biosignal_device_interface/devices/otb/otb_quattrocento_light.py,sha256=
|
|
14
|
+
biosignal_device_interface/devices/otb/otb_quattrocento_light.py,sha256=9oErFEp4AjhfhLeMzAYkSfRQTDCG19Tpzhde-kaOv7o,7410
|
|
15
15
|
biosignal_device_interface/gui/device_template_widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
biosignal_device_interface/gui/device_template_widgets/all_devices_widget.py,sha256=HkmsnSEqZ5M1Rnsm3QBwLVNkQloIS52WXP1tuCTQaBE,1595
|
|
17
17
|
biosignal_device_interface/gui/device_template_widgets/core/base_device_widget.py,sha256=hHeHVn4JccPQTQOXPd9Z8-ES_WxnIGPC897x6lSPeuk,3501
|
|
18
|
-
biosignal_device_interface/gui/device_template_widgets/core/base_multiple_devices_widget.py,sha256=
|
|
18
|
+
biosignal_device_interface/gui/device_template_widgets/core/base_multiple_devices_widget.py,sha256=OKMwKRSje07h8UsscuZUwkneDKQuO_F8EIwUNbou62Y,4079
|
|
19
19
|
biosignal_device_interface/gui/device_template_widgets/otb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
biosignal_device_interface/gui/device_template_widgets/otb/otb_devices_widget.py,sha256=asy5gkgHMaEn4Qe3jeyIqTG8gvoUAdPLNFdsWXfH34w,1413
|
|
21
21
|
biosignal_device_interface/gui/device_template_widgets/otb/otb_muovi_plus_widget.py,sha256=zf06K66y3aaGz4CctupoD9y6Z9JIpFRapp1KKFV_aWY,6107
|
|
22
22
|
biosignal_device_interface/gui/device_template_widgets/otb/otb_muovi_widget.py,sha256=XqSm2ic7P90QzOBKoxkPL2abJPg3WuJ6XRij5Nmbec4,6083
|
|
23
23
|
biosignal_device_interface/gui/device_template_widgets/otb/otb_quattrocento_light_widget.py,sha256=2hJwp6Wf0YophLRiJyn1_ixvyaHOayFDcMSLIz6O6iE,6713
|
|
24
|
-
biosignal_device_interface/gui/plot_widgets/biosignal_plot_widget.py,sha256=
|
|
24
|
+
biosignal_device_interface/gui/plot_widgets/biosignal_plot_widget.py,sha256=2pBMrEtFUtIHnyUrzv8j-H7F3LAQJmglBNez8hItlqc,18782
|
|
25
25
|
biosignal_device_interface/gui/ui/devices_template_widget.ui,sha256=K1IXxMGx19g9WuB_k7pyEZcySnnz15uARJjx8jjF0BY,977
|
|
26
26
|
biosignal_device_interface/gui/ui/otb_muovi_plus_template_widget.ui,sha256=VPTyX-fgJgmAm0aXwPsNufCYcRt4uw_1T1D2ZtZPMrw,4918
|
|
27
27
|
biosignal_device_interface/gui/ui/otb_muovi_template_widget.ui,sha256=l2_MXTZCM6YZyDeNUFPU5UXGq02XAYI7gP9NguzQZvU,4906
|
|
@@ -30,7 +30,7 @@ biosignal_device_interface/gui/ui_compiled/devices_template_widget.py,sha256=tLG
|
|
|
30
30
|
biosignal_device_interface/gui/ui_compiled/otb_muovi_plus_template_widget.py,sha256=BQBb38kzJQOoUh-iJQfaEOlgQYnEUshfpmVbaAkk_wA,7707
|
|
31
31
|
biosignal_device_interface/gui/ui_compiled/otb_muovi_template_widget.py,sha256=UQizD9Z89_WogUoHMPdtKgE7qwhq6xNWubYhjUL11yY,7566
|
|
32
32
|
biosignal_device_interface/gui/ui_compiled/otb_quattrocento_light_template_widget.py,sha256=KaABGhQGiXSxdG8HBgviR50i14WvOctF7YbDxXmyZO8,12148
|
|
33
|
-
biosignal_device_interface-0.1.
|
|
34
|
-
biosignal_device_interface-0.1.
|
|
35
|
-
biosignal_device_interface-0.1.
|
|
36
|
-
biosignal_device_interface-0.1.
|
|
33
|
+
biosignal_device_interface-0.1.311.dist-info/LICENSE,sha256=SKg6bjn3svFmdjswd2EyyamaqBbxfLBvh61bhUKntx8,19045
|
|
34
|
+
biosignal_device_interface-0.1.311.dist-info/METADATA,sha256=cSQb1WP7oqsMC7Tuy1O8Htlhf_z4DDIsvK0I8VxC3jw,3822
|
|
35
|
+
biosignal_device_interface-0.1.311.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
36
|
+
biosignal_device_interface-0.1.311.dist-info/RECORD,,
|
|
File without changes
|
{biosignal_device_interface-0.1.12b0.dist-info → biosignal_device_interface-0.1.311.dist-info}/WHEEL
RENAMED
|
File without changes
|