paradigma 0.3.2__py3-none-any.whl → 0.4.1__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 (123) hide show
  1. paradigma/assets/gait_detection_clf_package.pkl +0 -0
  2. paradigma/assets/gait_filtering_clf_package.pkl +0 -0
  3. paradigma/assets/ppg_quality_clf_package.pkl +0 -0
  4. paradigma/assets/tremor_detection_clf_package.pkl +0 -0
  5. paradigma/classification.py +115 -0
  6. paradigma/config.py +314 -0
  7. paradigma/constants.py +48 -7
  8. paradigma/feature_extraction.py +811 -547
  9. paradigma/pipelines/__init__.py +0 -0
  10. paradigma/pipelines/gait_pipeline.py +727 -0
  11. paradigma/pipelines/heart_rate_pipeline.py +426 -0
  12. paradigma/pipelines/heart_rate_utils.py +780 -0
  13. paradigma/pipelines/tremor_pipeline.py +299 -0
  14. paradigma/preprocessing.py +363 -0
  15. paradigma/segmenting.py +396 -0
  16. paradigma/testing.py +416 -0
  17. paradigma/util.py +393 -16
  18. paradigma-0.4.1.dist-info/METADATA +138 -0
  19. paradigma-0.4.1.dist-info/RECORD +22 -0
  20. {paradigma-0.3.2.dist-info → paradigma-0.4.1.dist-info}/WHEEL +1 -1
  21. paradigma/gait_analysis.py +0 -415
  22. paradigma/gait_analysis_config.py +0 -266
  23. paradigma/heart_rate_analysis.py +0 -127
  24. paradigma/heart_rate_analysis_config.py +0 -9
  25. paradigma/heart_rate_util.py +0 -173
  26. paradigma/imu_preprocessing.py +0 -232
  27. paradigma/ppg/classifier/LR_PPG_quality.pkl +0 -0
  28. paradigma/ppg/classifier/LR_model.mat +0 -0
  29. paradigma/ppg/feat_extraction/acc_feature.m +0 -20
  30. paradigma/ppg/feat_extraction/peakdet.m +0 -64
  31. paradigma/ppg/feat_extraction/ppg_features.m +0 -53
  32. paradigma/ppg/glob_functions/extract_hr_segments.m +0 -37
  33. paradigma/ppg/glob_functions/extract_overlapping_segments.m +0 -23
  34. paradigma/ppg/glob_functions/jsonlab/AUTHORS.txt +0 -41
  35. paradigma/ppg/glob_functions/jsonlab/ChangeLog.txt +0 -74
  36. paradigma/ppg/glob_functions/jsonlab/LICENSE_BSD.txt +0 -25
  37. paradigma/ppg/glob_functions/jsonlab/LICENSE_GPLv3.txt +0 -699
  38. paradigma/ppg/glob_functions/jsonlab/README.txt +0 -394
  39. paradigma/ppg/glob_functions/jsonlab/examples/.svn/entries +0 -368
  40. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/demo_jsonlab_basic.m.svn-base +0 -180
  41. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/demo_ubjson_basic.m.svn-base +0 -180
  42. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/example1.json.svn-base +0 -23
  43. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/example2.json.svn-base +0 -22
  44. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/example3.json.svn-base +0 -11
  45. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/example4.json.svn-base +0 -34
  46. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/jsonlab_basictest.matlab.svn-base +0 -662
  47. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/jsonlab_selftest.m.svn-base +0 -27
  48. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/jsonlab_selftest.matlab.svn-base +0 -144
  49. paradigma/ppg/glob_functions/jsonlab/examples/.svn/text-base/jsonlab_speedtest.m.svn-base +0 -21
  50. paradigma/ppg/glob_functions/jsonlab/examples/demo_jsonlab_basic.m +0 -180
  51. paradigma/ppg/glob_functions/jsonlab/examples/demo_ubjson_basic.m +0 -180
  52. paradigma/ppg/glob_functions/jsonlab/examples/example1.json +0 -23
  53. paradigma/ppg/glob_functions/jsonlab/examples/example2.json +0 -22
  54. paradigma/ppg/glob_functions/jsonlab/examples/example3.json +0 -11
  55. paradigma/ppg/glob_functions/jsonlab/examples/example4.json +0 -34
  56. paradigma/ppg/glob_functions/jsonlab/examples/jsonlab_basictest.matlab +0 -662
  57. paradigma/ppg/glob_functions/jsonlab/examples/jsonlab_selftest.m +0 -27
  58. paradigma/ppg/glob_functions/jsonlab/examples/jsonlab_selftest.matlab +0 -144
  59. paradigma/ppg/glob_functions/jsonlab/examples/jsonlab_speedtest.m +0 -21
  60. paradigma/ppg/glob_functions/jsonlab/jsonopt.m +0 -32
  61. paradigma/ppg/glob_functions/jsonlab/loadjson.m +0 -566
  62. paradigma/ppg/glob_functions/jsonlab/loadubjson.m +0 -528
  63. paradigma/ppg/glob_functions/jsonlab/mergestruct.m +0 -33
  64. paradigma/ppg/glob_functions/jsonlab/savejson.m +0 -475
  65. paradigma/ppg/glob_functions/jsonlab/saveubjson.m +0 -504
  66. paradigma/ppg/glob_functions/jsonlab/varargin2struct.m +0 -40
  67. paradigma/ppg/glob_functions/sample_prob_final.m +0 -49
  68. paradigma/ppg/glob_functions/synchronization.m +0 -76
  69. paradigma/ppg/glob_functions/tsdf_scan_meta.m +0 -22
  70. paradigma/ppg/hr_functions/Long_TFD_JOT.m +0 -37
  71. paradigma/ppg/hr_functions/PPG_TFD_HR.m +0 -59
  72. paradigma/ppg/hr_functions/TFD toolbox JOT/.gitignore +0 -4
  73. paradigma/ppg/hr_functions/TFD toolbox JOT/CHANGELOG.md +0 -23
  74. paradigma/ppg/hr_functions/TFD toolbox JOT/LICENCE.md +0 -27
  75. paradigma/ppg/hr_functions/TFD toolbox JOT/README.md +0 -251
  76. paradigma/ppg/hr_functions/TFD toolbox JOT/README.pdf +0 -0
  77. paradigma/ppg/hr_functions/TFD toolbox JOT/common/gen_Doppler_kern.m +0 -142
  78. paradigma/ppg/hr_functions/TFD toolbox JOT/common/gen_Doppler_lag_kern.m +0 -314
  79. paradigma/ppg/hr_functions/TFD toolbox JOT/common/gen_lag_kern.m +0 -123
  80. paradigma/ppg/hr_functions/TFD toolbox JOT/dec_tfd.m +0 -154
  81. paradigma/ppg/hr_functions/TFD toolbox JOT/decimated_TFDs/dec_di_gdtfd.m +0 -194
  82. paradigma/ppg/hr_functions/TFD toolbox JOT/decimated_TFDs/dec_li_gdtfd.m +0 -200
  83. paradigma/ppg/hr_functions/TFD toolbox JOT/decimated_TFDs/dec_nonsep_gdtfd.m +0 -229
  84. paradigma/ppg/hr_functions/TFD toolbox JOT/decimated_TFDs/dec_sep_gdtfd.m +0 -241
  85. paradigma/ppg/hr_functions/TFD toolbox JOT/full_TFDs/di_gdtfd.m +0 -157
  86. paradigma/ppg/hr_functions/TFD toolbox JOT/full_TFDs/li_gdtfd.m +0 -190
  87. paradigma/ppg/hr_functions/TFD toolbox JOT/full_TFDs/nonsep_gdtfd.m +0 -196
  88. paradigma/ppg/hr_functions/TFD toolbox JOT/full_TFDs/sep_gdtfd.m +0 -199
  89. paradigma/ppg/hr_functions/TFD toolbox JOT/full_tfd.m +0 -144
  90. paradigma/ppg/hr_functions/TFD toolbox JOT/load_curdir.m +0 -13
  91. paradigma/ppg/hr_functions/TFD toolbox JOT/pics/decimated_TFDs_examples.png +0 -0
  92. paradigma/ppg/hr_functions/TFD toolbox JOT/pics/full_TFDs_examples.png +0 -0
  93. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/check_dec_params_seq.m +0 -79
  94. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/dispEE.m +0 -9
  95. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/dispVars.m +0 -26
  96. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/disp_bytes.m +0 -25
  97. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/fold_vector_full.m +0 -40
  98. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/fold_vector_half.m +0 -34
  99. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/gen_LFM.m +0 -29
  100. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/get_analytic_signal.m +0 -76
  101. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/get_window.m +0 -176
  102. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/isreal_fn.m +0 -11
  103. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/padWin.m +0 -97
  104. paradigma/ppg/hr_functions/TFD toolbox JOT/utils/vtfd.m +0 -149
  105. paradigma/ppg/preprocessing/preprocessing_imu.m +0 -15
  106. paradigma/ppg/preprocessing/preprocessing_ppg.m +0 -13
  107. paradigma/ppg_preprocessing.py +0 -313
  108. paradigma/preprocessing_config.py +0 -69
  109. paradigma/quantification.py +0 -58
  110. paradigma/tremor/TremorFeaturesAndClassification.m +0 -345
  111. paradigma/tremor/feat_extraction/DerivativesExtract.m +0 -22
  112. paradigma/tremor/feat_extraction/ExtractBandSignalsRMS.m +0 -72
  113. paradigma/tremor/feat_extraction/MFCCExtract.m +0 -100
  114. paradigma/tremor/feat_extraction/PSDBandPower.m +0 -52
  115. paradigma/tremor/feat_extraction/PSDEst.m +0 -63
  116. paradigma/tremor/feat_extraction/PSDExtrAxis.m +0 -88
  117. paradigma/tremor/feat_extraction/PSDExtrOpt.m +0 -95
  118. paradigma/tremor/preprocessing/InterpData.m +0 -32
  119. paradigma/tremor/weekly_aggregates/WeeklyAggregates.m +0 -295
  120. paradigma/windowing.py +0 -219
  121. paradigma-0.3.2.dist-info/METADATA +0 -79
  122. paradigma-0.3.2.dist-info/RECORD +0 -108
  123. {paradigma-0.3.2.dist-info → paradigma-0.4.1.dist-info}/LICENSE +0 -0
@@ -1,37 +0,0 @@
1
- function [start_idx, end_idx] = extract_hr_segments(label_arr, threshold)
2
- % Function which calculates the switches between high and low quality. It
3
- % calculates the length of the high quality parts and returns the correct
4
- % data indices for every high quality part longer than a specific threshold!
5
- % Input:
6
- % - labelArray: Label array containin of 0 (low-quality) and 1 (high-quality)
7
- % - threshold: minimal required length for HR analysis (f.e. 30s = 30*fs=
8
- % 900 samples
9
-
10
- start_idx = [];
11
- end_idx = [];
12
-
13
- label_arr = [0; label_arr; 0]; % padding to find switches if the label starts or ends with high quality label!
14
-
15
- % Find switches from 0 to 1
16
- zero_one_switch = find(diff(label_arr) == 1);
17
-
18
- % Find switches from 1 to 0
19
- one_zero_switch = find(diff(label_arr) == -1);
20
-
21
- % Ensure the lengths are the same
22
- if length(zero_one_switch) ~= length(one_zero_switch)
23
- error('Invalid label array');
24
- end
25
-
26
- % Calculate switch lengths for label 1
27
- switch_lengths = one_zero_switch - zero_one_switch;
28
-
29
- % Find switch lengths greater than the threshold
30
- long_switches = find(switch_lengths >= threshold);
31
-
32
- % Assign start and end indices for long switches
33
- for i = 1:length(long_switches)
34
- start_idx(i) = zero_one_switch(long_switches(i));
35
- end_idx(i) = one_zero_switch(long_switches(i))-1;
36
- end
37
- end
@@ -1,23 +0,0 @@
1
- function [ppg_indices, imu_indices] = extract_overlapping_segments(t_unix_ppg, t_unix_imu)
2
- % K.I. Veldkamp, PhD student AI4P, 29-02-24
3
- % Function to extract indices indicating overlapping data between IMU and
4
- % PPG segment
5
-
6
- % Convert UNIX milliseconds to seconds
7
- ppg_time = t_unix_ppg / 1000; % Convert milliseconds to seconds
8
- imu_time = t_unix_imu / 1000; % Convert milliseconds to seconds
9
-
10
- % Determine the overlapping time interval
11
- start_time = max(ppg_time(1), imu_time(1));
12
- end_time = min(ppg_time(end), imu_time(end));
13
-
14
- % Convert overlapping time interval to indices
15
- ppg_start_index = find(ppg_time >= start_time, 1);
16
- ppg_end_index = find(ppg_time <= end_time, 1, 'last');
17
- imu_start_index = find(imu_time >= start_time, 1);
18
- imu_end_index = find(imu_time <= end_time, 1, 'last');
19
-
20
- % Extract overlapping segments
21
- ppg_indices = [ppg_start_index, ppg_end_index];
22
- imu_indices = [imu_start_index, imu_end_index];
23
- end
@@ -1,41 +0,0 @@
1
- The author of "jsonlab" toolbox is Qianqian Fang. Qianqian
2
- is currently an Assistant Professor at Massachusetts General Hospital,
3
- Harvard Medical School.
4
-
5
- Address: Martinos Center for Biomedical Imaging,
6
- Massachusetts General Hospital,
7
- Harvard Medical School
8
- Bldg 149, 13th St, Charlestown, MA 02129, USA
9
- URL: http://nmr.mgh.harvard.edu/~fangq/
10
- Email: <fangq at nmr.mgh.harvard.edu> or <fangqq at gmail.com>
11
-
12
-
13
- The script loadjson.m was built upon previous works by
14
-
15
- - Nedialko Krouchev: http://www.mathworks.com/matlabcentral/fileexchange/25713
16
- date: 2009/11/02
17
- - François Glineur: http://www.mathworks.com/matlabcentral/fileexchange/23393
18
- date: 2009/03/22
19
- - Joel Feenstra: http://www.mathworks.com/matlabcentral/fileexchange/20565
20
- date: 2008/07/03
21
-
22
-
23
- This toolbox contains patches submitted by the following contributors:
24
-
25
- - Blake Johnson <bjohnso at bbn.com>
26
- part of revision 341
27
-
28
- - Niclas Borlin <Niclas.Borlin at cs.umu.se>
29
- various fixes in revision 394, including
30
- - loadjson crashes for all-zero sparse matrix.
31
- - loadjson crashes for empty sparse matrix.
32
- - Non-zero size of 0-by-N and N-by-0 empty matrices is lost after savejson/loadjson.
33
- - loadjson crashes for sparse real column vector.
34
- - loadjson crashes for sparse complex column vector.
35
- - Data is corrupted by savejson for sparse real row vector.
36
- - savejson crashes for sparse complex row vector.
37
-
38
- - Yul Kang <yul.kang.on at gmail.com>
39
- patches for svn revision 415.
40
- - savejson saves an empty cell array as [] instead of null
41
- - loadjson differentiates an empty struct from an empty array
@@ -1,74 +0,0 @@
1
- ============================================================================
2
-
3
- JSONlab - a toolbox to encode/decode JSON/UBJSON files in MATLAB/Octave
4
-
5
- ----------------------------------------------------------------------------
6
-
7
- JSONlab ChangeLog (key features marked by *):
8
-
9
- == JSONlab 1.0 (codename: Optimus - Final), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
10
-
11
- 2015/01/02 polish help info for all major functions, update examples, finalize 1.0
12
- 2014/12/19 fix a bug to strictly respect NoRowBracket in savejson
13
-
14
- == JSONlab 1.0.0-RC2 (codename: Optimus - RC2), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
15
-
16
- 2014/11/22 show progress bar in loadjson ('ShowProgress')
17
- 2014/11/17 add Compact option in savejson to output compact JSON format ('Compact')
18
- 2014/11/17 add FastArrayParser in loadjson to specify fast parser applicable levels
19
- 2014/09/18 start official github mirror: https://github.com/fangq/jsonlab
20
-
21
- == JSONlab 1.0.0-RC1 (codename: Optimus - RC1), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
22
-
23
- 2014/09/17 fix several compatibility issues when running on octave versions 3.2-3.8
24
- 2014/09/17 support 2D cell and struct arrays in both savejson and saveubjson
25
- 2014/08/04 escape special characters in a JSON string
26
- 2014/02/16 fix a bug when saving ubjson files
27
-
28
- == JSONlab 0.9.9 (codename: Optimus - beta), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
29
-
30
- 2014/01/22 use binary read and write in saveubjson and loadubjson
31
-
32
- == JSONlab 0.9.8-1 (codename: Optimus - alpha update 1), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
33
-
34
- 2013/10/07 better round-trip conservation for empty arrays and structs (patch submitted by Yul Kang)
35
-
36
- == JSONlab 0.9.8 (codename: Optimus - alpha), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
37
- 2013/08/23 *universal Binary JSON (UBJSON) support, including both saveubjson and loadubjson
38
-
39
- == JSONlab 0.9.1 (codename: Rodimus, update 1), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
40
- 2012/12/18 *handling of various empty and sparse matrices (fixes submitted by Niclas Borlin)
41
-
42
- == JSONlab 0.9.0 (codename: Rodimus), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
43
-
44
- 2012/06/17 *new format for an invalid leading char, unpacking hex code in savejson
45
- 2012/06/01 support JSONP in savejson
46
- 2012/05/25 fix the empty cell bug (reported by Cyril Davin)
47
- 2012/04/05 savejson can save to a file (suggested by Patrick Rapin)
48
-
49
- == JSONlab 0.8.1 (codename: Sentiel, Update 1), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
50
-
51
- 2012/02/28 loadjson quotation mark escape bug, see http://bit.ly/yyk1nS
52
- 2012/01/25 patch to handle root-less objects, contributed by Blake Johnson
53
-
54
- == JSONlab 0.8.0 (codename: Sentiel), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
55
-
56
- 2012/01/13 *speed up loadjson by 20 fold when parsing large data arrays in matlab
57
- 2012/01/11 remove row bracket if an array has 1 element, suggested by Mykel Kochenderfer
58
- 2011/12/22 *accept sequence of 'param',value input in savejson and loadjson
59
- 2011/11/18 fix struct array bug reported by Mykel Kochenderfer
60
-
61
- == JSONlab 0.5.1 (codename: Nexus Update 1), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
62
-
63
- 2011/10/21 fix a bug in loadjson, previous code does not use any of the acceleration
64
- 2011/10/20 loadjson supports JSON collections - concatenated JSON objects
65
-
66
- == JSONlab 0.5.0 (codename: Nexus), FangQ <fangq (at) nmr.mgh.harvard.edu> ==
67
-
68
- 2011/10/16 package and release jsonlab 0.5.0
69
- 2011/10/15 *add json demo and regression test, support cpx numbers, fix double quote bug
70
- 2011/10/11 *speed up readjson dramatically, interpret _Array* tags, show data in root level
71
- 2011/10/10 create jsonlab project, start jsonlab website, add online documentation
72
- 2011/10/07 *speed up savejson by 25x using sprintf instead of mat2str, add options support
73
- 2011/10/06 *savejson works for structs, cells and arrays
74
- 2011/09/09 derive loadjson from JSON parser from MATLAB Central, draft savejson.m
@@ -1,25 +0,0 @@
1
- Copyright 2011-2015 Qianqian Fang <fangq at nmr.mgh.harvard.edu>. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without modification, are
4
- permitted provided that the following conditions are met:
5
-
6
- 1. Redistributions of source code must retain the above copyright notice, this list of
7
- conditions and the following disclaimer.
8
-
9
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
10
- of conditions and the following disclaimer in the documentation and/or other materials
11
- provided with the distribution.
12
-
13
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY EXPRESS OR IMPLIED
14
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
15
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
16
- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
-
23
- The views and conclusions contained in the software and documentation are those of the
24
- authors and should not be interpreted as representing official policies, either expressed
25
- or implied, of the copyright holders.