scd-edition 0.1.0__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.
- scd_app/__init__.py +0 -0
- scd_app/__main__.py +6 -0
- scd_app/_vendor/__init__.py +1 -0
- scd_app/_vendor/motor_unit_toolbox/__init__.py +8 -0
- scd_app/_vendor/motor_unit_toolbox/muap_comp.py +55 -0
- scd_app/_vendor/motor_unit_toolbox/props.py +1022 -0
- scd_app/_vendor/motor_unit_toolbox/spike_comp.py +835 -0
- scd_app/core/__init__.py +0 -0
- scd_app/core/auto_editor.py +440 -0
- scd_app/core/config.py +253 -0
- scd_app/core/constants.py +26 -0
- scd_app/core/data_handler.py +536 -0
- scd_app/core/decomp_worker.py +569 -0
- scd_app/core/filter_recalculation.py +851 -0
- scd_app/core/mu_model.py +48 -0
- scd_app/core/mu_properties.py +711 -0
- scd_app/core/utils.py +16 -0
- scd_app/examples.py +26 -0
- scd_app/gui/__init__.py +0 -0
- scd_app/gui/main_window.py +381 -0
- scd_app/gui/style/__init__.py +0 -0
- scd_app/gui/style/fonts/Figtree-Bold.ttf +0 -0
- scd_app/gui/style/fonts/Figtree-Medium.ttf +0 -0
- scd_app/gui/style/fonts/Figtree-Regular.ttf +0 -0
- scd_app/gui/style/fonts/Figtree-SemiBold.ttf +0 -0
- scd_app/gui/style/fonts/Inter-ExtraBold.ttf +0 -0
- scd_app/gui/style/fonts/Inter-Medium.ttf +0 -0
- scd_app/gui/style/fonts/Inter-Regular.ttf +0 -0
- scd_app/gui/style/fonts/Inter-SemiBold.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-Black.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-Bold.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-ExtraBold.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-ExtraLight.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-Light.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-Medium.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-Regular.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-SemiBold.ttf +0 -0
- scd_app/gui/style/fonts/Lexend-Thin.ttf +0 -0
- scd_app/gui/style/styling.py +808 -0
- scd_app/gui/tabs/__init__.py +0 -0
- scd_app/gui/tabs/config_tab.py +2091 -0
- scd_app/gui/tabs/decomposition_tab.py +2492 -0
- scd_app/gui/tabs/edition_tab.py +3627 -0
- scd_app/gui/tabs/visualisation_tab.py +1055 -0
- scd_app/gui/widgets/__init__.py +0 -0
- scd_app/gui/widgets/import_data_dialog.py +142 -0
- scd_app/gui/widgets/mu_properties_panel.py +420 -0
- scd_app/gui/widgets/muap_popout.py +179 -0
- scd_app/gui/widgets/source_plot_widget.py +549 -0
- scd_app/io/__init__.py +5 -0
- scd_app/io/atomic_pickle.py +37 -0
- scd_app/io/data_inspector.py +235 -0
- scd_app/io/data_loader.py +619 -0
- scd_app/io/decomposition_loader.py +364 -0
- scd_app/io/otb4_loader.py +481 -0
- scd_app/io/portable_format.py +126 -0
- scd_app/io/rhs_loader.py +334 -0
- scd_app/main.py +12 -0
- scd_app/resources/examples/README.md +13 -0
- scd_app/resources/examples/emg.mat +0 -0
- scd_app/resources/examples/example_config.json +23 -0
- scd_app/resources/loaders_configs/loader_csv.yaml +13 -0
- scd_app/resources/loaders_configs/loader_h5.yaml +25 -0
- scd_app/resources/loaders_configs/loader_mat.yaml +20 -0
- scd_app/resources/loaders_configs/loader_npy.yaml +10 -0
- scd_app/resources/loaders_configs/loader_otb+.yaml +18 -0
- scd_app/resources/loaders_configs/loader_otb4.yaml +19 -0
- scd_app/resources/loaders_configs/loader_rhs.yaml +31 -0
- scd_app/resources/loaders_configs/loader_scd_h5.yaml +22 -0
- scd_app/resources/loaders_configs/loader_sim_hdf5.yaml +34 -0
- scd_edition-0.1.0.dist-info/METADATA +708 -0
- scd_edition-0.1.0.dist-info/RECORD +77 -0
- scd_edition-0.1.0.dist-info/WHEEL +5 -0
- scd_edition-0.1.0.dist-info/entry_points.txt +2 -0
- scd_edition-0.1.0.dist-info/licenses/LICENSE +29 -0
- scd_edition-0.1.0.dist-info/licenses/THIRD_PARTY_NOTICES.md +37 -0
- scd_edition-0.1.0.dist-info/top_level.txt +1 -0
scd_app/__init__.py
ADDED
|
File without changes
|
scd_app/__main__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Third-party source distributed inside SCD Edition."""
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""Vendored Motor Unit Toolbox routines used by SCD Edition.
|
|
2
|
+
|
|
3
|
+
Upstream: https://github.com/imendezguerra/motor_unit_toolbox
|
|
4
|
+
Version: 1.0, commit d84dc6c943daa5d686b2911b48b13bf718628130
|
|
5
|
+
License: MIT; see THIRD_PARTY_NOTICES.md at the distribution root.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "1.0"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""MUAP channel-selection helpers from Motor Unit Toolbox 1.0.
|
|
2
|
+
|
|
3
|
+
This is the subset imported by ``props.py``. It is preserved from upstream
|
|
4
|
+
commit d84dc6c943daa5d686b2911b48b13bf718628130 under the MIT License.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
import numpy as np
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def get_highest_iqr_ch(muap: np.ndarray) -> np.ndarray:
|
|
13
|
+
"""Compute the highest interquartile range (IQR) channels."""
|
|
14
|
+
peak_amps = np.amax(np.abs(muap), axis=-1)
|
|
15
|
+
peak_amps = np.reshape(peak_amps, (-1))
|
|
16
|
+
q1 = np.percentile(peak_amps, 25)
|
|
17
|
+
q3 = np.percentile(peak_amps, 75)
|
|
18
|
+
iqr = q3 - q1
|
|
19
|
+
whis = 1.5
|
|
20
|
+
outliers = peak_amps > q3 + whis * iqr
|
|
21
|
+
return np.reshape(outliers, (muap.shape[0], muap.shape[1]))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def get_percentile_ch(muap: np.ndarray, thr: Optional[int] = 90):
|
|
25
|
+
"""Compute channels whose amplitude exceeds a percentile threshold."""
|
|
26
|
+
peak_amps = np.amax(np.abs(muap), axis=-1)
|
|
27
|
+
peak_amps = np.reshape(peak_amps, (-1))
|
|
28
|
+
outliers = peak_amps > np.percentile(peak_amps, thr)
|
|
29
|
+
return np.reshape(outliers, (muap.shape[0], muap.shape[1]))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_highest_iqr_ptp_ch(muap: np.ndarray) -> np.ndarray:
|
|
33
|
+
"""Compute channels with outlying peak-to-peak amplitude."""
|
|
34
|
+
peak_amps = np.ptp(muap, axis=-1)
|
|
35
|
+
peak_amps = np.reshape(peak_amps, (-1))
|
|
36
|
+
q1 = np.percentile(peak_amps, 25)
|
|
37
|
+
q3 = np.percentile(peak_amps, 75)
|
|
38
|
+
iqr = q3 - q1
|
|
39
|
+
whis = 1.5
|
|
40
|
+
outliers = peak_amps > q3 + whis * iqr
|
|
41
|
+
return np.reshape(outliers, (muap.shape[0], muap.shape[1]))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def get_highest_amp_ch(muap: np.ndarray) -> np.ndarray:
|
|
45
|
+
"""Compute channels with the highest absolute amplitude."""
|
|
46
|
+
peak_amps = np.amax(np.abs(muap), axis=-1)
|
|
47
|
+
amp_thr = 3 * np.std(peak_amps)
|
|
48
|
+
return peak_amps > amp_thr
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def get_highest_ptp_ch(muap: np.ndarray) -> np.ndarray:
|
|
52
|
+
"""Compute channels with the highest peak-to-peak amplitude."""
|
|
53
|
+
ptp_amps = np.ptp(muap, axis=-1)
|
|
54
|
+
amp_thr = 2 * np.std(ptp_amps)
|
|
55
|
+
return ptp_amps > amp_thr
|