autogaita 1.0.6__tar.gz → 1.0.8__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.8}/PKG-INFO +1 -1
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/batchrun_scripts/group_dlcrun.py +21 -24
- autogaita-1.0.6/autogaita/batchrun_scripts/group_universal3Drun_backup.py → autogaita-1.0.8/autogaita/batchrun_scripts/group_universal3Drun.py +0 -2
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/batchrun_scripts/universal3D_multirun.py +1 -6
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/batchrun_scripts/universal3D_singlerun.py +2 -7
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/common2D/common2D_3_analysis.py +9 -12
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/dlc/dlc_1_preparation.py +1 -1
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/group_3_PCA.py +0 -2
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/dlc_gui.py +3 -5
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/group_gui.py +1 -1
- autogaita-1.0.8/autogaita/gui/group_gui_config.json +42 -0
- autogaita-1.0.8/autogaita/gui/gui_utils.py +92 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/sleap_gui.py +2 -4
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/universal3D_gui.py +46 -141
- autogaita-1.0.8/autogaita/gui/universal3D_gui_config.json +54 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/window_2D_advanced_config.py +11 -13
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/universal3D_1_preparation.py +14 -79
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/universal3D_3_analysis.py +32 -114
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita.egg-info/PKG-INFO +1 -1
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita.egg-info/SOURCES.txt +0 -2
- {autogaita-1.0.6 → autogaita-1.0.8}/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/gui/gui_utils.py +0 -51
- autogaita-1.0.6/autogaita/gui/universal3D_gui_config.json +0 -66
- {autogaita-1.0.6 → autogaita-1.0.8}/LICENSE +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/README.md +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/__main__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/batchrun_scripts/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/batchrun_scripts/dlc_multirun.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/batchrun_scripts/dlc_singlerun.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/batchrun_scripts/sleap_singlerun.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/common2D/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/common2D/common2D_4_plots.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/common2D/common2D_constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/common2D/common2D_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/dlc/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/dlc/dlc_2_sc_extraction.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/dlc/dlc_main.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/dlc/dlc_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/group_1_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/group_2_data_processing.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/group_4_stats.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/group_5_plots.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/group_constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/group_main.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/group/group_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/dlc_gui_config.json +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/first_level_gui_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/gaita_widgets.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/gui_constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/main_gui.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/sleap_gui_config.json +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/window_2D_columninfo.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/gui/window_2D_run_and_done.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/resources/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/resources/constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/resources/icon.icns +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/resources/icon.ico +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/resources/logo.png +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/resources/pic_to_demo_for_repo.png +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/resources/utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/sleap/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/sleap/sleap_1_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/sleap/sleap_2_sc_extraction.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/sleap/sleap_main.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/universal3D_2_sc_extraction.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/universal3D_4_plots.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/universal3D_constants.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/universal3D_datafile_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/universal3D_main.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita/universal3D/universal3D_utils.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita.egg-info/dependency_links.txt +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita.egg-info/requires.txt +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/autogaita.egg-info/top_level.txt +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/setup.cfg +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/tests/__init__.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/tests/test_common2D_unit_3_main_analysis.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/tests/test_dlc_approval.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/tests/test_dlc_unit_1_preparation.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/tests/test_dlc_unit_2_sc_extraction.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/tests/test_group_approval.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/tests/test_group_unit.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/tests/test_universal3D_approval.py +0 -0
- {autogaita-1.0.6 → autogaita-1.0.8}/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.8
|
|
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
|
|
@@ -24,16 +24,11 @@ def universal3D_multirun():
|
|
|
24
24
|
cfg["angular_acceleration"] = True
|
|
25
25
|
cfg["bin_num"] = 25
|
|
26
26
|
cfg["plot_SE"] = True
|
|
27
|
-
cfg["
|
|
28
|
-
cfg["standardise_z_to_a_joint"] = True
|
|
29
|
-
cfg["z_standardisation_joint"] = ["Foot, left"]
|
|
27
|
+
cfg["normalise_height_at_SC_level"] = True
|
|
30
28
|
cfg["plot_joint_number"] = 7
|
|
31
29
|
cfg["color_palette"] = "viridis"
|
|
32
30
|
cfg["legend_outside"] = True
|
|
33
|
-
cfg["flip_gait_direction"] = False
|
|
34
31
|
cfg["analyse_average_y"] = True
|
|
35
|
-
cfg["standardise_y_coordinates"] = True
|
|
36
|
-
cfg["y_standardisation_joint"] = ["Foot"]
|
|
37
32
|
cfg["joints"] = ["Midfoot", "Ankle", "Knee", "Hip", "Pelvis", "Shoulder", "Neck"]
|
|
38
33
|
cfg["angles"] = {
|
|
39
34
|
"name": ["Ankle", "Knee"],
|
|
@@ -23,16 +23,11 @@ def universal3D_singlerun():
|
|
|
23
23
|
cfg["angular_acceleration"] = True
|
|
24
24
|
cfg["bin_num"] = 25
|
|
25
25
|
cfg["plot_SE"] = True
|
|
26
|
-
cfg["
|
|
27
|
-
cfg["standardise_z_to_a_joint"] = True
|
|
28
|
-
cfg["z_standardisation_joint"] = ["Midfoot"]
|
|
26
|
+
cfg["normalise_height_at_SC_level"] = True
|
|
29
27
|
cfg["plot_joint_number"] = 5
|
|
30
28
|
cfg["color_palette"] = "Set2"
|
|
31
29
|
cfg["legend_outside"] = True
|
|
32
|
-
cfg["
|
|
33
|
-
cfg["analyse_average_y"] = True
|
|
34
|
-
cfg["standardise_y_coordinates"] = True
|
|
35
|
-
cfg["y_standardisation_joint"] = ["Midfoot"]
|
|
30
|
+
cfg["analyse_average_y"] = False
|
|
36
31
|
cfg["joints"] = [
|
|
37
32
|
# "R1-ThCx",
|
|
38
33
|
"Midfoot",
|
|
@@ -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):
|
|
@@ -169,7 +169,7 @@ def some_prep(info, folderinfo, cfg):
|
|
|
169
169
|
beam_hind_jointadd = cfg["beam_hind_jointadd"]
|
|
170
170
|
beam_fore_jointadd = cfg["beam_fore_jointadd"]
|
|
171
171
|
direction_joint = cfg["direction_joint"]
|
|
172
|
-
# important to unpack to vars
|
|
172
|
+
# important to unpack to vars hand not to cfg since cfg is overwritten in multiruns!
|
|
173
173
|
x_standardisation_joint = cfg["x_standardisation_joint"][0]
|
|
174
174
|
y_standardisation_joint = cfg["y_standardisation_joint"][0]
|
|
175
175
|
# store config json file @ group path
|
|
@@ -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!
|
|
@@ -198,13 +198,11 @@ def run_dlc_gui():
|
|
|
198
198
|
WIDGET_CFG,
|
|
199
199
|
)
|
|
200
200
|
convert_checkbox.configure(
|
|
201
|
-
command=lambda: gui_utils.
|
|
202
|
-
cfg, "convert_to_mm", ratio_entry
|
|
203
|
-
),
|
|
201
|
+
command=lambda: gui_utils.change_ratio_entry_state(cfg, ratio_entry),
|
|
204
202
|
)
|
|
205
203
|
convert_checkbox.grid(row=2, column=0, columnspan=2, sticky="w")
|
|
206
204
|
|
|
207
|
-
# ratio
|
|
205
|
+
# ratio label
|
|
208
206
|
ratio_entry = ctk.CTkEntry(
|
|
209
207
|
root,
|
|
210
208
|
textvariable=cfg["pixel_to_mm_ratio"],
|
|
@@ -217,7 +215,7 @@ def run_dlc_gui():
|
|
|
217
215
|
)
|
|
218
216
|
ratio_right_label.grid(row=2, column=2, sticky="w")
|
|
219
217
|
# to initialise the widget correctly, run this function once
|
|
220
|
-
gui_utils.
|
|
218
|
+
gui_utils.change_ratio_entry_state(cfg, ratio_entry)
|
|
221
219
|
|
|
222
220
|
# subtract beam
|
|
223
221
|
subtract_beam_checkbox = gaita_widgets.checkbox(
|
|
@@ -349,7 +349,7 @@ def build_mainwindow(root, group_number, root_dimensions):
|
|
|
349
349
|
)
|
|
350
350
|
ANOVA_checkbox.configure(
|
|
351
351
|
command=lambda: change_ANOVA_buttons_state(ANOVA_buttons),
|
|
352
|
-
)
|
|
352
|
+
)
|
|
353
353
|
ANOVA_checkbox.grid(row=last_group_row + 7, column=0, columnspan=3, pady=10)
|
|
354
354
|
# ANOVA design
|
|
355
355
|
ANOVA_string_and_var_value = [
|
|
@@ -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
|
+
]
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import platform
|
|
2
|
+
from importlib import resources
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# ............................... general gui stuff ..................................
|
|
6
|
+
def configure_the_icon(root):
|
|
7
|
+
"""Configure the icon - in macos it changes the dock icon, in windows it changes
|
|
8
|
+
all windows titlebar icons (taskbar cannot be changed without converting to exe)
|
|
9
|
+
"""
|
|
10
|
+
if platform.system().startswith("Darwin"):
|
|
11
|
+
try:
|
|
12
|
+
from Cocoa import NSApplication, NSImage
|
|
13
|
+
except ImportError:
|
|
14
|
+
print("Unable to import pyobjc modules")
|
|
15
|
+
else:
|
|
16
|
+
with resources.path("autogaita.resources", "icon.icns") as icon_path:
|
|
17
|
+
ns_application = NSApplication.sharedApplication()
|
|
18
|
+
logo_ns_image = NSImage.alloc().initWithContentsOfFile_(str(icon_path))
|
|
19
|
+
ns_application.setApplicationIconImage_(logo_ns_image)
|
|
20
|
+
elif platform.system().startswith("win"):
|
|
21
|
+
with resources.path("autogaita.resources", "icon.ico") as icon_path:
|
|
22
|
+
root.iconbitmap(str(icon_path))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def fix_window_after_its_creation(window):
|
|
26
|
+
"""Perform some quality of life things after creating a window (root or Toplevel)"""
|
|
27
|
+
window.attributes("-topmost", True)
|
|
28
|
+
window.focus_set()
|
|
29
|
+
window.after(100, lambda: window.attributes("-topmost", False)) # 100 ms
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def maximise_widgets(window):
|
|
33
|
+
"""Maximises all widgets to look good in fullscreen"""
|
|
34
|
+
# fix the grid to fill the window
|
|
35
|
+
num_rows = window.grid_size()[1] # maximise rows
|
|
36
|
+
for r in range(num_rows):
|
|
37
|
+
window.grid_rowconfigure(r, weight=1)
|
|
38
|
+
num_cols = window.grid_size()[0] # maximise cols
|
|
39
|
+
for c in range(num_cols):
|
|
40
|
+
window.grid_columnconfigure(c, weight=1)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# .............................. change widget states ................................
|
|
44
|
+
def change_ratio_entry_state(cfg, ratio_entry):
|
|
45
|
+
"""Change the state of ratio entry widget based on whether user wants
|
|
46
|
+
to convert pixels to mm or not.
|
|
47
|
+
"""
|
|
48
|
+
if cfg["convert_to_mm"].get() is True:
|
|
49
|
+
ratio_entry.configure(state="normal")
|
|
50
|
+
elif cfg["convert_to_mm"].get() is False:
|
|
51
|
+
ratio_entry.configure(state="disabled")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def change_y_standardisation_joint_entry_state(cfg, y_standardisation_joint_entry):
|
|
55
|
+
if cfg["standardise_y_to_a_joint"].get() is True:
|
|
56
|
+
y_standardisation_joint_entry.configure(state="normal")
|
|
57
|
+
elif cfg["standardise_y_to_a_joint"].get() is False:
|
|
58
|
+
y_standardisation_joint_entry.configure(state="disabled")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def change_x_standardisation_box_state(cfg, standardise_x_coordinates_box):
|
|
62
|
+
if cfg["analyse_average_x"].get() is True:
|
|
63
|
+
standardise_x_coordinates_box.configure(state="normal")
|
|
64
|
+
elif cfg["analyse_average_x"].get() is False:
|
|
65
|
+
standardise_x_coordinates_box.configure(state="disabled")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def change_x_standardisation_joint_entry_state(cfg, x_standardisation_joint_entry):
|
|
69
|
+
if cfg["standardise_x_coordinates"].get() is True:
|
|
70
|
+
x_standardisation_joint_entry.configure(state="normal")
|
|
71
|
+
elif cfg["standardise_x_coordinates"].get() is False:
|
|
72
|
+
x_standardisation_joint_entry.configure(state="disabled")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def change_ID_entry_state(cfg, ID_entry):
|
|
76
|
+
"""Change the state of ID entry widget based on whether user wants to only analyse
|
|
77
|
+
a single dataset.
|
|
78
|
+
"""
|
|
79
|
+
if cfg["analyse_singlerun"].get() is True:
|
|
80
|
+
ID_entry.configure(state="normal")
|
|
81
|
+
elif cfg["analyse_singlerun"].get() is False:
|
|
82
|
+
ID_entry.configure(state="disabled")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def change_postname_entry_state(results, postname_entry):
|
|
86
|
+
"""Change the state of ID entry widget based on whether user wants to only analyse
|
|
87
|
+
a single dataset.
|
|
88
|
+
"""
|
|
89
|
+
if results["postname_flag"].get() is True:
|
|
90
|
+
postname_entry.configure(state="normal")
|
|
91
|
+
elif results["postname_flag"].get() is False:
|
|
92
|
+
postname_entry.configure(state="disabled")
|
|
@@ -192,9 +192,7 @@ def run_sleap_gui():
|
|
|
192
192
|
WIDGET_CFG,
|
|
193
193
|
)
|
|
194
194
|
convert_checkbox.configure(
|
|
195
|
-
command=lambda: gui_utils.
|
|
196
|
-
cfg, "convert_to_mm", ratio_entry
|
|
197
|
-
),
|
|
195
|
+
command=lambda: gui_utils.change_ratio_entry_state(cfg, ratio_entry),
|
|
198
196
|
)
|
|
199
197
|
convert_checkbox.grid(row=2, column=0, columnspan=2, sticky="w")
|
|
200
198
|
|
|
@@ -211,7 +209,7 @@ def run_sleap_gui():
|
|
|
211
209
|
)
|
|
212
210
|
ratio_right_label.grid(row=2, column=2, sticky="w")
|
|
213
211
|
# to initialise the widget correctly, run this function once
|
|
214
|
-
gui_utils.
|
|
212
|
+
gui_utils.change_ratio_entry_state(cfg, ratio_entry)
|
|
215
213
|
|
|
216
214
|
# NU - I'll implement beam subtraction and gait direction flipping after having
|
|
217
215
|
# data for testing
|