autogaita 1.0.6__tar.gz → 1.0.7__tar.gz
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.
- {autogaita-1.0.6 → autogaita-1.0.7}/PKG-INFO +1 -1
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/batchrun_scripts/group_dlcrun.py +21 -24
- autogaita-1.0.6/autogaita/batchrun_scripts/group_universal3Drun_backup.py → autogaita-1.0.7/autogaita/batchrun_scripts/group_universal3Drun.py +0 -2
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/common2D/common2D_3_analysis.py +9 -12
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/group_3_PCA.py +0 -2
- autogaita-1.0.7/autogaita/gui/group_gui_config.json +42 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/universal3D_gui_config.json +18 -21
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_3_analysis.py +29 -103
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita.egg-info/PKG-INFO +1 -1
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita.egg-info/SOURCES.txt +0 -2
- {autogaita-1.0.6 → autogaita-1.0.7}/setup.py +1 -1
- autogaita-1.0.6/autogaita/batchrun_scripts/group_dlcrun_forpaper.py +0 -151
- autogaita-1.0.6/autogaita/batchrun_scripts/group_universal3Drun.py +0 -139
- autogaita-1.0.6/autogaita/gui/group_gui_config.json +0 -121
- {autogaita-1.0.6 → autogaita-1.0.7}/LICENSE +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/README.md +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/__main__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/batchrun_scripts/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/batchrun_scripts/dlc_multirun.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/batchrun_scripts/dlc_singlerun.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/batchrun_scripts/sleap_singlerun.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/batchrun_scripts/universal3D_multirun.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/batchrun_scripts/universal3D_singlerun.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/common2D/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/common2D/common2D_4_plots.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/common2D/common2D_constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/common2D/common2D_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/dlc/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/dlc/dlc_1_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/dlc/dlc_2_sc_extraction.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/dlc/dlc_main.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/dlc/dlc_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/group_1_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/group_2_data_processing.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/group_4_stats.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/group_5_plots.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/group_constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/group_main.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/group/group_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/dlc_gui.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/dlc_gui_config.json +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/first_level_gui_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/gaita_widgets.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/group_gui.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/gui_constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/gui_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/main_gui.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/sleap_gui.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/sleap_gui_config.json +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/universal3D_gui.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/window_2D_advanced_config.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/window_2D_columninfo.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/gui/window_2D_run_and_done.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/resources/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/resources/constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/resources/icon.icns +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/resources/icon.ico +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/resources/logo.png +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/resources/pic_to_demo_for_repo.png +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/resources/utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/sleap/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/sleap/sleap_1_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/sleap/sleap_2_sc_extraction.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/sleap/sleap_main.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_1_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_2_sc_extraction.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_4_plots.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_datafile_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_main.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita.egg-info/dependency_links.txt +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita.egg-info/requires.txt +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/autogaita.egg-info/top_level.txt +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/setup.cfg +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/test_common2D_unit_3_main_analysis.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/test_dlc_approval.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/test_dlc_unit_1_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/test_dlc_unit_2_sc_extraction.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/test_group_approval.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/test_group_unit.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/test_universal3D_approval.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.7}/tests/test_universal3D_unit.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: autogaita
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: Automatic Gait Analysis in Python. A toolbox to streamline and standardise the analysis of kinematics across species after ML-based body posture tracking. Despite being optimised for gait analyses, AutoGaitA has the potential to be used for any kind of kinematic analysis.
|
|
5
5
|
Home-page: https://github.com/mahan-hosseini/AutoGaitA/
|
|
6
6
|
Author: Mahan Hosseini
|
|
@@ -42,20 +42,17 @@ def group_dlcrun():
|
|
|
42
42
|
"/Users/mahan/sciebo/PythonCode/gaita_repo/example data/25mm/Results/",
|
|
43
43
|
]
|
|
44
44
|
folderinfo["results_dir"] = (
|
|
45
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/
|
|
45
|
+
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/example_data_results/"
|
|
46
46
|
# "/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Sanity Test Interaction Graziana/Result 10 joints/Mahan Results/"
|
|
47
47
|
# "/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Testing/GroupResults/"
|
|
48
48
|
)
|
|
49
|
-
folderinfo["load_dir"] =
|
|
50
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/example_data_results/"
|
|
51
|
-
# ""
|
|
52
|
-
)
|
|
49
|
+
folderinfo["load_dir"] = ""
|
|
53
50
|
# cfg
|
|
54
51
|
cfg = {}
|
|
55
|
-
cfg["do_permtest"] = True
|
|
52
|
+
cfg["do_permtest"] = False # True
|
|
56
53
|
cfg["do_anova"] = True
|
|
57
54
|
cfg["permutation_number"] = 100
|
|
58
|
-
cfg["PCA_n_components"] =
|
|
55
|
+
cfg["PCA_n_components"] = 6
|
|
59
56
|
# cfg["PCA_n_components"] = 0.33
|
|
60
57
|
# cfg["PCA_custom_scatter_PCs"] = "4,5,6;4,5;2,4,6"
|
|
61
58
|
cfg["PCA_custom_scatter_PCs"] = ""
|
|
@@ -71,23 +68,7 @@ def group_dlcrun():
|
|
|
71
68
|
# cfg["anova_design"] = "Mixed ANOVA"
|
|
72
69
|
cfg["permutation_number"] = 100
|
|
73
70
|
cfg["PCA_variables"] = [
|
|
74
|
-
"Hind paw tao y",
|
|
75
|
-
"Ankle y",
|
|
76
|
-
"Knee y",
|
|
77
|
-
"Ankle Angle",
|
|
78
|
-
"Knee Angle",
|
|
79
|
-
"Nose x",
|
|
80
|
-
"Knee y",
|
|
81
|
-
"Knee x",
|
|
82
|
-
"Knee Velocity",
|
|
83
|
-
"Knee Acceleration",
|
|
84
|
-
"Knee Angle",
|
|
85
|
-
"Knee Angle Velocity",
|
|
86
|
-
"Knee Angle Acceleration",
|
|
87
|
-
"Hip Angle",
|
|
88
|
-
]
|
|
89
|
-
cfg["stats_variables"] = [
|
|
90
|
-
"Hind paw tao y",
|
|
71
|
+
# "Hind paw tao y",
|
|
91
72
|
# "Ankle y",
|
|
92
73
|
# "Knee y",
|
|
93
74
|
# "Ankle Angle",
|
|
@@ -101,6 +82,22 @@ def group_dlcrun():
|
|
|
101
82
|
# "Knee Angle Velocity",
|
|
102
83
|
# "Knee Angle Acceleration",
|
|
103
84
|
# "Hip Angle",
|
|
85
|
+
]
|
|
86
|
+
cfg["stats_variables"] = [
|
|
87
|
+
"Hind paw tao y",
|
|
88
|
+
# "Ankle y",
|
|
89
|
+
"Knee y",
|
|
90
|
+
# "Ankle Angle",
|
|
91
|
+
"Knee Angle",
|
|
92
|
+
# "Nose x",
|
|
93
|
+
# "Knee y",
|
|
94
|
+
"Knee x",
|
|
95
|
+
# "Knee Velocity",
|
|
96
|
+
# "Knee Acceleration",
|
|
97
|
+
# "Knee Angle",
|
|
98
|
+
# "Knee Angle Velocity",
|
|
99
|
+
# "Knee Angle Acceleration",
|
|
100
|
+
# "Hip Angle",
|
|
104
101
|
# "Elbow Angle"
|
|
105
102
|
]
|
|
106
103
|
# run
|
|
@@ -29,8 +29,6 @@ def group_universal3Drun():
|
|
|
29
29
|
cfg["do_anova"] = True
|
|
30
30
|
cfg["permutation_number"] = 10
|
|
31
31
|
cfg["PCA_n_components"] = 3
|
|
32
|
-
cfg["PCA_custom_scatter_PCs"] = ""
|
|
33
|
-
cfg["PCA_bins"] = ""
|
|
34
32
|
cfg["PCA_save_3D_video"] = False
|
|
35
33
|
cfg["stats_threshold"] = 0.05
|
|
36
34
|
cfg["plot_SE"] = False
|
|
@@ -63,9 +63,6 @@ def analyse_and_export_stepcycles(data, all_cycles, info, cfg):
|
|
|
63
63
|
# 2 or more steps - build dataframe
|
|
64
64
|
elif len(all_cycles) > 1:
|
|
65
65
|
# first- step is added manually
|
|
66
|
-
# NOTE
|
|
67
|
-
# ----
|
|
68
|
-
# normalised_steps_data is created using x_standardised_steps_data or first_step
|
|
69
66
|
first_step = data_copy.loc[all_cycles[0][0] : all_cycles[0][1]]
|
|
70
67
|
if standardise_x_coordinates:
|
|
71
68
|
all_steps_data, x_standardised_steps_data = (
|
|
@@ -184,20 +181,20 @@ def standardise_x_y_and_add_features_to_one_step(step, cfg):
|
|
|
184
181
|
step_copy[y_cols] -= this_y_min
|
|
185
182
|
# if no x-standardisation, just add features & return non-(x-)normalised step
|
|
186
183
|
if cfg["standardise_x_coordinates"] is False:
|
|
187
|
-
|
|
188
|
-
return
|
|
184
|
+
non_norm_step = add_features(step_copy, cfg)
|
|
185
|
+
return non_norm_step
|
|
189
186
|
# else standardise x (horizontal dimension) at step-cycle level too
|
|
190
187
|
else:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
x_cols = [col for col in
|
|
188
|
+
non_norm_step = add_features(step_copy, cfg)
|
|
189
|
+
x_norm_step = step_copy.copy()
|
|
190
|
+
x_cols = [col for col in x_norm_step.columns if col.endswith("x")]
|
|
194
191
|
# note the [0] here is important because it's still a list of len=1!!
|
|
195
|
-
min_x_standardisation_joint =
|
|
192
|
+
min_x_standardisation_joint = x_norm_step[
|
|
196
193
|
cfg["x_standardisation_joint"][0] + "x"
|
|
197
194
|
].min()
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return
|
|
195
|
+
x_norm_step[x_cols] -= min_x_standardisation_joint
|
|
196
|
+
x_norm_step = add_features(x_norm_step, cfg)
|
|
197
|
+
return non_norm_step, x_norm_step
|
|
201
198
|
|
|
202
199
|
|
|
203
200
|
def add_features(step, cfg):
|
|
@@ -218,8 +218,6 @@ def run_PCA(PCA_df, features, cfg):
|
|
|
218
218
|
# excel files)
|
|
219
219
|
x = pd.DataFrame(x, columns=features)
|
|
220
220
|
# NOTE that this next line changes the PCA_model variable!
|
|
221
|
-
# pdb.set_trace()
|
|
222
|
-
x.fillna(0, inplace=True)
|
|
223
221
|
PCs = PCA_model.fit_transform(x)
|
|
224
222
|
# NOTE! we use number_of_PCs from here onwards (in info/plots/etc) to differentiate
|
|
225
223
|
# between n_components which can be smaller than 1!
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"group_names": [
|
|
4
|
+
"",
|
|
5
|
+
"",
|
|
6
|
+
"",
|
|
7
|
+
"",
|
|
8
|
+
"",
|
|
9
|
+
""
|
|
10
|
+
],
|
|
11
|
+
"group_dirs": [
|
|
12
|
+
"",
|
|
13
|
+
"",
|
|
14
|
+
"",
|
|
15
|
+
"",
|
|
16
|
+
"",
|
|
17
|
+
""
|
|
18
|
+
],
|
|
19
|
+
"results_dir": "",
|
|
20
|
+
"load_dir": ""
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"do_permtest": true,
|
|
24
|
+
"do_anova": false,
|
|
25
|
+
"anova_design": "RM ANOVA",
|
|
26
|
+
"permutation_number": "10000",
|
|
27
|
+
"stats_threshold": "0.05",
|
|
28
|
+
"which_leg": "right",
|
|
29
|
+
"PCA_n_components": "3",
|
|
30
|
+
"PCA_custom_scatter_PCs": "",
|
|
31
|
+
"PCA_save_3D_video": false,
|
|
32
|
+
"PCA_bins": "",
|
|
33
|
+
"plot_SE": false,
|
|
34
|
+
"color_palette": "Set2",
|
|
35
|
+
"dont_show_plots": false,
|
|
36
|
+
"legend_outside": true,
|
|
37
|
+
"stats_variables": [
|
|
38
|
+
],
|
|
39
|
+
"PCA_variables": [
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "",
|
|
4
|
-
"root_dir": "
|
|
5
|
-
"sctable_filename": "
|
|
6
|
-
"postname_flag":
|
|
7
|
-
"postname_string": "
|
|
4
|
+
"root_dir": "",
|
|
5
|
+
"sctable_filename": "",
|
|
6
|
+
"postname_flag": false,
|
|
7
|
+
"postname_string": ""
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"analyse_singlerun": false,
|
|
11
|
-
"sampling_rate": "
|
|
12
|
-
"dont_show_plots":
|
|
11
|
+
"sampling_rate": "",
|
|
12
|
+
"dont_show_plots": false,
|
|
13
13
|
"y_acceleration": true,
|
|
14
14
|
"angular_acceleration": true,
|
|
15
15
|
"bin_num": "25",
|
|
@@ -30,37 +30,34 @@
|
|
|
30
30
|
"legend_outside": true,
|
|
31
31
|
"results_dir": "",
|
|
32
32
|
"joints": [
|
|
33
|
-
"
|
|
33
|
+
"Midfoot",
|
|
34
34
|
"Ankle ",
|
|
35
35
|
"Knee ",
|
|
36
36
|
"Hip ",
|
|
37
|
-
"Pelvis "
|
|
38
|
-
"Shoulder",
|
|
39
|
-
"Head"
|
|
37
|
+
"Pelvis "
|
|
40
38
|
],
|
|
41
39
|
"angles": {
|
|
42
40
|
"name": [
|
|
43
41
|
"Ankle",
|
|
44
42
|
"Knee",
|
|
45
|
-
"
|
|
43
|
+
"Hip"
|
|
46
44
|
],
|
|
47
45
|
"lower_joint": [
|
|
48
|
-
"
|
|
46
|
+
"Midfoot",
|
|
49
47
|
"Ankle",
|
|
50
|
-
"
|
|
48
|
+
"Knee"
|
|
51
49
|
],
|
|
52
50
|
"upper_joint": [
|
|
53
51
|
"Knee",
|
|
54
52
|
"Hip",
|
|
55
|
-
"
|
|
53
|
+
"Pelvis"
|
|
56
54
|
]
|
|
57
55
|
},
|
|
58
|
-
"fileprep_root_dir": "
|
|
59
|
-
"fileprep_filetype": "
|
|
60
|
-
"fileprep_postname_string": "
|
|
61
|
-
"fileprep_results_dir": "
|
|
62
|
-
"fileprep_separator": "
|
|
63
|
-
"fileprep_string_to_remove": ""
|
|
64
|
-
"fileprep_3D_DLC": false
|
|
56
|
+
"fileprep_root_dir": "",
|
|
57
|
+
"fileprep_filetype": "",
|
|
58
|
+
"fileprep_postname_string": "",
|
|
59
|
+
"fileprep_results_dir": "",
|
|
60
|
+
"fileprep_separator": "",
|
|
61
|
+
"fileprep_string_to_remove": ""
|
|
65
62
|
}
|
|
66
63
|
]
|
|
@@ -35,7 +35,7 @@ from autogaita.universal3D.universal3D_constants import (
|
|
|
35
35
|
# 3) we then we flip y columns if needed (to simulate equal walking direction)
|
|
36
36
|
# 4) immediately after 3 & 4 and for each step's data separately, we compute and add
|
|
37
37
|
# features (angles, velocities, accelerations)
|
|
38
|
-
# ==> see
|
|
38
|
+
# ==> see norm_z_flip_y_and_add_features_to_one_step & helper functions a
|
|
39
39
|
# 5) immediately after adding features, we normalise a step to bin_num
|
|
40
40
|
# ==> see normalise_one_steps_data & helper functions b
|
|
41
41
|
# 6) we add original and normalised steps to all_steps_data and normalised_steps_data
|
|
@@ -56,7 +56,6 @@ def analyse_and_export_stepcycles(data, all_cycles, global_Y_max, info, cfg):
|
|
|
56
56
|
results_dir = info["results_dir"]
|
|
57
57
|
bin_num = cfg["bin_num"]
|
|
58
58
|
analyse_average_y = cfg["analyse_average_y"]
|
|
59
|
-
standardise_y_coordinates = cfg["standardise_y_coordinates"]
|
|
60
59
|
# do everything on a copy of the data df
|
|
61
60
|
data_copy = data.copy()
|
|
62
61
|
# for exports, we don't need all_cycles to be separated for runs
|
|
@@ -66,7 +65,6 @@ def analyse_and_export_stepcycles(data, all_cycles, global_Y_max, info, cfg):
|
|
|
66
65
|
delete_previous_xlsfiles(name, results_dir)
|
|
67
66
|
# initialise list of dfs & results
|
|
68
67
|
all_steps_data = [pd.DataFrame(data=None)] * len(OUTPUTS)
|
|
69
|
-
y_standardised_steps_data = [pd.DataFrame(data=None)] * len(OUTPUTS)
|
|
70
68
|
normalised_steps_data = [pd.DataFrame(data=None)] * len(OUTPUTS)
|
|
71
69
|
average_data = [pd.DataFrame(data=None)] * len(OUTPUTS)
|
|
72
70
|
std_data = [pd.DataFrame(data=None)] * len(OUTPUTS)
|
|
@@ -75,74 +73,38 @@ def analyse_and_export_stepcycles(data, all_cycles, global_Y_max, info, cfg):
|
|
|
75
73
|
# ................. loop over legs and populate dfs ..............................
|
|
76
74
|
# for each step:
|
|
77
75
|
# 1) extract it from data_copy (this_step)
|
|
78
|
-
# 2) normalise
|
|
79
|
-
# 3)
|
|
80
|
-
# 4)
|
|
81
|
-
#
|
|
82
|
-
# 6) normalise its length to bin_num (this_normalised_step)
|
|
83
|
-
# 7) add this_step to all_steps_data, this_normalised_step to
|
|
84
|
-
# normalised_steps_data and this_x_standardised_step to x_standardised_steps_data
|
|
76
|
+
# 2) normalise Z if wanted, flip y columns if needed and add features
|
|
77
|
+
# 3) normalise its length to bin_num (this_normalised_step)
|
|
78
|
+
# 4) add this_step to all_steps_data and this_normalised_step to
|
|
79
|
+
# normalised_steps_data
|
|
85
80
|
for l_idx, legname in enumerate(LEGS):
|
|
86
81
|
# 1 step only (highly unlikely in humans)
|
|
87
82
|
if len(all_cycles[legname]) == 1:
|
|
88
83
|
this_step = data_copy.loc[
|
|
89
84
|
all_cycles[legname][0][0] : all_cycles[legname][0][1]
|
|
90
85
|
]
|
|
91
|
-
|
|
92
|
-
this_step,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
)
|
|
97
|
-
all_steps_data[l_idx] = this_step
|
|
98
|
-
y_standardised_steps_data[l_idx] = y_standardised_step
|
|
99
|
-
normalised_steps_data[l_idx] = normalise_one_steps_data(
|
|
100
|
-
y_standardised_step, bin_num
|
|
101
|
-
)
|
|
102
|
-
else:
|
|
103
|
-
this_step = standardise_y_z_and_add_features_to_one_step(
|
|
104
|
-
this_step, global_Y_max, cfg
|
|
105
|
-
)
|
|
106
|
-
all_steps_data[l_idx] = this_step
|
|
107
|
-
normalised_steps_data[l_idx] = normalise_one_steps_data(
|
|
108
|
-
this_step, bin_num
|
|
109
|
-
)
|
|
86
|
+
this_step = norm_z_flip_y_and_add_features_to_one_step(
|
|
87
|
+
this_step, global_Y_max, cfg
|
|
88
|
+
)
|
|
89
|
+
all_steps_data[l_idx] = this_step
|
|
90
|
+
normalised_steps_data[l_idx] = normalise_one_steps_data(this_step, bin_num)
|
|
110
91
|
sc_num[l_idx] = 1
|
|
111
92
|
# 2 or more steps - build dataframes
|
|
112
93
|
elif len(all_cycles[legname]) > 1:
|
|
113
94
|
# first step is added manually
|
|
114
|
-
# NOTE
|
|
115
|
-
# ----
|
|
116
|
-
# normalised_steps_data is created using y_standardised_step or first_step
|
|
117
95
|
first_step = data_copy.loc[
|
|
118
96
|
all_cycles[legname][0][0] : all_cycles[legname][0][1]
|
|
119
97
|
]
|
|
120
|
-
|
|
121
|
-
first_step,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
)
|
|
126
|
-
all_steps_data[l_idx] = first_step
|
|
127
|
-
normalised_steps_data[l_idx] = normalise_one_steps_data(
|
|
128
|
-
y_standardised_first_step, bin_num
|
|
129
|
-
)
|
|
130
|
-
else:
|
|
131
|
-
first_step = standardise_y_z_and_add_features_to_one_step(
|
|
132
|
-
first_step, global_Y_max, cfg
|
|
133
|
-
)
|
|
134
|
-
all_steps_data[l_idx] = first_step
|
|
135
|
-
normalised_steps_data[l_idx] = normalise_one_steps_data(
|
|
136
|
-
first_step, bin_num
|
|
137
|
-
)
|
|
98
|
+
first_step = norm_z_flip_y_and_add_features_to_one_step(
|
|
99
|
+
first_step, global_Y_max, cfg
|
|
100
|
+
)
|
|
101
|
+
all_steps_data[l_idx] = first_step
|
|
102
|
+
normalised_steps_data[l_idx] = normalise_one_steps_data(first_step, bin_num)
|
|
138
103
|
# some prep for addition of further steps
|
|
139
104
|
sc_num[l_idx] = len(all_cycles[legname])
|
|
140
105
|
nanvector = data_copy.loc[[SEPARATOR_IDX]]
|
|
141
106
|
nanvector[:] = np.nan
|
|
142
107
|
# ............................. step-loop ................................
|
|
143
|
-
|
|
144
|
-
# STOPPED IMPLEMENTING Y-STANDARDISATION HERE
|
|
145
|
-
|
|
146
108
|
for s in range(1, sc_num[l_idx], 1):
|
|
147
109
|
# get step separators
|
|
148
110
|
numvector = data_copy.loc[[SEPARATOR_IDX]]
|
|
@@ -154,7 +116,7 @@ def analyse_and_export_stepcycles(data, all_cycles, global_Y_max, info, cfg):
|
|
|
154
116
|
this_step = data_copy.loc[
|
|
155
117
|
all_cycles[legname][s][0] : all_cycles[legname][s][1]
|
|
156
118
|
]
|
|
157
|
-
this_step =
|
|
119
|
+
this_step = norm_z_flip_y_and_add_features_to_one_step(
|
|
158
120
|
this_step, global_Y_max, cfg
|
|
159
121
|
)
|
|
160
122
|
all_steps_data[l_idx] = pd.concat(
|
|
@@ -264,15 +226,15 @@ def analyse_and_export_stepcycles(data, all_cycles, global_Y_max, info, cfg):
|
|
|
264
226
|
# ......................................................................................
|
|
265
227
|
|
|
266
228
|
|
|
267
|
-
def
|
|
268
|
-
"""For a single step cycle's data,
|
|
229
|
+
def norm_z_flip_y_and_add_features_to_one_step(step, global_Y_max, cfg):
|
|
230
|
+
"""For a single step cycle's data, normalise z if wanted, flip y columns if needed
|
|
231
|
+
(to simulate equal run direction) and add features (angles & velocities)
|
|
232
|
+
"""
|
|
269
233
|
# unpack
|
|
270
234
|
standardise_z_at_SC_level = cfg["standardise_z_at_SC_level"]
|
|
271
235
|
standardise_z_to_a_joint = cfg["standardise_z_to_a_joint"]
|
|
272
236
|
z_standardisation_joint = cfg["z_standardisation_joint"]
|
|
273
237
|
flip_gait_direction = cfg["flip_gait_direction"]
|
|
274
|
-
standardise_y_coordinates = cfg["standardise_y_coordinates"]
|
|
275
|
-
y_standardisation_joint = cfg["y_standardisation_joint"]
|
|
276
238
|
direction_joint = cfg["direction_joint"]
|
|
277
239
|
# if user wanted this, normalise z (height) at step-cycle level
|
|
278
240
|
step_copy = step.copy()
|
|
@@ -284,51 +246,15 @@ def standardise_y_z_and_add_features_to_one_step(step, global_Y_max, cfg):
|
|
|
284
246
|
else:
|
|
285
247
|
z_minimum = min(step_copy[z_cols].min())
|
|
286
248
|
step_copy[z_cols] -= z_minimum
|
|
287
|
-
#
|
|
288
|
-
if
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
# user wanted y-standardisation, make sure that we do this before gait flipping!
|
|
298
|
-
# => i.e. flip gait direction and add features for both, non_stand & y_stand steps
|
|
299
|
-
# IMPORTANT
|
|
300
|
-
# ---------
|
|
301
|
-
# Y-standardising to the MINIMUM of the chosen joint is correct because of flipping
|
|
302
|
-
# y columns in flip_a_steps_gait_direction if the first idx of the step's direction
|
|
303
|
-
# joint is higher than its average value
|
|
304
|
-
# therefore y is always increasing as the step progresses and thus it is correct
|
|
305
|
-
# that we standardise to the minimum via subtraction as we do here
|
|
306
|
-
else:
|
|
307
|
-
non_stand_step = step_copy.copy()
|
|
308
|
-
y_stand_step = step_copy.copy()
|
|
309
|
-
y_cols = [col for col in y_stand_step.columns if col.endswith("Y")]
|
|
310
|
-
# note the [0] here is important because it's still a list of len=1!
|
|
311
|
-
y_minimum = y_stand_step[y_standardisation_joint[0] + "Y"].min()
|
|
312
|
-
y_stand_step[y_cols] -= y_minimum
|
|
313
|
-
if flip_gait_direction:
|
|
314
|
-
non_stand_step = flip_a_steps_gait_direction(
|
|
315
|
-
non_stand_step, direction_joint, global_Y_max
|
|
316
|
-
)
|
|
317
|
-
y_stand_step = flip_a_steps_gait_direction(
|
|
318
|
-
y_stand_step, direction_joint, global_Y_max
|
|
319
|
-
)
|
|
320
|
-
non_stand_step = add_features(non_stand_step, cfg)
|
|
321
|
-
y_stand_step = add_features(y_stand_step, cfg)
|
|
322
|
-
return non_stand_step, y_stand_step
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
def flip_a_steps_gait_direction(step, direction_joint, global_Y_max):
|
|
326
|
-
"""Flip a step's y cols checking if needed with direction joint"""
|
|
327
|
-
direction_joint_col_idx = step.columns.get_loc(direction_joint)
|
|
328
|
-
direction_joint_mean = np.mean(step[direction_joint])
|
|
329
|
-
if step.iloc[0, direction_joint_col_idx] > direction_joint_mean:
|
|
330
|
-
step = flip_y_columns(step, global_Y_max)
|
|
331
|
-
return step
|
|
249
|
+
# if user wanted flipping & if we need to flip y cols of this given step do so
|
|
250
|
+
if flip_gait_direction:
|
|
251
|
+
direction_joint_col_idx = step_copy.columns.get_loc(direction_joint)
|
|
252
|
+
direction_joint_mean = np.mean(step_copy[direction_joint])
|
|
253
|
+
if step_copy.iloc[0, direction_joint_col_idx] > direction_joint_mean:
|
|
254
|
+
step_copy = flip_y_columns(step_copy, global_Y_max)
|
|
255
|
+
# add angles and velocities
|
|
256
|
+
step_copy = add_features(step_copy, cfg)
|
|
257
|
+
return step_copy
|
|
332
258
|
|
|
333
259
|
|
|
334
260
|
def flip_y_columns(step, global_Y_max):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: autogaita
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: Automatic Gait Analysis in Python. A toolbox to streamline and standardise the analysis of kinematics across species after ML-based body posture tracking. Despite being optimised for gait analyses, AutoGaitA has the potential to be used for any kind of kinematic analysis.
|
|
5
5
|
Home-page: https://github.com/mahan-hosseini/AutoGaitA/
|
|
6
6
|
Author: Mahan Hosseini
|
|
@@ -12,9 +12,7 @@ autogaita/batchrun_scripts/__init__.py
|
|
|
12
12
|
autogaita/batchrun_scripts/dlc_multirun.py
|
|
13
13
|
autogaita/batchrun_scripts/dlc_singlerun.py
|
|
14
14
|
autogaita/batchrun_scripts/group_dlcrun.py
|
|
15
|
-
autogaita/batchrun_scripts/group_dlcrun_forpaper.py
|
|
16
15
|
autogaita/batchrun_scripts/group_universal3Drun.py
|
|
17
|
-
autogaita/batchrun_scripts/group_universal3Drun_backup.py
|
|
18
16
|
autogaita/batchrun_scripts/sleap_singlerun.py
|
|
19
17
|
autogaita/batchrun_scripts/universal3D_multirun.py
|
|
20
18
|
autogaita/batchrun_scripts/universal3D_singlerun.py
|
|
@@ -26,7 +26,7 @@ if platform.system() == "Darwin":
|
|
|
26
26
|
setup(
|
|
27
27
|
name="autogaita",
|
|
28
28
|
python_requires=">=3.10",
|
|
29
|
-
version="1.0.
|
|
29
|
+
version="1.0.7", # rc == release candidate (before release is finished)
|
|
30
30
|
author="Mahan Hosseini",
|
|
31
31
|
description="Automatic Gait Analysis in Python. A toolbox to streamline and standardise the analysis of kinematics across species after ML-based body posture tracking. Despite being optimised for gait analyses, AutoGaitA has the potential to be used for any kind of kinematic analysis.",
|
|
32
32
|
packages=find_packages(),
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import autogaita
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def group_dlcrun():
|
|
5
|
-
"""
|
|
6
|
-
Batchrun script to run AutoGaitA Group for Results obtained with AutoGaitA DLC.
|
|
7
|
-
folderinfo & cfg dictionaries must be configured as explained in our documentation. See the "AutoGaitA without the GUI" section of our documentation for references to in-depth explanations to all dictionary keys (note that each key of dicts corresponds to some object in the AutoGaitA Group GUI)
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
# ----------------------------- 3 Months 3 Beams --------------------------------
|
|
11
|
-
# folderinfo = {}
|
|
12
|
-
# folderinfo["group_names"] = [
|
|
13
|
-
# # RM Dataset
|
|
14
|
-
# "3m_5mm",
|
|
15
|
-
# "3m_12mm",
|
|
16
|
-
# "3m_25mm",
|
|
17
|
-
# ]
|
|
18
|
-
# folderinfo["group_dirs"] = [
|
|
19
|
-
# "/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/5mm/9w/",
|
|
20
|
-
# "/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/12mm/9w/",
|
|
21
|
-
# "/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/25mm/9w/",
|
|
22
|
-
# ]
|
|
23
|
-
# folderinfo["results_dir"] = (
|
|
24
|
-
# "/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/3Months3BeamsForPaper"
|
|
25
|
-
|
|
26
|
-
# ----------------------------- Old Young 3 Beams --------------------------------
|
|
27
|
-
folderinfo = {}
|
|
28
|
-
folderinfo["group_names"] = [
|
|
29
|
-
# RM Dataset
|
|
30
|
-
"3m_5mm",
|
|
31
|
-
"3m_12mm",
|
|
32
|
-
"3m_25mm",
|
|
33
|
-
"24m_5mm",
|
|
34
|
-
"24m_12mm",
|
|
35
|
-
"24m_25mm",
|
|
36
|
-
]
|
|
37
|
-
folderinfo["group_dirs"] = [
|
|
38
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/5mm/9w/",
|
|
39
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/12mm/9w/",
|
|
40
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/25mm/9w/",
|
|
41
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/5mm/104w/",
|
|
42
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/12mm/104w/",
|
|
43
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/255mm/104w/",
|
|
44
|
-
]
|
|
45
|
-
folderinfo["results_dir"] = (
|
|
46
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Mouse/Full Dataset and Results Nov 2024/YoungOld3BeamsForPaper_v2"
|
|
47
|
-
)
|
|
48
|
-
folderinfo["load_dir"] = ""
|
|
49
|
-
|
|
50
|
-
# cfg
|
|
51
|
-
cfg = {}
|
|
52
|
-
cfg["do_permtest"] = False
|
|
53
|
-
cfg["do_anova"] = True
|
|
54
|
-
cfg["permutation_number"] = 10000
|
|
55
|
-
cfg["PCA_n_components"] = 3
|
|
56
|
-
# cfg["PCA_n_components"] = 0.33
|
|
57
|
-
# cfg["PCA_custom_scatter_PCs"] = "4,5,6;4,5;2,4,6"
|
|
58
|
-
cfg["PCA_custom_scatter_PCs"] = ""
|
|
59
|
-
cfg["PCA_save_3D_video"] = False # True
|
|
60
|
-
cfg["PCA_bins"] = "" # "0-10,24,50-75"
|
|
61
|
-
cfg["stats_threshold"] = 0.05
|
|
62
|
-
cfg["plot_SE"] = True
|
|
63
|
-
cfg["color_palette"] = "Set2"
|
|
64
|
-
cfg["dont_show_plots"] = True
|
|
65
|
-
cfg["legend_outside"] = True
|
|
66
|
-
cfg["which_leg"] = "left"
|
|
67
|
-
cfg["anova_design"] = "RM ANOVA"
|
|
68
|
-
cfg["PCA_variables"] = [
|
|
69
|
-
"Nose x",
|
|
70
|
-
"Nose y",
|
|
71
|
-
"Ear base x",
|
|
72
|
-
"Ear base y",
|
|
73
|
-
"Front paw tao x",
|
|
74
|
-
"Front paw tao y",
|
|
75
|
-
"Wrist x",
|
|
76
|
-
"Wrist y",
|
|
77
|
-
"Elbow x",
|
|
78
|
-
"Elbow y",
|
|
79
|
-
"Lower Shoulder x",
|
|
80
|
-
"Lower Shoulder y",
|
|
81
|
-
"Upper Shoulder x",
|
|
82
|
-
"Upper Shoulder y",
|
|
83
|
-
"Iliac Crest x",
|
|
84
|
-
"Iliac Crest y",
|
|
85
|
-
"Hip x",
|
|
86
|
-
"Hip y",
|
|
87
|
-
"Knee x",
|
|
88
|
-
"Knee y",
|
|
89
|
-
"Ankle x",
|
|
90
|
-
"Ankle y",
|
|
91
|
-
"Hind paw tao x",
|
|
92
|
-
"Hind paw tao y",
|
|
93
|
-
"Tail base y",
|
|
94
|
-
"Tail center x",
|
|
95
|
-
"Tail center y",
|
|
96
|
-
"Tail tip x",
|
|
97
|
-
"Tail tip y",
|
|
98
|
-
"Hind paw tao Velocity",
|
|
99
|
-
"Hind paw tao Acceleration",
|
|
100
|
-
"Ankle Velocity",
|
|
101
|
-
"Ankle Acceleration",
|
|
102
|
-
"Knee Velocity",
|
|
103
|
-
"Knee Acceleration",
|
|
104
|
-
"Hip Velocity",
|
|
105
|
-
"Hip Acceleration",
|
|
106
|
-
"Iliac Crest Velocity",
|
|
107
|
-
"Iliac Crest Acceleration",
|
|
108
|
-
"Ankle Angle",
|
|
109
|
-
"Knee Angle",
|
|
110
|
-
"Hip Angle",
|
|
111
|
-
"Wrist Angle",
|
|
112
|
-
"Elbow Angle",
|
|
113
|
-
"Lower Shoulder Angle",
|
|
114
|
-
"Iliac Crest Angle",
|
|
115
|
-
"Ankle Angle Velocity",
|
|
116
|
-
"Ankle Angle Acceleration",
|
|
117
|
-
"Knee Angle Acceleration",
|
|
118
|
-
"Hip Angle Velocity",
|
|
119
|
-
"Hip Angle Acceleration",
|
|
120
|
-
"Wrist Angle Velocity",
|
|
121
|
-
"Wrist Angle Acceleration",
|
|
122
|
-
"Elbow Angle Velocity",
|
|
123
|
-
"Elbow Angle Acceleration",
|
|
124
|
-
"Lower Shoulder Angle Velocity",
|
|
125
|
-
"Lower Shoulder Angle Acceleration",
|
|
126
|
-
"Iliac Crest Angle Velocity",
|
|
127
|
-
"Iliac Crest Angle Acceleration",
|
|
128
|
-
]
|
|
129
|
-
cfg["stats_variables"] = [
|
|
130
|
-
"Hip x",
|
|
131
|
-
"Hip y",
|
|
132
|
-
"Knee x",
|
|
133
|
-
"Knee y",
|
|
134
|
-
"Ankle x",
|
|
135
|
-
"Ankle y",
|
|
136
|
-
"Hind paw tao x",
|
|
137
|
-
"Hind paw tao y",
|
|
138
|
-
"Hind paw tao Velocity",
|
|
139
|
-
"Ankle Velocity",
|
|
140
|
-
"Knee Velocity",
|
|
141
|
-
"Ankle Angle",
|
|
142
|
-
"Knee Angle",
|
|
143
|
-
"Hip Angle",
|
|
144
|
-
]
|
|
145
|
-
# run
|
|
146
|
-
autogaita.group(folderinfo, cfg)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
# %% what happens if we just hit run
|
|
150
|
-
if __name__ == "__main__":
|
|
151
|
-
group_dlcrun()
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import autogaita
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def group_universal3Drun():
|
|
5
|
-
"""
|
|
6
|
-
Batchrun script to run AutoGaitA Group for Results obtained with AutoGaitA Universal 3D.
|
|
7
|
-
folderinfo & cfg dictionaries must be configured as explained in our documentation. See the "AutoGaitA without the GUI" section of our documentation for references to in-depth explanations to all dictionary keys (note that each key of dicts corresponds to some object in the AutoGaitA Group GUI)
|
|
8
|
-
"""
|
|
9
|
-
# loop over legs - currently no option to do both legs in a single run
|
|
10
|
-
cfg = {}
|
|
11
|
-
# folderinfo
|
|
12
|
-
# => Note that length of folderinfo's group_names & group_dirs lists determines # how many groups are compared.
|
|
13
|
-
# => Also note that indices must correspond (i.e., idx # 1's name will be # used for dataset stored in group_dir's idx 1)
|
|
14
|
-
folderinfo = {}
|
|
15
|
-
folderinfo["group_names"] = [
|
|
16
|
-
"crawling",
|
|
17
|
-
"sideways",
|
|
18
|
-
"walking",
|
|
19
|
-
"jogging",
|
|
20
|
-
"jumping_jack",
|
|
21
|
-
"vertical_jumping",
|
|
22
|
-
]
|
|
23
|
-
folderinfo["group_dirs"] = [
|
|
24
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/crawling/Results/",
|
|
25
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/sideways/Results/",
|
|
26
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/walking/Results/",
|
|
27
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/jogging/Results/",
|
|
28
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/jumping_jack/Results/",
|
|
29
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/vertical_jumping/Results/",
|
|
30
|
-
]
|
|
31
|
-
folderinfo["results_dir"] = (
|
|
32
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/group/"
|
|
33
|
-
)
|
|
34
|
-
folderinfo["load_dir"] = ""
|
|
35
|
-
# cfg
|
|
36
|
-
cfg["do_permtest"] = True
|
|
37
|
-
cfg["do_anova"] = True
|
|
38
|
-
cfg["permutation_number"] = 10000
|
|
39
|
-
cfg["PCA_n_components"] = 10
|
|
40
|
-
cfg["PCA_custom_scatter_PCs"] = ""
|
|
41
|
-
cfg["PCA_save_3D_video"] = True
|
|
42
|
-
cfg["PCA_bins"] = ""
|
|
43
|
-
cfg["stats_threshold"] = 0.05
|
|
44
|
-
cfg["plot_SE"] = False
|
|
45
|
-
cfg["color_palette"] = "Set2"
|
|
46
|
-
cfg["legend_outside"] = True
|
|
47
|
-
cfg["dont_show_plots"] = True
|
|
48
|
-
cfg["anova_design"] = "Mixed ANOVA"
|
|
49
|
-
cfg["which_leg"] = "right"
|
|
50
|
-
cfg["PCA_variables"] = [
|
|
51
|
-
"Head Y",
|
|
52
|
-
"Head Z",
|
|
53
|
-
"Hip Y",
|
|
54
|
-
"Hip Z",
|
|
55
|
-
"Pelvis Y",
|
|
56
|
-
"Pelvis Z",
|
|
57
|
-
"Thorax Y",
|
|
58
|
-
"Thorax Z",
|
|
59
|
-
"Ankle, left Y",
|
|
60
|
-
"Ankle, left Z",
|
|
61
|
-
"Elbow, left Y",
|
|
62
|
-
"Elbow, left Z",
|
|
63
|
-
"Hip, left Y",
|
|
64
|
-
"Hip, left Z",
|
|
65
|
-
"Hand, left Y",
|
|
66
|
-
"Hand, left Z",
|
|
67
|
-
"Knee, left Y",
|
|
68
|
-
"Knee, left Z",
|
|
69
|
-
"Shoulder, left Y",
|
|
70
|
-
"Shoulder, left Z",
|
|
71
|
-
"Wrist, left Y",
|
|
72
|
-
"Wrist, left Z",
|
|
73
|
-
"Foot, left Y",
|
|
74
|
-
"Foot, left Z",
|
|
75
|
-
"Ankle, right Y",
|
|
76
|
-
"Ankle, right Z",
|
|
77
|
-
"Elbow, right Y",
|
|
78
|
-
"Elbow, right Z",
|
|
79
|
-
"Hip, right Y",
|
|
80
|
-
"Hip, right Z",
|
|
81
|
-
"Hand, right Y",
|
|
82
|
-
"Hand, right Z",
|
|
83
|
-
"Knee, right Y",
|
|
84
|
-
"Knee, right Z",
|
|
85
|
-
"Shoulder, right Y",
|
|
86
|
-
"Shoulder, right Z",
|
|
87
|
-
"Wrist, right Y",
|
|
88
|
-
"Wrist, right Z",
|
|
89
|
-
"Foot, right Y",
|
|
90
|
-
"Foot, right Z",
|
|
91
|
-
"Ankle, left Angle",
|
|
92
|
-
"Knee, left Angle",
|
|
93
|
-
"Elbow, left Angle",
|
|
94
|
-
"Foot, left Velocity",
|
|
95
|
-
"Foot, left Acceleration",
|
|
96
|
-
"Ankle, left Velocity",
|
|
97
|
-
"Ankle, left Acceleration",
|
|
98
|
-
"Knee, left Velocity",
|
|
99
|
-
"Knee, left Acceleration",
|
|
100
|
-
"Hip Velocity",
|
|
101
|
-
"Hip Acceleration",
|
|
102
|
-
"Pelvis Velocity",
|
|
103
|
-
"Pelvis Acceleration",
|
|
104
|
-
"Shoulder, left Velocity",
|
|
105
|
-
"Shoulder, left Acceleration",
|
|
106
|
-
"Head Velocity",
|
|
107
|
-
"Head Acceleration",
|
|
108
|
-
"Ankle, left Angle Velocity",
|
|
109
|
-
"Ankle, left Angle Acceleration",
|
|
110
|
-
"Knee, left Angle Velocity",
|
|
111
|
-
"Knee, left Angle Acceleration",
|
|
112
|
-
"Elbow, left Angle Velocity",
|
|
113
|
-
"Elbow, left Angle Acceleration",
|
|
114
|
-
"Ankle, right Angle",
|
|
115
|
-
"Knee, right Angle",
|
|
116
|
-
"Elbow, right Angle",
|
|
117
|
-
"Foot, right Velocity",
|
|
118
|
-
"Foot, right Acceleration",
|
|
119
|
-
"Ankle, right Velocity",
|
|
120
|
-
"Ankle, right Acceleration",
|
|
121
|
-
"Knee, right Velocity",
|
|
122
|
-
"Knee, right Acceleration",
|
|
123
|
-
"Shoulder, right Velocity",
|
|
124
|
-
"Shoulder, right Acceleration",
|
|
125
|
-
"Ankle, right Angle Velocity",
|
|
126
|
-
"Ankle, right Angle Acceleration",
|
|
127
|
-
"Knee, right Angle Velocity",
|
|
128
|
-
"Knee, right Angle Acceleration",
|
|
129
|
-
"Elbow, right Angle Velocity",
|
|
130
|
-
"Elbow, right Angle Acceleration",
|
|
131
|
-
]
|
|
132
|
-
cfg["stats_variables"] = []
|
|
133
|
-
# run
|
|
134
|
-
autogaita.group(folderinfo, cfg)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
# %% what happens if we just hit run
|
|
138
|
-
if __name__ == "__main__":
|
|
139
|
-
group_universal3Drun()
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"group_names": [
|
|
4
|
-
"crawling",
|
|
5
|
-
"sideways",
|
|
6
|
-
"walking",
|
|
7
|
-
"jogging",
|
|
8
|
-
"jumping_jack",
|
|
9
|
-
"vertical_jumping"
|
|
10
|
-
],
|
|
11
|
-
"group_dirs": [
|
|
12
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/crawling/Results/",
|
|
13
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/sideways/Results/",
|
|
14
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/walking/Results/",
|
|
15
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/jogging/Results/",
|
|
16
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/jumping_jack/Results/",
|
|
17
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/vertical_jumping/Results/"
|
|
18
|
-
],
|
|
19
|
-
"results_dir": "/Users/mahan/sciebo/Research/AutoGaitA/Showcase 3/MOVI/First Analysis/gaita prepared/gaita_tests/",
|
|
20
|
-
"load_dir": ""
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"do_permtest": true,
|
|
24
|
-
"do_anova": true,
|
|
25
|
-
"anova_design": "RM ANOVA",
|
|
26
|
-
"permutation_number": "10000",
|
|
27
|
-
"stats_threshold": "0.05",
|
|
28
|
-
"which_leg": "left",
|
|
29
|
-
"PCA_n_components": "10",
|
|
30
|
-
"PCA_custom_scatter_PCs": "",
|
|
31
|
-
"PCA_save_3D_video": true,
|
|
32
|
-
"PCA_bins": "",
|
|
33
|
-
"plot_SE": false,
|
|
34
|
-
"color_palette": "Set2",
|
|
35
|
-
"dont_show_plots": false,
|
|
36
|
-
"legend_outside": true,
|
|
37
|
-
"stats_variables": [],
|
|
38
|
-
"PCA_variables": [
|
|
39
|
-
"Head Y",
|
|
40
|
-
"Head Z",
|
|
41
|
-
"Hip Y",
|
|
42
|
-
"Hip Z",
|
|
43
|
-
"Pelvis Y",
|
|
44
|
-
"Pelvis Z",
|
|
45
|
-
"Thorax Y",
|
|
46
|
-
"Thorax Z",
|
|
47
|
-
"Ankle, left Y",
|
|
48
|
-
"Ankle, left Z",
|
|
49
|
-
"Elbow, left Y",
|
|
50
|
-
"Elbow, left Z",
|
|
51
|
-
"Hip, left Y",
|
|
52
|
-
"Hip, left Z",
|
|
53
|
-
"Hand, left Y",
|
|
54
|
-
"Hand, left Z",
|
|
55
|
-
"Knee, left Y",
|
|
56
|
-
"Knee, left Z",
|
|
57
|
-
"Shoulder, left Y",
|
|
58
|
-
"Shoulder, left Z",
|
|
59
|
-
"Wrist, left Y",
|
|
60
|
-
"Wrist, left Z",
|
|
61
|
-
"Foot, left Y",
|
|
62
|
-
"Foot, left Z",
|
|
63
|
-
"Ankle, right Y",
|
|
64
|
-
"Ankle, right Z",
|
|
65
|
-
"Elbow, right Y",
|
|
66
|
-
"Elbow, right Z",
|
|
67
|
-
"Hip, right Y",
|
|
68
|
-
"Hip, right Z",
|
|
69
|
-
"Hand, right Y",
|
|
70
|
-
"Hand, right Z",
|
|
71
|
-
"Knee, right Y",
|
|
72
|
-
"Knee, right Z",
|
|
73
|
-
"Shoulder, right Y",
|
|
74
|
-
"Shoulder, right Z",
|
|
75
|
-
"Wrist, right Y",
|
|
76
|
-
"Wrist, right Z",
|
|
77
|
-
"Foot, right Y",
|
|
78
|
-
"Foot, right Z",
|
|
79
|
-
"Ankle, left Angle",
|
|
80
|
-
"Knee, left Angle",
|
|
81
|
-
"Elbow, left Angle",
|
|
82
|
-
"Foot, left Velocity",
|
|
83
|
-
"Foot, left Acceleration",
|
|
84
|
-
"Ankle, left Velocity",
|
|
85
|
-
"Ankle, left Acceleration",
|
|
86
|
-
"Knee, left Velocity",
|
|
87
|
-
"Knee, left Acceleration",
|
|
88
|
-
"Hip Velocity",
|
|
89
|
-
"Hip Acceleration",
|
|
90
|
-
"Pelvis Velocity",
|
|
91
|
-
"Pelvis Acceleration",
|
|
92
|
-
"Shoulder, left Velocity",
|
|
93
|
-
"Shoulder, left Acceleration",
|
|
94
|
-
"Head Velocity",
|
|
95
|
-
"Head Acceleration",
|
|
96
|
-
"Ankle, left Angle Velocity",
|
|
97
|
-
"Ankle, left Angle Acceleration",
|
|
98
|
-
"Knee, left Angle Velocity",
|
|
99
|
-
"Knee, left Angle Acceleration",
|
|
100
|
-
"Elbow, left Angle Velocity",
|
|
101
|
-
"Elbow, left Angle Acceleration",
|
|
102
|
-
"Ankle, right Angle",
|
|
103
|
-
"Knee, right Angle",
|
|
104
|
-
"Elbow, right Angle",
|
|
105
|
-
"Foot, right Velocity",
|
|
106
|
-
"Foot, right Acceleration",
|
|
107
|
-
"Ankle, right Velocity",
|
|
108
|
-
"Ankle, right Acceleration",
|
|
109
|
-
"Knee, right Velocity",
|
|
110
|
-
"Knee, right Acceleration",
|
|
111
|
-
"Shoulder, right Velocity",
|
|
112
|
-
"Shoulder, right Acceleration",
|
|
113
|
-
"Ankle, right Angle Velocity",
|
|
114
|
-
"Ankle, right Angle Acceleration",
|
|
115
|
-
"Knee, right Angle Velocity",
|
|
116
|
-
"Knee, right Angle Acceleration",
|
|
117
|
-
"Elbow, right Angle Velocity",
|
|
118
|
-
"Elbow, right Angle Acceleration"
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{autogaita-1.0.6 → autogaita-1.0.7}/autogaita/universal3D/universal3D_datafile_preparation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|