py-neuromodulation 0.0.3__py3-none-any.whl → 0.0.4__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.
- py_neuromodulation/ConnectivityDecoding/Automated Anatomical Labeling 3 (Rolls 2020).nii +0 -0
- py_neuromodulation/ConnectivityDecoding/_get_grid_hull.m +34 -0
- py_neuromodulation/ConnectivityDecoding/_get_grid_whole_brain.py +106 -0
- py_neuromodulation/ConnectivityDecoding/_helper_write_connectome.py +119 -0
- py_neuromodulation/ConnectivityDecoding/mni_coords_cortical_surface.mat +0 -0
- py_neuromodulation/ConnectivityDecoding/mni_coords_whole_brain.mat +0 -0
- py_neuromodulation/ConnectivityDecoding/rmap_func_all.nii +0 -0
- py_neuromodulation/ConnectivityDecoding/rmap_struc.nii +0 -0
- py_neuromodulation/data/README +6 -0
- py_neuromodulation/data/dataset_description.json +8 -0
- py_neuromodulation/data/participants.json +32 -0
- py_neuromodulation/data/participants.tsv +2 -0
- py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_space-mni_coordsystem.json +5 -0
- py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_space-mni_electrodes.tsv +11 -0
- py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_channels.tsv +11 -0
- py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.eeg +0 -0
- py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.json +18 -0
- py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.vhdr +35 -0
- py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.vmrk +13 -0
- py_neuromodulation/data/sub-testsub/ses-EphysMedOff/sub-testsub_ses-EphysMedOff_scans.tsv +2 -0
- py_neuromodulation/grid_cortex.tsv +40 -0
- py_neuromodulation/grid_subcortex.tsv +1429 -0
- py_neuromodulation/nm_settings.json +338 -0
- py_neuromodulation/nm_stream_offline.py +7 -6
- py_neuromodulation/plots/STN_surf.mat +0 -0
- py_neuromodulation/plots/Vertices.mat +0 -0
- py_neuromodulation/plots/faces.mat +0 -0
- py_neuromodulation/plots/grid.mat +0 -0
- {py_neuromodulation-0.0.3.dist-info → py_neuromodulation-0.0.4.dist-info}/METADATA +182 -182
- py_neuromodulation-0.0.4.dist-info/RECORD +72 -0
- {py_neuromodulation-0.0.3.dist-info → py_neuromodulation-0.0.4.dist-info}/WHEEL +1 -2
- docs/build/_downloads/09df217f95985497f45d69e2d4bdc5b1/plot_2_example_add_feature.py +0 -68
- docs/build/_downloads/3b4900a2b2818ff30362215b76f7d5eb/plot_1_example_BIDS.py +0 -233
- docs/build/_downloads/7e92dd2e6cc86b239d14cafad972ae4f/plot_3_example_sharpwave_analysis.py +0 -219
- docs/build/_downloads/c2db0bf2b334d541b00662b991682256/plot_6_real_time_demo.py +0 -97
- docs/build/_downloads/ce3914826f782cbd1ea8fd024eaf0ac3/plot_5_example_rmap_computing.py +0 -64
- docs/build/_downloads/da36848a41e6a3235d91fb7cfb6d59b4/plot_0_first_demo.py +0 -192
- docs/build/_downloads/eaa4305c75b19a1e2eea941f742a6331/plot_4_example_gridPointProjection.py +0 -210
- docs/build/html/_downloads/09df217f95985497f45d69e2d4bdc5b1/plot_2_example_add_feature.py +0 -68
- docs/build/html/_downloads/3b4900a2b2818ff30362215b76f7d5eb/plot_1_example_BIDS.py +0 -239
- docs/build/html/_downloads/7e92dd2e6cc86b239d14cafad972ae4f/plot_3_example_sharpwave_analysis.py +0 -219
- docs/build/html/_downloads/c2db0bf2b334d541b00662b991682256/plot_6_real_time_demo.py +0 -97
- docs/build/html/_downloads/ce3914826f782cbd1ea8fd024eaf0ac3/plot_5_example_rmap_computing.py +0 -64
- docs/build/html/_downloads/da36848a41e6a3235d91fb7cfb6d59b4/plot_0_first_demo.py +0 -192
- docs/build/html/_downloads/eaa4305c75b19a1e2eea941f742a6331/plot_4_example_gridPointProjection.py +0 -210
- docs/source/_build/html/_downloads/09df217f95985497f45d69e2d4bdc5b1/plot_2_example_add_feature.py +0 -76
- docs/source/_build/html/_downloads/0d0d0a76e8f648d5d3cbc47da6351932/plot_real_time_demo.py +0 -97
- docs/source/_build/html/_downloads/3b4900a2b2818ff30362215b76f7d5eb/plot_1_example_BIDS.py +0 -240
- docs/source/_build/html/_downloads/5d73cadc59a8805c47e3b84063afc157/plot_example_BIDS.py +0 -233
- docs/source/_build/html/_downloads/7660317fa5a6bfbd12fcca9961457fc4/plot_example_rmap_computing.py +0 -63
- docs/source/_build/html/_downloads/7e92dd2e6cc86b239d14cafad972ae4f/plot_3_example_sharpwave_analysis.py +0 -219
- docs/source/_build/html/_downloads/839e5b319379f7fd9e867deb00fd797f/plot_example_gridPointProjection.py +0 -210
- docs/source/_build/html/_downloads/ae8be19afe5e559f011fc9b138968ba0/plot_first_demo.py +0 -192
- docs/source/_build/html/_downloads/b8b06cacc17969d3725a0b6f1d7741c5/plot_example_sharpwave_analysis.py +0 -219
- docs/source/_build/html/_downloads/c2db0bf2b334d541b00662b991682256/plot_6_real_time_demo.py +0 -121
- docs/source/_build/html/_downloads/c31a86c0b68cb4167d968091ace8080d/plot_example_add_feature.py +0 -68
- docs/source/_build/html/_downloads/ce3914826f782cbd1ea8fd024eaf0ac3/plot_5_example_rmap_computing.py +0 -64
- docs/source/_build/html/_downloads/da36848a41e6a3235d91fb7cfb6d59b4/plot_0_first_demo.py +0 -189
- docs/source/_build/html/_downloads/eaa4305c75b19a1e2eea941f742a6331/plot_4_example_gridPointProjection.py +0 -210
- docs/source/auto_examples/plot_0_first_demo.py +0 -189
- docs/source/auto_examples/plot_1_example_BIDS.py +0 -240
- docs/source/auto_examples/plot_2_example_add_feature.py +0 -76
- docs/source/auto_examples/plot_3_example_sharpwave_analysis.py +0 -219
- docs/source/auto_examples/plot_4_example_gridPointProjection.py +0 -210
- docs/source/auto_examples/plot_5_example_rmap_computing.py +0 -64
- docs/source/auto_examples/plot_6_real_time_demo.py +0 -121
- docs/source/conf.py +0 -105
- examples/plot_0_first_demo.py +0 -189
- examples/plot_1_example_BIDS.py +0 -240
- examples/plot_2_example_add_feature.py +0 -76
- examples/plot_3_example_sharpwave_analysis.py +0 -219
- examples/plot_4_example_gridPointProjection.py +0 -210
- examples/plot_5_example_rmap_computing.py +0 -64
- examples/plot_6_real_time_demo.py +0 -121
- packages/realtime_decoding/build/lib/realtime_decoding/__init__.py +0 -4
- packages/realtime_decoding/build/lib/realtime_decoding/decoder.py +0 -104
- packages/realtime_decoding/build/lib/realtime_decoding/features.py +0 -163
- packages/realtime_decoding/build/lib/realtime_decoding/helpers.py +0 -15
- packages/realtime_decoding/build/lib/realtime_decoding/run_decoding.py +0 -345
- packages/realtime_decoding/build/lib/realtime_decoding/trainer.py +0 -54
- packages/tmsi/build/lib/TMSiFileFormats/__init__.py +0 -37
- packages/tmsi/build/lib/TMSiFileFormats/file_formats/__init__.py +0 -36
- packages/tmsi/build/lib/TMSiFileFormats/file_formats/lsl_stream_writer.py +0 -200
- packages/tmsi/build/lib/TMSiFileFormats/file_formats/poly5_file_writer.py +0 -496
- packages/tmsi/build/lib/TMSiFileFormats/file_formats/poly5_to_edf_converter.py +0 -236
- packages/tmsi/build/lib/TMSiFileFormats/file_formats/xdf_file_writer.py +0 -977
- packages/tmsi/build/lib/TMSiFileFormats/file_readers/__init__.py +0 -35
- packages/tmsi/build/lib/TMSiFileFormats/file_readers/edf_reader.py +0 -116
- packages/tmsi/build/lib/TMSiFileFormats/file_readers/poly5reader.py +0 -294
- packages/tmsi/build/lib/TMSiFileFormats/file_readers/xdf_reader.py +0 -229
- packages/tmsi/build/lib/TMSiFileFormats/file_writer.py +0 -102
- packages/tmsi/build/lib/TMSiPlotters/__init__.py +0 -2
- packages/tmsi/build/lib/TMSiPlotters/gui/__init__.py +0 -39
- packages/tmsi/build/lib/TMSiPlotters/gui/_plotter_gui.py +0 -234
- packages/tmsi/build/lib/TMSiPlotters/gui/plotting_gui.py +0 -440
- packages/tmsi/build/lib/TMSiPlotters/plotters/__init__.py +0 -44
- packages/tmsi/build/lib/TMSiPlotters/plotters/hd_emg_plotter.py +0 -446
- packages/tmsi/build/lib/TMSiPlotters/plotters/impedance_plotter.py +0 -589
- packages/tmsi/build/lib/TMSiPlotters/plotters/signal_plotter.py +0 -1326
- packages/tmsi/build/lib/TMSiSDK/__init__.py +0 -54
- packages/tmsi/build/lib/TMSiSDK/device.py +0 -588
- packages/tmsi/build/lib/TMSiSDK/devices/__init__.py +0 -34
- packages/tmsi/build/lib/TMSiSDK/devices/saga/TMSi_Device_API.py +0 -1764
- packages/tmsi/build/lib/TMSiSDK/devices/saga/__init__.py +0 -34
- packages/tmsi/build/lib/TMSiSDK/devices/saga/saga_device.py +0 -1366
- packages/tmsi/build/lib/TMSiSDK/devices/saga/saga_types.py +0 -520
- packages/tmsi/build/lib/TMSiSDK/devices/saga/xml_saga_config.py +0 -165
- packages/tmsi/build/lib/TMSiSDK/error.py +0 -95
- packages/tmsi/build/lib/TMSiSDK/sample_data.py +0 -63
- packages/tmsi/build/lib/TMSiSDK/sample_data_server.py +0 -99
- packages/tmsi/build/lib/TMSiSDK/settings.py +0 -45
- packages/tmsi/build/lib/TMSiSDK/tmsi_device.py +0 -111
- packages/tmsi/build/lib/__init__.py +0 -4
- packages/tmsi/build/lib/apex_sdk/__init__.py +0 -34
- packages/tmsi/build/lib/apex_sdk/device/__init__.py +0 -41
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_API.py +0 -1009
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_API_enums.py +0 -239
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_API_structures.py +0 -668
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_device.py +0 -1611
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_dongle.py +0 -38
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_event_reader.py +0 -57
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_channel.py +0 -44
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_config.py +0 -150
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_const.py +0 -36
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_impedance_channel.py +0 -48
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_info.py +0 -108
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/dongle_info.py +0 -39
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/measurements/download_measurement.py +0 -77
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/measurements/eeg_measurement.py +0 -150
- packages/tmsi/build/lib/apex_sdk/device/devices/apex/measurements/impedance_measurement.py +0 -129
- packages/tmsi/build/lib/apex_sdk/device/threads/conversion_thread.py +0 -59
- packages/tmsi/build/lib/apex_sdk/device/threads/sampling_thread.py +0 -57
- packages/tmsi/build/lib/apex_sdk/device/tmsi_channel.py +0 -83
- packages/tmsi/build/lib/apex_sdk/device/tmsi_device.py +0 -201
- packages/tmsi/build/lib/apex_sdk/device/tmsi_device_enums.py +0 -103
- packages/tmsi/build/lib/apex_sdk/device/tmsi_dongle.py +0 -43
- packages/tmsi/build/lib/apex_sdk/device/tmsi_event_reader.py +0 -50
- packages/tmsi/build/lib/apex_sdk/device/tmsi_measurement.py +0 -118
- packages/tmsi/build/lib/apex_sdk/sample_data_server/__init__.py +0 -33
- packages/tmsi/build/lib/apex_sdk/sample_data_server/event_data.py +0 -44
- packages/tmsi/build/lib/apex_sdk/sample_data_server/sample_data.py +0 -50
- packages/tmsi/build/lib/apex_sdk/sample_data_server/sample_data_server.py +0 -136
- packages/tmsi/build/lib/apex_sdk/tmsi_errors/error.py +0 -126
- packages/tmsi/build/lib/apex_sdk/tmsi_sdk.py +0 -113
- packages/tmsi/build/lib/apex_sdk/tmsi_utilities/apex/apex_structure_generator.py +0 -134
- packages/tmsi/build/lib/apex_sdk/tmsi_utilities/decorators.py +0 -60
- packages/tmsi/build/lib/apex_sdk/tmsi_utilities/logger_filter.py +0 -42
- packages/tmsi/build/lib/apex_sdk/tmsi_utilities/singleton.py +0 -42
- packages/tmsi/build/lib/apex_sdk/tmsi_utilities/support_functions.py +0 -72
- packages/tmsi/build/lib/apex_sdk/tmsi_utilities/tmsi_logger.py +0 -98
- py_neuromodulation-0.0.3.dist-info/RECORD +0 -188
- py_neuromodulation-0.0.3.dist-info/top_level.txt +0 -5
- tests/__init__.py +0 -0
- tests/conftest.py +0 -117
- tests/test_all_examples.py +0 -10
- tests/test_all_features.py +0 -63
- tests/test_bispectra.py +0 -70
- tests/test_bursts.py +0 -105
- tests/test_feature_sampling_rates.py +0 -143
- tests/test_fooof.py +0 -16
- tests/test_initalization_offline_stream.py +0 -41
- tests/test_multiprocessing.py +0 -58
- tests/test_nan_values.py +0 -29
- tests/test_nm_filter.py +0 -95
- tests/test_nm_resample.py +0 -63
- tests/test_normalization_settings.py +0 -146
- tests/test_notch_filter.py +0 -31
- tests/test_osc_features.py +0 -424
- tests/test_preprocessing_filter.py +0 -151
- tests/test_rereference.py +0 -171
- tests/test_sampling.py +0 -57
- tests/test_settings_change_after_init.py +0 -76
- tests/test_sharpwave.py +0 -165
- tests/test_target_channel_add.py +0 -100
- tests/test_timing.py +0 -80
- {py_neuromodulation-0.0.3.dist-info → py_neuromodulation-0.0.4.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
(c) 2022 Twente Medical Systems International B.V., Oldenzaal The Netherlands
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
|
|
16
|
-
####### # # ##### #
|
|
17
|
-
# ## ## #
|
|
18
|
-
# # # # # # #
|
|
19
|
-
# # # # ##### #
|
|
20
|
-
# # # # #
|
|
21
|
-
# # # # #
|
|
22
|
-
# # # ##### #
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @file ${__init__.py}
|
|
26
|
-
* @brief Initialisation of the TMSiSDK directory classes.
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"""
|
|
32
|
-
from os.path import join, dirname, realpath
|
|
33
|
-
|
|
34
|
-
from . import (
|
|
35
|
-
device,
|
|
36
|
-
error,
|
|
37
|
-
sample_data_server,
|
|
38
|
-
sample_data,
|
|
39
|
-
settings,
|
|
40
|
-
tmsi_device,
|
|
41
|
-
)
|
|
42
|
-
from . import devices
|
|
43
|
-
from .device import DeviceInterfaceType, DeviceState
|
|
44
|
-
from .devices.saga import SagaDevice
|
|
45
|
-
from .devices.saga import xml_saga_config
|
|
46
|
-
from .error import TMSiError, TMSiErrorCode, DeviceErrorLookupTable
|
|
47
|
-
from .tmsi_device import DeviceType, discover, initialize
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def get_config(config_name):
|
|
51
|
-
TMSiSDK_dir = dirname(realpath(__file__)) # directory of this file
|
|
52
|
-
configs_dir = join(TMSiSDK_dir, "configs")
|
|
53
|
-
config_fname = join(configs_dir, config_name + ".xml")
|
|
54
|
-
return config_fname
|
|
@@ -1,588 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
(c) 2022 Twente Medical Systems International B.V., Oldenzaal The Netherlands
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
|
|
16
|
-
####### # # ##### #
|
|
17
|
-
# ## ## #
|
|
18
|
-
# # # # # # #
|
|
19
|
-
# # # # ##### #
|
|
20
|
-
# # # # #
|
|
21
|
-
# # # # #
|
|
22
|
-
# # # ##### #
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @file ${device.py}
|
|
26
|
-
* @brief Main Device Interface
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
from enum import Enum, unique
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@unique
|
|
37
|
-
class DeviceInterfaceType(Enum):
|
|
38
|
-
none = 0
|
|
39
|
-
usb = 1
|
|
40
|
-
network = 2
|
|
41
|
-
wifi = 3
|
|
42
|
-
docked = 4
|
|
43
|
-
optical = 5
|
|
44
|
-
bluetooth = 6
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
@unique
|
|
48
|
-
class DeviceState(Enum):
|
|
49
|
-
disconnected = 0
|
|
50
|
-
connected = 1
|
|
51
|
-
sampling = 2
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
@unique
|
|
55
|
-
class ChannelType(Enum):
|
|
56
|
-
unknown = 0
|
|
57
|
-
UNI = 1
|
|
58
|
-
BIP = 2
|
|
59
|
-
AUX = 3
|
|
60
|
-
sensor = 4
|
|
61
|
-
status = 5
|
|
62
|
-
counter = 6
|
|
63
|
-
all_types = 7
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
@unique
|
|
67
|
-
class MeasurementType(Enum):
|
|
68
|
-
normal = 0
|
|
69
|
-
impedance = 1
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
@unique
|
|
73
|
-
class ReferenceMethod(Enum):
|
|
74
|
-
common = 0
|
|
75
|
-
average = 1
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
@unique
|
|
79
|
-
class ReferenceSwitch(Enum):
|
|
80
|
-
fixed = 0
|
|
81
|
-
auto = 1
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
class DeviceChannel:
|
|
85
|
-
"""'DeviceChannel' represents a device channel. It has the next properties:
|
|
86
|
-
|
|
87
|
-
type : 'ChannelType' Indicates the group-type of a channel.
|
|
88
|
-
|
|
89
|
-
sample_rate : 'int' The curring sampling rate of the channel during a 'normal' measurement.
|
|
90
|
-
|
|
91
|
-
bandwidth : 'int' Bandwidth (in bits/s) required for transfer from DR to DS,
|
|
92
|
-
used by bandwidth manager in application software.
|
|
93
|
-
|
|
94
|
-
name : 'string' The name of the channel.
|
|
95
|
-
|
|
96
|
-
unit_name : 'string' The name of the unit (e.g. 'μVolt) of the sample-data of the channel.
|
|
97
|
-
|
|
98
|
-
enabled : 'bool' Indicates if a channel is enabled for measuring
|
|
99
|
-
|
|
100
|
-
Note: The properties 'name' and 'enabled' can be modified. The other properties
|
|
101
|
-
are read-only.
|
|
102
|
-
"""
|
|
103
|
-
|
|
104
|
-
def __init__(
|
|
105
|
-
self,
|
|
106
|
-
type,
|
|
107
|
-
sample_rate,
|
|
108
|
-
name,
|
|
109
|
-
unit_name,
|
|
110
|
-
enabled,
|
|
111
|
-
bandwidth=0,
|
|
112
|
-
sensor=None,
|
|
113
|
-
):
|
|
114
|
-
self.__type = type
|
|
115
|
-
self.__sample_rate = sample_rate
|
|
116
|
-
self.__unit_name = unit_name
|
|
117
|
-
self.__name = name
|
|
118
|
-
self.__enabled = enabled
|
|
119
|
-
self.__sensor = sensor
|
|
120
|
-
self.__bandwidth = bandwidth
|
|
121
|
-
|
|
122
|
-
@property
|
|
123
|
-
def type(self):
|
|
124
|
-
"""'ChannelType' Indicates the group-type of a channel."""
|
|
125
|
-
return self.__type
|
|
126
|
-
|
|
127
|
-
@property
|
|
128
|
-
def sample_rate(self):
|
|
129
|
-
"""'int' The curring sampling rate of the channel during a 'normal' measurement."""
|
|
130
|
-
return self.__sample_rate
|
|
131
|
-
|
|
132
|
-
@property
|
|
133
|
-
def bandwidth(self):
|
|
134
|
-
"""'int' Bandwidth (in bits/s) required for transfer from DR to DS, used by bandwidth manager in application software."""
|
|
135
|
-
return self.__bandwidth
|
|
136
|
-
|
|
137
|
-
@property
|
|
138
|
-
def name(self):
|
|
139
|
-
"""'string' The name of the channel."""
|
|
140
|
-
return self.__name
|
|
141
|
-
|
|
142
|
-
@name.setter
|
|
143
|
-
def name(self, var):
|
|
144
|
-
"""'string' Sets the name of the channel."""
|
|
145
|
-
self.__name = var
|
|
146
|
-
|
|
147
|
-
@property
|
|
148
|
-
def unit_name(self):
|
|
149
|
-
"""'string' The name of the unit (e.g. 'μVolt) of the sample-data of the channel."""
|
|
150
|
-
return self.__unit_name
|
|
151
|
-
|
|
152
|
-
@property
|
|
153
|
-
def enabled(self):
|
|
154
|
-
"""'bool' Indicates if a channel is enabled for measuring"""
|
|
155
|
-
return self.__enabled
|
|
156
|
-
|
|
157
|
-
@enabled.setter
|
|
158
|
-
def enabled(self, var):
|
|
159
|
-
"""'bool' Enables (True) or disables (False) a channel for measurement"""
|
|
160
|
-
self.__enabled = var
|
|
161
|
-
|
|
162
|
-
@property
|
|
163
|
-
def sensor(self):
|
|
164
|
-
"""'DeviceSensor' contains an object if a sensor is attached to the channel."""
|
|
165
|
-
return self.__sensor
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
class DeviceInfo:
|
|
169
|
-
"""'DeviceInfo' holds the static device information. It has the next properties:
|
|
170
|
-
|
|
171
|
-
ds_interface : 'DeviceInterfaceType' Indicates interface-type between the PC
|
|
172
|
-
and the docking station.
|
|
173
|
-
|
|
174
|
-
dr_interface : 'DeviceInterfaceType' Indicates interface-type between the
|
|
175
|
-
PC / docking station and the data recorder.
|
|
176
|
-
|
|
177
|
-
ds_serial_number : 'int' The serial number of the docking station.
|
|
178
|
-
|
|
179
|
-
dr_serial_number : 'int' The serial number of the data recorder.
|
|
180
|
-
|
|
181
|
-
"""
|
|
182
|
-
|
|
183
|
-
def __init__(
|
|
184
|
-
self,
|
|
185
|
-
ds_interface=DeviceInterfaceType.none,
|
|
186
|
-
dr_interface=DeviceInterfaceType.none,
|
|
187
|
-
):
|
|
188
|
-
self.__ds_interface = ds_interface
|
|
189
|
-
self.__dr_interface = dr_interface
|
|
190
|
-
self.__ds_serial_number = 0
|
|
191
|
-
self.__dr_serial_number = 0
|
|
192
|
-
|
|
193
|
-
@property
|
|
194
|
-
def ds_interface(self):
|
|
195
|
-
"""ds_interface : 'DeviceInterfaceType' Indicates interface-type between the PC
|
|
196
|
-
and the docking station.
|
|
197
|
-
"""
|
|
198
|
-
return self.__ds_interface
|
|
199
|
-
|
|
200
|
-
@property
|
|
201
|
-
def dr_interface(self):
|
|
202
|
-
"""dr_interface : 'DeviceInterfaceType' Indicates interface-type between the
|
|
203
|
-
PC / docking station and the data recorder.
|
|
204
|
-
"""
|
|
205
|
-
return self.__dr_interface
|
|
206
|
-
|
|
207
|
-
@property
|
|
208
|
-
def ds_serial_number(self):
|
|
209
|
-
"""'int' The serial number of the docking station."""
|
|
210
|
-
return self.__ds_serial_number
|
|
211
|
-
|
|
212
|
-
@property
|
|
213
|
-
def dr_serial_number(self):
|
|
214
|
-
"""'int' The serial number of the data recorder."""
|
|
215
|
-
return self.__dr_serial_number
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
class DeviceStatus:
|
|
219
|
-
"""'DeviceStatus' holds the runtime device information. It has the next properties:
|
|
220
|
-
|
|
221
|
-
state : 'DeviceState' Indicates the connection-state towards the device which can be :
|
|
222
|
-
|
|
223
|
-
- connected : The connection to the device is open
|
|
224
|
-
- disconnected : The connection to the device is closed
|
|
225
|
-
- sampling : The connection to the device is open and the device
|
|
226
|
-
has an ongoing measurement active.
|
|
227
|
-
|
|
228
|
-
error : 'int' The return-code of the last made call to the device. A '0'
|
|
229
|
-
indicates that the call was succesfull.
|
|
230
|
-
"""
|
|
231
|
-
|
|
232
|
-
def __init__(self, state, error):
|
|
233
|
-
self.__state = state
|
|
234
|
-
self.__error = error
|
|
235
|
-
|
|
236
|
-
@property
|
|
237
|
-
def state(self):
|
|
238
|
-
"""'DeviceState' Indicates the connection-state towards the device"""
|
|
239
|
-
return self.__state
|
|
240
|
-
|
|
241
|
-
@property
|
|
242
|
-
def error(self):
|
|
243
|
-
"""'int' The return-code of the last made call to the device."""
|
|
244
|
-
return self.__error
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
class DeviceSensor:
|
|
248
|
-
"""'DeviceSensor' represents the sensor-data of a channel. It has the next properties:
|
|
249
|
-
|
|
250
|
-
channel_list_idx : 'int' Index of the channel in the total channel list. Index starts at 0.
|
|
251
|
-
The total channel list can be accessed with [Device.config.channels]
|
|
252
|
-
|
|
253
|
-
id : 'int' ID-code of the sensor used to identify BIP-sensors.
|
|
254
|
-
|
|
255
|
-
serial_nr : 'int' Serial number of an attached AUX-sensor.
|
|
256
|
-
|
|
257
|
-
product_id : 'int' Product identified of an attached AUX-sensor.
|
|
258
|
-
|
|
259
|
-
exp : 'int' Exponent for the unit, e.g. milli = -3 this gives for a
|
|
260
|
-
unit_name V a result mV.
|
|
261
|
-
|
|
262
|
-
name : 'string' The name of the sensor-channel.
|
|
263
|
-
|
|
264
|
-
unit_name : 'string' The name of the unit (e.g. 'Volt) of the sensor-data.
|
|
265
|
-
|
|
266
|
-
"""
|
|
267
|
-
|
|
268
|
-
def __init__(
|
|
269
|
-
self, channel_list_idx, id, serial_nr, product_id, name, unit_name, exp
|
|
270
|
-
):
|
|
271
|
-
self.__channel_list_idx = channel_list_idx
|
|
272
|
-
self.__id = id
|
|
273
|
-
self.__serial_nr = serial_nr
|
|
274
|
-
self.__name = name
|
|
275
|
-
self.__unit_name = unit_name
|
|
276
|
-
self.__product_id = product_id
|
|
277
|
-
self.__exp = exp
|
|
278
|
-
|
|
279
|
-
@property
|
|
280
|
-
def channel_list_idx(self):
|
|
281
|
-
"""''int' Index of the channel in the total channel list."""
|
|
282
|
-
return self.__channel_list_idx
|
|
283
|
-
|
|
284
|
-
@property
|
|
285
|
-
def id(self):
|
|
286
|
-
"""'int' ID-code of the sensor used to identify BIP-sensors."""
|
|
287
|
-
return self.__id
|
|
288
|
-
|
|
289
|
-
@property
|
|
290
|
-
def serial_nr(self):
|
|
291
|
-
"""'int' Serial number of an attached AUX-sensor"""
|
|
292
|
-
return self.__serial_nr
|
|
293
|
-
|
|
294
|
-
@property
|
|
295
|
-
def product_id(self):
|
|
296
|
-
"""'int' Product identified of an attached AUX-sensor"""
|
|
297
|
-
return self.__product_id
|
|
298
|
-
|
|
299
|
-
@property
|
|
300
|
-
def name(self):
|
|
301
|
-
"""'string' The name of the sensor-channel."""
|
|
302
|
-
return self.__name
|
|
303
|
-
|
|
304
|
-
@property
|
|
305
|
-
def unit_name(self):
|
|
306
|
-
"""'string' Exponent for the unit, e.g. milli = -3 this gives for a
|
|
307
|
-
unit_name V a result mV.
|
|
308
|
-
"""
|
|
309
|
-
return self.__unit_name
|
|
310
|
-
|
|
311
|
-
@property
|
|
312
|
-
def exp(self):
|
|
313
|
-
"""'int' The name of the channel."""
|
|
314
|
-
return self.__exp
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
class DeviceConfig:
|
|
318
|
-
"""'DeviceConfig' holds the actual device configuration"""
|
|
319
|
-
|
|
320
|
-
def __init__(self, sample_rate, num_channels):
|
|
321
|
-
pass
|
|
322
|
-
|
|
323
|
-
@property
|
|
324
|
-
def num_channels(self):
|
|
325
|
-
"""'int' The total number of channels (enabled and disabled)"""
|
|
326
|
-
pass
|
|
327
|
-
|
|
328
|
-
@property
|
|
329
|
-
def channels(self):
|
|
330
|
-
"""'list DeviceChannel' The total list of channels (enabled and disabled)"""
|
|
331
|
-
pass
|
|
332
|
-
|
|
333
|
-
@channels.setter
|
|
334
|
-
def channels(self, ch_list):
|
|
335
|
-
"""Updates the channel lists in the device.
|
|
336
|
-
|
|
337
|
-
Args:
|
|
338
|
-
ch_list : 'list DeviceChannel'
|
|
339
|
-
|
|
340
|
-
The channel-properties 'enabled' and 'name' can be modified. The other
|
|
341
|
-
channel-properties are read-only.
|
|
342
|
-
|
|
343
|
-
Note:
|
|
344
|
-
'ch_list' must contain all channels (enabled and disabled), in the
|
|
345
|
-
same sequence as retrieved with 'Device.config.channels'
|
|
346
|
-
|
|
347
|
-
It is advised to "refresh" the applications' local "variables"
|
|
348
|
-
after the channel list has been updated.
|
|
349
|
-
"""
|
|
350
|
-
pass
|
|
351
|
-
|
|
352
|
-
@property
|
|
353
|
-
def base_sample_rate(self):
|
|
354
|
-
"""'int' The active base-sample-rate of the device"""
|
|
355
|
-
pass
|
|
356
|
-
|
|
357
|
-
@base_sample_rate.setter
|
|
358
|
-
def base_sample_rate(self, sample_rate):
|
|
359
|
-
"""Sets the base-sample-rate of the device.
|
|
360
|
-
|
|
361
|
-
Args:
|
|
362
|
-
sample_rate : 'int' new base sample rate
|
|
363
|
-
|
|
364
|
-
Note:
|
|
365
|
-
Upon a change of the base-sample-rate, automatically the sample-rate
|
|
366
|
-
of the channel-type-groups (and thus also the sample-rate of every channel)
|
|
367
|
-
changes.
|
|
368
|
-
|
|
369
|
-
It is advised to "refresh" the applications' local "variables"
|
|
370
|
-
after the base-sample-rate has been updated.
|
|
371
|
-
"""
|
|
372
|
-
pass
|
|
373
|
-
|
|
374
|
-
@property
|
|
375
|
-
def sample_rate(self):
|
|
376
|
-
"""'int' The rate of the current configuration, with which
|
|
377
|
-
sample-sets are sent during a measurement.
|
|
378
|
-
"""
|
|
379
|
-
pass
|
|
380
|
-
|
|
381
|
-
def get_sample_rate(self, channel_type):
|
|
382
|
-
"""'int' the sample-rate of the specified channel-type-group.
|
|
383
|
-
|
|
384
|
-
Args:
|
|
385
|
-
channel_type : 'ChannelType' The channel-type-group.
|
|
386
|
-
"""
|
|
387
|
-
pass
|
|
388
|
-
|
|
389
|
-
def set_sample_rate(self, channel_type, base_sample_rate_divider):
|
|
390
|
-
"""Sets the sample-rate of the specified channel-type-group.
|
|
391
|
-
|
|
392
|
-
Args:
|
|
393
|
-
channel_type : 'ChannelType' The channel-type-group of which the
|
|
394
|
-
sample-rate must be updated.
|
|
395
|
-
It is possible to set all channels to the same sample-rate within one
|
|
396
|
-
call. Then 'ChannelType.all_types' must be used.
|
|
397
|
-
|
|
398
|
-
base_sample_rate_divider: 'int' The divider to indicate to what fraction
|
|
399
|
-
of the active base-sample-rate the sample-rate of the channel-type-group
|
|
400
|
-
must be set. Only the values 1, 2, 4 and 8 are possible.
|
|
401
|
-
For example if the base-sample-rate=4000 and base_sample_rate_divider=8,
|
|
402
|
-
the sample-rate will become 4000/8 = 500 Hz
|
|
403
|
-
|
|
404
|
-
Note:
|
|
405
|
-
Upon a change of the sample-rate of a channel-type-group, automatically
|
|
406
|
-
the sample-rate of the channels of that channel-type are updated.
|
|
407
|
-
|
|
408
|
-
It is advised to "refresh" the applications' local "variables"
|
|
409
|
-
after the sample-rate of a channel-type-group has been updated.
|
|
410
|
-
"""
|
|
411
|
-
pass
|
|
412
|
-
|
|
413
|
-
def set_interface_type(self, dr_interface_type):
|
|
414
|
-
"""Changes the configured interface type of the device
|
|
415
|
-
|
|
416
|
-
Args:
|
|
417
|
-
interface_type: 'DeviceInterfaceType' The interface type that needs
|
|
418
|
-
to be updated.
|
|
419
|
-
"""
|
|
420
|
-
pass
|
|
421
|
-
|
|
422
|
-
@property
|
|
423
|
-
def interface_bandwidth(self):
|
|
424
|
-
"""'int' Data bandwidth in Mbits/s for current interface."""
|
|
425
|
-
pass
|
|
426
|
-
|
|
427
|
-
@property
|
|
428
|
-
def reference_method(self):
|
|
429
|
-
"""'ReferenceMethod' the reference method applied to the UNI channels"""
|
|
430
|
-
pass
|
|
431
|
-
|
|
432
|
-
@reference_method.setter
|
|
433
|
-
def reference_method(self, reference_type):
|
|
434
|
-
"""Sets the reference method for the UNI channels
|
|
435
|
-
|
|
436
|
-
Args:
|
|
437
|
-
reference_type: 'ReferenceMethod' the type of reference method that
|
|
438
|
-
should be used for measuring the UNI channels
|
|
439
|
-
|
|
440
|
-
"""
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
class Device:
|
|
444
|
-
"""'Device' handles the connection to a TMSi Measurement System like the SAGA.
|
|
445
|
-
|
|
446
|
-
The Device class interfaces with the measurement system to :
|
|
447
|
-
- open/close a connection to the system
|
|
448
|
-
- configure the system
|
|
449
|
-
- forward the received sample data to Python-clients for display and/or storage.
|
|
450
|
-
|
|
451
|
-
Args:
|
|
452
|
-
ds-interface: The interface-type between the PC and the docking-station.
|
|
453
|
-
This might be 'usb' or 'network''
|
|
454
|
-
|
|
455
|
-
dr-interface: The interface-type between the docking-station and data recorder.
|
|
456
|
-
This might be 'docked', 'optical' or 'wifi'
|
|
457
|
-
"""
|
|
458
|
-
|
|
459
|
-
@property
|
|
460
|
-
def id(self):
|
|
461
|
-
"""'int' : Unique id within all available devices. The id can be used to
|
|
462
|
-
register as a client at the 'sample_data_server' for retrieval of
|
|
463
|
-
sample-data of a specific device
|
|
464
|
-
"""
|
|
465
|
-
pass
|
|
466
|
-
|
|
467
|
-
@property
|
|
468
|
-
def info(self):
|
|
469
|
-
"""'class DeviceInfo' : Static information of a device like used interfaces, serial numbers"""
|
|
470
|
-
pass
|
|
471
|
-
|
|
472
|
-
@property
|
|
473
|
-
def status(self):
|
|
474
|
-
"""'class DeviceStatus' : Runtime information of a device like device state"""
|
|
475
|
-
pass
|
|
476
|
-
|
|
477
|
-
@property
|
|
478
|
-
def config(self):
|
|
479
|
-
"""'class DeviceConfig' : The configuration of a device which exists
|
|
480
|
-
out of individual properties (like base-sample-rate) and the total
|
|
481
|
-
channel list (with enabled and disabled channels)
|
|
482
|
-
"""
|
|
483
|
-
pass
|
|
484
|
-
|
|
485
|
-
@property
|
|
486
|
-
def channels(self):
|
|
487
|
-
"""'list of class DeviceChannel' : The list of enabled channels.
|
|
488
|
-
Enabled channels are active during an 'normal' measurement.
|
|
489
|
-
"""
|
|
490
|
-
pass
|
|
491
|
-
|
|
492
|
-
@property
|
|
493
|
-
def imp_channels(self):
|
|
494
|
-
"""'list of class DeviceChannel' : The list of impedance channels.
|
|
495
|
-
Impedance channels are active during an 'impedance' measurement.
|
|
496
|
-
"""
|
|
497
|
-
pass
|
|
498
|
-
|
|
499
|
-
@property
|
|
500
|
-
def sensors(self):
|
|
501
|
-
"""'list of class DeviceSensor' : The complete list of sensor-information
|
|
502
|
-
for the sensor-type channels : BIP and AUX
|
|
503
|
-
"""
|
|
504
|
-
|
|
505
|
-
@property
|
|
506
|
-
def datetime(self):
|
|
507
|
-
"""'datetime' Current date and time of the device"""
|
|
508
|
-
pass
|
|
509
|
-
|
|
510
|
-
@datetime.setter
|
|
511
|
-
def datetime(self, dt):
|
|
512
|
-
"""'datetime' Sets date and time of the device"""
|
|
513
|
-
pass
|
|
514
|
-
|
|
515
|
-
def open(self):
|
|
516
|
-
"""Opens the connection to the device.
|
|
517
|
-
|
|
518
|
-
The open-function will first initiate a discovery on attached systems to the PC
|
|
519
|
-
based on the interface-types which were registered upon the creation of the Device-object.
|
|
520
|
-
|
|
521
|
-
A connection will be established with the first available system.
|
|
522
|
-
|
|
523
|
-
The functionailty a device offers will only be available when a connection
|
|
524
|
-
to the system has been established.
|
|
525
|
-
"""
|
|
526
|
-
pass
|
|
527
|
-
|
|
528
|
-
def close(self):
|
|
529
|
-
"""Closes the connection to the device."""
|
|
530
|
-
pass
|
|
531
|
-
|
|
532
|
-
def start_measurement(self, measurement_type=MeasurementType.normal):
|
|
533
|
-
"""Starts a measurement on the device.
|
|
534
|
-
Clients, which want to receive the sample-data of a measurement,
|
|
535
|
-
must be registered at the 'sample data server' before the measurement is started.
|
|
536
|
-
|
|
537
|
-
Args:
|
|
538
|
-
measurement_type : - MeasurementType.normal (default), starts a measurement
|
|
539
|
-
with the 'enabled' channels: 'Device.channels[]'.
|
|
540
|
-
- MeasurementType.impedance, starts an impedance-measurement
|
|
541
|
-
with all 'impedance' channels: 'Device.imp_channels[]'
|
|
542
|
-
"""
|
|
543
|
-
pass
|
|
544
|
-
|
|
545
|
-
def stop_measurement(self):
|
|
546
|
-
"""Stops an ongoing measurement on the device."""
|
|
547
|
-
pass
|
|
548
|
-
|
|
549
|
-
def set_factory_defaults(self):
|
|
550
|
-
"""Initiates a factory reset to restore the systems' default configuration."""
|
|
551
|
-
pass
|
|
552
|
-
|
|
553
|
-
def load_config(self, filename):
|
|
554
|
-
"""Loads a device configuration from file into the attached system.
|
|
555
|
-
|
|
556
|
-
1. The device configuration is read from the specified file.
|
|
557
|
-
2. This configuration is uploaded into the attached system.
|
|
558
|
-
3. The configuration is downloaded from the system to be sure that
|
|
559
|
-
the configuration of the Python-interface is in sync with the
|
|
560
|
-
configuration of the device.
|
|
561
|
-
|
|
562
|
-
Note : It is advised to "refresh" the applications' local "variables"
|
|
563
|
-
after a new device configuration has been load.
|
|
564
|
-
|
|
565
|
-
Args:
|
|
566
|
-
filename : path and filename of the file that must be loaded
|
|
567
|
-
"""
|
|
568
|
-
pass
|
|
569
|
-
|
|
570
|
-
def save_config(self, filename):
|
|
571
|
-
"""Saves the current device configuration to file.
|
|
572
|
-
|
|
573
|
-
Args:
|
|
574
|
-
filename : path and filename of the file to which the current
|
|
575
|
-
device configuration must be saved.
|
|
576
|
-
"""
|
|
577
|
-
pass
|
|
578
|
-
|
|
579
|
-
def update_sensors(self):
|
|
580
|
-
"""Called when sensors have been attached or detached to/from the device.
|
|
581
|
-
The complete configuration including the new sensor-configuration
|
|
582
|
-
is reloaded from the device.
|
|
583
|
-
|
|
584
|
-
Note:
|
|
585
|
-
It is advised to "refresh" the applications' local "variables"
|
|
586
|
-
after the the complete configuration has been reloaded.
|
|
587
|
-
"""
|
|
588
|
-
pass
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
(c) 2022 Twente Medical Systems International B.V., Oldenzaal The Netherlands
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
|
|
16
|
-
####### # # ##### #
|
|
17
|
-
# ## ## #
|
|
18
|
-
# # # # # # #
|
|
19
|
-
# # # # ##### #
|
|
20
|
-
# # # # #
|
|
21
|
-
# # # # #
|
|
22
|
-
# # # ##### #
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @file ${__init__.py}
|
|
26
|
-
* @brief Initialisation of the devices directory.
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
from . import saga
|
|
34
|
-
from .saga import SagaDevice
|