biosignal-device-interface 0.1.311__py3-none-any.whl → 0.2.1a2__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.
Files changed (42) hide show
  1. biosignal_device_interface/constants/devices/__init__.py +3 -3
  2. biosignal_device_interface/constants/devices/core/base_device_constants.py +61 -51
  3. biosignal_device_interface/constants/devices/otb/otb_muovi_constants.py +129 -129
  4. biosignal_device_interface/constants/devices/otb/otb_quattrocento_constants.py +313 -0
  5. biosignal_device_interface/constants/devices/otb/otb_quattrocento_light_constants.py +59 -59
  6. biosignal_device_interface/constants/devices/otb/otb_syncstation_constants.py +233 -0
  7. biosignal_device_interface/constants/plots/color_palette.py +59 -59
  8. biosignal_device_interface/devices/__init__.py +17 -15
  9. biosignal_device_interface/devices/core/base_device.py +424 -410
  10. biosignal_device_interface/devices/otb/__init__.py +29 -21
  11. biosignal_device_interface/devices/otb/otb_muovi.py +290 -291
  12. biosignal_device_interface/devices/otb/otb_quattrocento.py +332 -0
  13. biosignal_device_interface/devices/otb/otb_quattrocento_light.py +210 -213
  14. biosignal_device_interface/devices/otb/otb_syncstation.py +407 -0
  15. biosignal_device_interface/gui/device_template_widgets/all_devices_widget.py +51 -43
  16. biosignal_device_interface/gui/device_template_widgets/core/base_device_widget.py +130 -121
  17. biosignal_device_interface/gui/device_template_widgets/core/base_multiple_devices_widget.py +108 -108
  18. biosignal_device_interface/gui/device_template_widgets/otb/otb_devices_widget.py +44 -36
  19. biosignal_device_interface/gui/device_template_widgets/otb/otb_muovi_plus_widget.py +158 -158
  20. biosignal_device_interface/gui/device_template_widgets/otb/otb_muovi_widget.py +158 -158
  21. biosignal_device_interface/gui/device_template_widgets/otb/otb_quattrocento_light_widget.py +174 -170
  22. biosignal_device_interface/gui/device_template_widgets/otb/otb_quattrocento_widget.py +260 -0
  23. biosignal_device_interface/gui/device_template_widgets/otb/otb_syncstation_widget.py +262 -0
  24. biosignal_device_interface/gui/plot_widgets/biosignal_plot_widget.py +501 -500
  25. biosignal_device_interface/gui/ui/devices_template_widget.ui +38 -38
  26. biosignal_device_interface/gui/ui/otb_muovi_plus_template_widget.ui +171 -171
  27. biosignal_device_interface/gui/ui/otb_muovi_template_widget.ui +171 -171
  28. biosignal_device_interface/gui/ui/otb_quattrocento_light_template_widget.ui +266 -266
  29. biosignal_device_interface/gui/ui/otb_quattrocento_template_widget.ui +415 -0
  30. biosignal_device_interface/gui/ui/otb_syncstation_template_widget.ui +732 -0
  31. biosignal_device_interface/gui/ui_compiled/devices_template_widget.py +56 -56
  32. biosignal_device_interface/gui/ui_compiled/otb_muovi_plus_template_widget.py +153 -153
  33. biosignal_device_interface/gui/ui_compiled/otb_muovi_template_widget.py +153 -153
  34. biosignal_device_interface/gui/ui_compiled/otb_quattrocento_light_template_widget.py +217 -217
  35. biosignal_device_interface/gui/ui_compiled/otb_quattrocento_template_widget.py +318 -0
  36. biosignal_device_interface/gui/ui_compiled/otb_syncstation_template_widget.py +495 -0
  37. biosignal_device_interface-0.2.1a2.dist-info/LICENSE +675 -0
  38. {biosignal_device_interface-0.1.311.dist-info → biosignal_device_interface-0.2.1a2.dist-info}/METADATA +6 -4
  39. biosignal_device_interface-0.2.1a2.dist-info/RECORD +46 -0
  40. {biosignal_device_interface-0.1.311.dist-info → biosignal_device_interface-0.2.1a2.dist-info}/WHEEL +1 -1
  41. biosignal_device_interface-0.1.311.dist-info/LICENSE +0 -395
  42. biosignal_device_interface-0.1.311.dist-info/RECORD +0 -36
@@ -1,3 +1,3 @@
1
- from biosignal_device_interface.constants.devices.core.base_device_constants import (
2
- DeviceType,
3
- )
1
+ from biosignal_device_interface.constants.devices.core.base_device_constants import (
2
+ DeviceType,
3
+ )
@@ -1,51 +1,61 @@
1
- """
2
- Base Device class for real-time interfaces to hardware devices.
3
- Developer: Dominik I. Braun
4
- Contact: dome.braun@fau.de
5
- Last Update: 2024-06-05
6
- """
7
-
8
- from aenum import Enum, auto
9
-
10
-
11
- ############# ENUMS #############
12
- class DeviceType(Enum):
13
- """
14
- Enum class for the different available devices.
15
- Add new devices here.
16
- """
17
-
18
- _init_ = "value __doc__"
19
- OTB_QUATTROCENTO_LIGHT = auto(), "OT Bioelettronica Quattrocento Light"
20
- OTB_MUOVI = auto(), "OT Bioelettronica Muovi"
21
- OTB_MUOVI_PLUS = auto(), "OT Bioelettronica Muovi Plus"
22
-
23
-
24
- class OTBDeviceType(Enum):
25
- """
26
- Enum class for the different available OT Bioelettronica devices.
27
- Add new devices here.
28
- """
29
-
30
- QUATTROCENTO_LIGHT = auto(), "Quattrocento Light"
31
- MUOVI = auto(), "Muovi"
32
- MUOVI_PLUS = auto(), "Muovi Plus"
33
-
34
-
35
- class DeviceChannelTypes(Enum):
36
- _init_ = "value __doc__"
37
-
38
- ALL = auto(), "All"
39
- AUXILIARY = auto(), "Auxiliary"
40
- BIOSIGNAL = auto(), "Biosignal"
41
-
42
-
43
- ############# CONSTANTS #############
44
- DEVICE_NAME_DICT: dict[DeviceType | OTBDeviceType, str] = {
45
- DeviceType.OTB_QUATTROCENTO_LIGHT: "Quattrocento Light",
46
- OTBDeviceType.QUATTROCENTO_LIGHT: "Quattrocento Light",
47
- DeviceType.OTB_MUOVI: "Muovi",
48
- OTBDeviceType.MUOVI: "Muovi",
49
- DeviceType.OTB_MUOVI_PLUS: "Muovi Plus",
50
- OTBDeviceType.MUOVI_PLUS: "Muovi Plus",
51
- }
1
+ """
2
+ Base Device class for real-time interfaces to hardware devices.
3
+ Developer: Dominik I. Braun
4
+ Contact: dome.braun@fau.de
5
+ Last Update: 2024-06-05
6
+ """
7
+
8
+ from aenum import Enum, auto
9
+
10
+
11
+ ############# ENUMS #############
12
+ class DeviceType(Enum):
13
+ """
14
+ Enum class for the different available devices.
15
+ Add new devices here.
16
+ """
17
+
18
+ _init_ = "value __doc__"
19
+ OTB_QUATTROCENTO = auto(), "OT Bioelettronica Quattrocento"
20
+ OTB_QUATTROCENTO_LIGHT = auto(), "OT Bioelettronica Quattrocento Light"
21
+ OTB_MUOVI = auto(), "OT Bioelettronica Muovi"
22
+ OTB_MUOVI_PLUS = auto(), "OT Bioelettronica Muovi Plus"
23
+ OTB_SYNCSTATION = auto(), "OT Bioelettronica SyncStation"
24
+
25
+
26
+ class OTBDeviceType(Enum):
27
+ """
28
+ Enum class for the different available OT Bioelettronica devices.
29
+ Add new devices here.
30
+ """
31
+
32
+ _init_ = "value __doc__"
33
+
34
+ QUATTROCENTO = auto(), "Quattrocento"
35
+ QUATTROCENTO_LIGHT = auto(), "Quattrocento Light"
36
+ MUOVI = auto(), "Muovi"
37
+ MUOVI_PLUS = auto(), "Muovi Plus"
38
+ SYNCSTATION = auto(), "SyncStation"
39
+
40
+
41
+ class DeviceChannelTypes(Enum):
42
+ _init_ = "value __doc__"
43
+
44
+ ALL = auto(), "All"
45
+ AUXILIARY = auto(), "Auxiliary"
46
+ BIOSIGNAL = auto(), "Biosignal"
47
+
48
+
49
+ ############# CONSTANTS #############
50
+ DEVICE_NAME_DICT: dict[DeviceType | OTBDeviceType, str] = {
51
+ DeviceType.OTB_QUATTROCENTO: "Quattrocento",
52
+ OTBDeviceType.QUATTROCENTO: "Quattrocento",
53
+ DeviceType.OTB_QUATTROCENTO_LIGHT: "Quattrocento Light",
54
+ OTBDeviceType.QUATTROCENTO_LIGHT: "Quattrocento Light",
55
+ DeviceType.OTB_MUOVI: "Muovi",
56
+ OTBDeviceType.MUOVI: "Muovi",
57
+ DeviceType.OTB_MUOVI_PLUS: "Muovi Plus",
58
+ OTBDeviceType.MUOVI_PLUS: "Muovi Plus",
59
+ DeviceType.OTB_SYNCSTATION: "SyncStation",
60
+ OTBDeviceType.SYNCSTATION: "SyncStation",
61
+ }
@@ -1,129 +1,129 @@
1
- from aenum import Enum, auto
2
-
3
- from biosignal_device_interface.constants.devices.core.base_device_constants import (
4
- DeviceType,
5
- DeviceChannelTypes,
6
- )
7
-
8
-
9
- class MuoviWorkingMode(Enum):
10
- """
11
- Enum class for the working mode of the Muovi device.
12
-
13
- Note:
14
- High pass filter implemented by firmware subtracting the exponential moving average, obtained by:
15
- Average_ChX[t] = (1-alpha) Average_ChX[t-1] + alpha ChX[t]
16
- Where alpha is equal to 1/25 for MODE = 0, 1 or 2. It is equal to 1/2 in case of Impedance check.
17
- For the standard modes, this result in a high pass filter with a cut-off frequency of 10.5 Hz, when sampling
18
- the signals at 2000 Hz. More in general the cut-off frequency is Fsamp/190
19
-
20
- """
21
-
22
- _init_ = "value __doc__"
23
-
24
- NONE = 0, "No working mode set."
25
- EEG = auto(), "EEG Mode: FSAMP 500 Hz, DC coupled, 24 bit resolution"
26
- EMG = (
27
- auto(),
28
- "EMG Mode: FSAMP 2000 Hz, DC coupled, 16 bit resolution, High pass filtered at 10 Hz",
29
- )
30
-
31
-
32
- class MuoviDetectionMode(Enum):
33
- """
34
- Enum class for the detection mode of the Muovi device.
35
-
36
- Note:
37
- Preamp gain of 4 has a double input range and a slightly larger noise w.r.t. preamp gain of 8. It can be
38
- used when DC component of EMG signals is higher and generates saturation before the high pass filter
39
- resulting in flat signals. The input range before the high pass filter is +/-600mV when the preamp is set to
40
- 4 and +/-300mV when the preamp is set to 8.
41
- """
42
-
43
- _init_ = "value __doc__"
44
-
45
- NONE = 0, "No detection mode set."
46
- MONOPOLAR_GAIN_8 = auto(), (
47
- "Monopolar Mode.preamp gain 8. 32 monopolar bioelectrical signals + 6 accessory signals. "
48
- "Resolution is 286.1 nV and range +/-9.375 mV."
49
- )
50
- MONOPOLAR_GAIN_4 = auto(), (
51
- "Monopolar Mode (Only EMG -> EEG=>Mode 0). preamp gain 4. "
52
- "32 bioelectrical signals + 6 accessory signals. "
53
- "Resolution is 572.2nV and range +/-18.75 mV."
54
- )
55
- IMPEDANCE_CHECK = auto(), "Impedance Check on all 32 + 6 channels."
56
- TEST = auto(), "Ramps on all 32 + 6 channels."
57
-
58
-
59
- MUOVI_WORKING_MODE_CHARACTERISTICS_DICT: dict[MuoviWorkingMode, dict[str, int]] = {
60
- MuoviWorkingMode.EEG: {
61
- "sampling_frequency": 500,
62
- "bytes_per_sample": 3,
63
- },
64
- MuoviWorkingMode.EMG: {
65
- "sampling_frequency": 2000,
66
- "bytes_per_sample": 2,
67
- },
68
- }
69
- """
70
- Dictionary to get characteristics of the Muovi working mode.
71
-
72
- The keys are the working modes of the Muovi device.
73
-
74
- The values are dictionaries with the following keys:
75
- - "sampling_frequency": The sampling frequency of the working mode in Hz.
76
- - "bytes_per_sample": The number of bytes per sample.
77
- """
78
-
79
-
80
- MUOVI_SAMPLES_PER_FRAME_DICT: dict[DeviceType, dict[MuoviWorkingMode, int]] = {
81
- DeviceType.OTB_MUOVI: {
82
- MuoviWorkingMode.EEG: 12,
83
- MuoviWorkingMode.EMG: 18,
84
- },
85
- DeviceType.OTB_MUOVI_PLUS: {
86
- MuoviWorkingMode.EEG: 6,
87
- MuoviWorkingMode.EMG: 10,
88
- },
89
- }
90
- """
91
- Dictionary to get the frame length of the Muovi.
92
-
93
- The keys are the device type of a Muovi (Normal or Plus).
94
-
95
- The values are dictionaries with the following keys:
96
- - MuoviWorkingMode.EEG: The frame length of the EEG working mode
97
- - MuoviWorkingMode.EMG: The frame length of the EMG working mode.
98
- """
99
-
100
- MUOVI_AVAILABLE_CHANNELS_DICT: dict[DeviceType, dict[DeviceChannelTypes, int]] = {
101
- DeviceType.OTB_MUOVI: {
102
- DeviceChannelTypes.ALL: 38,
103
- DeviceChannelTypes.BIOSIGNAL: 32,
104
- DeviceChannelTypes.AUXILIARY: 6,
105
- },
106
- DeviceType.OTB_MUOVI_PLUS: {
107
- DeviceChannelTypes.ALL: 70,
108
- DeviceChannelTypes.BIOSIGNAL: 64,
109
- DeviceChannelTypes.AUXILIARY: 6,
110
- },
111
- }
112
-
113
- """
114
-
115
- """
116
-
117
- MUOVI_CONVERSION_FACTOR_DICT: dict[MuoviDetectionMode, int] = {
118
- MuoviDetectionMode.MONOPOLAR_GAIN_8: 572.2e-6,
119
- MuoviDetectionMode.MONOPOLAR_GAIN_4: 286.1e-6,
120
- }
121
- """
122
- Dictionary to get the gain of the Muovi detection mode. \\
123
- The keys are the detection modes of the Muovi device. \\
124
- The values are the gain of the detection mode in V.
125
- """
126
-
127
-
128
- MUOVI_NETWORK_PORT: int = 54321
129
- """The default network port of the Muovi device."""
1
+ from aenum import Enum, auto
2
+
3
+ from biosignal_device_interface.constants.devices.core.base_device_constants import (
4
+ DeviceType,
5
+ DeviceChannelTypes,
6
+ )
7
+
8
+
9
+ class MuoviWorkingMode(Enum):
10
+ """
11
+ Enum class for the working mode of the Muovi device.
12
+
13
+ Note:
14
+ High pass filter implemented by firmware subtracting the exponential moving average, obtained by:
15
+ Average_ChX[t] = (1-alpha) Average_ChX[t-1] + alpha ChX[t]
16
+ Where alpha is equal to 1/25 for MODE = 0, 1 or 2. It is equal to 1/2 in case of Impedance check.
17
+ For the standard modes, this result in a high pass filter with a cut-off frequency of 10.5 Hz, when sampling
18
+ the signals at 2000 Hz. More in general the cut-off frequency is Fsamp/190
19
+
20
+ """
21
+
22
+ _init_ = "value __doc__"
23
+
24
+ NONE = 0, "No working mode set."
25
+ EEG = auto(), "EEG Mode: FSAMP 500 Hz, DC coupled, 24 bit resolution"
26
+ EMG = (
27
+ auto(),
28
+ "EMG Mode: FSAMP 2000 Hz, DC coupled, 16 bit resolution, High pass filtered at 10 Hz",
29
+ )
30
+
31
+
32
+ class MuoviDetectionMode(Enum):
33
+ """
34
+ Enum class for the detection mode of the Muovi device.
35
+
36
+ Note:
37
+ Preamp gain of 4 has a double input range and a slightly larger noise w.r.t. preamp gain of 8. It can be
38
+ used when DC component of EMG signals is higher and generates saturation before the high pass filter
39
+ resulting in flat signals. The input range before the high pass filter is +/-600mV when the preamp is set to
40
+ 4 and +/-300mV when the preamp is set to 8.
41
+ """
42
+
43
+ _init_ = "value __doc__"
44
+
45
+ NONE = 0, "No detection mode set."
46
+ MONOPOLAR_GAIN_8 = auto(), (
47
+ "Monopolar Mode.preamp gain 8. 32 monopolar bioelectrical signals + 6 accessory signals. "
48
+ "Resolution is 286.1 nV and range +/-9.375 mV."
49
+ )
50
+ MONOPOLAR_GAIN_4 = auto(), (
51
+ "Monopolar Mode (Only EMG -> EEG=>Mode 0). preamp gain 4. "
52
+ "32 bioelectrical signals + 6 accessory signals. "
53
+ "Resolution is 572.2nV and range +/-18.75 mV."
54
+ )
55
+ IMPEDANCE_CHECK = auto(), "Impedance Check on all 32 + 6 channels."
56
+ TEST = auto(), "Ramps on all 32 + 6 channels."
57
+
58
+
59
+ MUOVI_WORKING_MODE_CHARACTERISTICS_DICT: dict[MuoviWorkingMode, dict[str, int]] = {
60
+ MuoviWorkingMode.EEG: {
61
+ "sampling_frequency": 500,
62
+ "bytes_per_sample": 3,
63
+ },
64
+ MuoviWorkingMode.EMG: {
65
+ "sampling_frequency": 2000,
66
+ "bytes_per_sample": 2,
67
+ },
68
+ }
69
+ """
70
+ Dictionary to get characteristics of the Muovi working mode.
71
+
72
+ The keys are the working modes of the Muovi device.
73
+
74
+ The values are dictionaries with the following keys:
75
+ - "sampling_frequency": The sampling frequency of the working mode in Hz.
76
+ - "bytes_per_sample": The number of bytes per sample.
77
+ """
78
+
79
+
80
+ MUOVI_SAMPLES_PER_FRAME_DICT: dict[DeviceType, dict[MuoviWorkingMode, int]] = {
81
+ DeviceType.OTB_MUOVI: {
82
+ MuoviWorkingMode.EEG: 12,
83
+ MuoviWorkingMode.EMG: 18,
84
+ },
85
+ DeviceType.OTB_MUOVI_PLUS: {
86
+ MuoviWorkingMode.EEG: 6,
87
+ MuoviWorkingMode.EMG: 10,
88
+ },
89
+ }
90
+ """
91
+ Dictionary to get the frame length of the Muovi.
92
+
93
+ The keys are the device type of a Muovi (Normal or Plus).
94
+
95
+ The values are dictionaries with the following keys:
96
+ - MuoviWorkingMode.EEG: The frame length of the EEG working mode
97
+ - MuoviWorkingMode.EMG: The frame length of the EMG working mode.
98
+ """
99
+
100
+ MUOVI_AVAILABLE_CHANNELS_DICT: dict[DeviceType, dict[DeviceChannelTypes, int]] = {
101
+ DeviceType.OTB_MUOVI: {
102
+ DeviceChannelTypes.ALL: 38,
103
+ DeviceChannelTypes.BIOSIGNAL: 32,
104
+ DeviceChannelTypes.AUXILIARY: 6,
105
+ },
106
+ DeviceType.OTB_MUOVI_PLUS: {
107
+ DeviceChannelTypes.ALL: 70,
108
+ DeviceChannelTypes.BIOSIGNAL: 64,
109
+ DeviceChannelTypes.AUXILIARY: 6,
110
+ },
111
+ }
112
+
113
+ """
114
+
115
+ """
116
+
117
+ MUOVI_CONVERSION_FACTOR_DICT: dict[MuoviDetectionMode, int] = {
118
+ MuoviDetectionMode.MONOPOLAR_GAIN_8: 572.2e-6,
119
+ MuoviDetectionMode.MONOPOLAR_GAIN_4: 286.1e-6,
120
+ }
121
+ """
122
+ Dictionary to get the gain of the Muovi detection mode. \\
123
+ The keys are the detection modes of the Muovi device. \\
124
+ The values are the gain of the detection mode in V.
125
+ """
126
+
127
+
128
+ MUOVI_NETWORK_PORT: int = 54321
129
+ """The default network port of the Muovi device."""