autogaita 1.0.7__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.
Files changed (86) hide show
  1. {autogaita-1.0.7 → autogaita-1.0.8}/PKG-INFO +1 -1
  2. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/batchrun_scripts/universal3D_multirun.py +1 -6
  3. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/batchrun_scripts/universal3D_singlerun.py +2 -7
  4. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/dlc/dlc_1_preparation.py +1 -1
  5. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/dlc_gui.py +3 -5
  6. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/group_gui.py +1 -1
  7. autogaita-1.0.8/autogaita/gui/gui_utils.py +92 -0
  8. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/sleap_gui.py +2 -4
  9. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/universal3D_gui.py +46 -141
  10. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/universal3D_gui_config.json +1 -10
  11. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/window_2D_advanced_config.py +11 -13
  12. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/universal3D_1_preparation.py +14 -79
  13. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/universal3D_3_analysis.py +12 -20
  14. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita.egg-info/PKG-INFO +1 -1
  15. {autogaita-1.0.7 → autogaita-1.0.8}/setup.py +1 -1
  16. autogaita-1.0.7/autogaita/gui/gui_utils.py +0 -51
  17. {autogaita-1.0.7 → autogaita-1.0.8}/LICENSE +0 -0
  18. {autogaita-1.0.7 → autogaita-1.0.8}/README.md +0 -0
  19. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/__init__.py +0 -0
  20. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/__main__.py +0 -0
  21. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/batchrun_scripts/__init__.py +0 -0
  22. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/batchrun_scripts/dlc_multirun.py +0 -0
  23. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/batchrun_scripts/dlc_singlerun.py +0 -0
  24. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/batchrun_scripts/group_dlcrun.py +0 -0
  25. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/batchrun_scripts/group_universal3Drun.py +0 -0
  26. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/batchrun_scripts/sleap_singlerun.py +0 -0
  27. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/common2D/__init__.py +0 -0
  28. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/common2D/common2D_3_analysis.py +0 -0
  29. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/common2D/common2D_4_plots.py +0 -0
  30. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/common2D/common2D_constants.py +0 -0
  31. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/common2D/common2D_utils.py +0 -0
  32. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/dlc/__init__.py +0 -0
  33. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/dlc/dlc_2_sc_extraction.py +0 -0
  34. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/dlc/dlc_main.py +0 -0
  35. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/dlc/dlc_utils.py +0 -0
  36. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/__init__.py +0 -0
  37. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/group_1_preparation.py +0 -0
  38. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/group_2_data_processing.py +0 -0
  39. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/group_3_PCA.py +0 -0
  40. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/group_4_stats.py +0 -0
  41. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/group_5_plots.py +0 -0
  42. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/group_constants.py +0 -0
  43. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/group_main.py +0 -0
  44. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/group/group_utils.py +0 -0
  45. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/__init__.py +0 -0
  46. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/dlc_gui_config.json +0 -0
  47. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/first_level_gui_utils.py +0 -0
  48. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/gaita_widgets.py +0 -0
  49. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/group_gui_config.json +0 -0
  50. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/gui_constants.py +0 -0
  51. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/main_gui.py +0 -0
  52. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/sleap_gui_config.json +0 -0
  53. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/window_2D_columninfo.py +0 -0
  54. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/gui/window_2D_run_and_done.py +0 -0
  55. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/resources/__init__.py +0 -0
  56. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/resources/constants.py +0 -0
  57. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/resources/icon.icns +0 -0
  58. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/resources/icon.ico +0 -0
  59. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/resources/logo.png +0 -0
  60. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/resources/pic_to_demo_for_repo.png +0 -0
  61. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/resources/utils.py +0 -0
  62. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/sleap/__init__.py +0 -0
  63. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/sleap/sleap_1_preparation.py +0 -0
  64. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/sleap/sleap_2_sc_extraction.py +0 -0
  65. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/sleap/sleap_main.py +0 -0
  66. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/__init__.py +0 -0
  67. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/universal3D_2_sc_extraction.py +0 -0
  68. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/universal3D_4_plots.py +0 -0
  69. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/universal3D_constants.py +0 -0
  70. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/universal3D_datafile_preparation.py +0 -0
  71. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/universal3D_main.py +0 -0
  72. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita/universal3D/universal3D_utils.py +0 -0
  73. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita.egg-info/SOURCES.txt +0 -0
  74. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita.egg-info/dependency_links.txt +0 -0
  75. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita.egg-info/requires.txt +0 -0
  76. {autogaita-1.0.7 → autogaita-1.0.8}/autogaita.egg-info/top_level.txt +0 -0
  77. {autogaita-1.0.7 → autogaita-1.0.8}/setup.cfg +0 -0
  78. {autogaita-1.0.7 → autogaita-1.0.8}/tests/__init__.py +0 -0
  79. {autogaita-1.0.7 → autogaita-1.0.8}/tests/test_common2D_unit_3_main_analysis.py +0 -0
  80. {autogaita-1.0.7 → autogaita-1.0.8}/tests/test_dlc_approval.py +0 -0
  81. {autogaita-1.0.7 → autogaita-1.0.8}/tests/test_dlc_unit_1_preparation.py +0 -0
  82. {autogaita-1.0.7 → autogaita-1.0.8}/tests/test_dlc_unit_2_sc_extraction.py +0 -0
  83. {autogaita-1.0.7 → autogaita-1.0.8}/tests/test_group_approval.py +0 -0
  84. {autogaita-1.0.7 → autogaita-1.0.8}/tests/test_group_unit.py +0 -0
  85. {autogaita-1.0.7 → autogaita-1.0.8}/tests/test_universal3D_approval.py +0 -0
  86. {autogaita-1.0.7 → 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.7
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
@@ -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["standardise_z_at_SC_level"] = True
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["standardise_z_at_SC_level"] = True
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["flip_gait_direction"] = False
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",
@@ -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 and not to cfg since cfg is overwritten in multiruns!
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
@@ -198,13 +198,11 @@ def run_dlc_gui():
198
198
  WIDGET_CFG,
199
199
  )
200
200
  convert_checkbox.configure(
201
- command=lambda: gui_utils.change_widget_state_based_on_checkbox(
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 label
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.change_widget_state_based_on_checkbox(cfg, "convert_to_mm", ratio_entry)
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
- ) # dont use gui_utils here because its a bit special
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,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.change_widget_state_based_on_checkbox(
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.change_widget_state_based_on_checkbox(cfg, "convert_to_mm", ratio_entry)
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
@@ -42,7 +42,7 @@ WIDGET_CFG["HOVER_COLOR"] = HOVER_COLOR
42
42
 
43
43
  CONFIG_FILE_NAME = "universal3D_gui_config.json"
44
44
  INT_VARS = ["sampling_rate", "bin_num", "plot_joint_number"]
45
- LIST_VARS = ["joints", "y_standardisation_joint", "z_standardisation_joint"]
45
+ LIST_VARS = ["joints"]
46
46
  DICT_VARS = ["angles"]
47
47
  # TK_BOOL/STR_VARS are only used for initialising widgets based on cfg file
48
48
  # (note that numbers are initialised as strings)
@@ -52,11 +52,8 @@ TK_BOOL_VARS = [
52
52
  "y_acceleration",
53
53
  "angular_acceleration",
54
54
  "plot_SE",
55
- "standardise_z_at_SC_level",
56
- "standardise_z_to_a_joint",
57
- "standardise_y_coordinates",
55
+ "normalise_height_at_SC_level",
58
56
  "postname_flag",
59
- "flip_gait_direction",
60
57
  "analyse_average_y",
61
58
  "legend_outside",
62
59
  "fileprep_3D_DLC",
@@ -193,15 +190,6 @@ def run_universal3D_gui():
193
190
  samprate_label.grid(row=3, column=0, columnspan=2, sticky="w")
194
191
  samprate_entry.grid(row=3, column=1)
195
192
 
196
- # flip gait direction
197
- flip_gait_direction_box = gaita_widgets.checkbox(
198
- root,
199
- "Standardise direction of movement across runs",
200
- cfg["flip_gait_direction"],
201
- WIDGET_CFG,
202
- )
203
- flip_gait_direction_box.grid(row=4, column=0, columnspan=2, sticky="w")
204
-
205
193
  # postname present checkbox
206
194
  postname_flag_checkbox = gaita_widgets.checkbox(
207
195
  root,
@@ -210,11 +198,9 @@ def run_universal3D_gui():
210
198
  WIDGET_CFG,
211
199
  )
212
200
  postname_flag_checkbox.configure(
213
- command=lambda: gui_utils.change_widget_state_based_on_checkbox(
214
- results, "postname_flag", postname_entry
215
- ),
201
+ command=lambda: gui_utils.change_postname_entry_state(results, postname_entry),
216
202
  )
217
- postname_flag_checkbox.grid(row=5, column=0, columnspan=2)
203
+ postname_flag_checkbox.grid(row=4, column=0, columnspan=2)
218
204
 
219
205
  # postname string
220
206
  postname_label, postname_entry = gaita_widgets.label_and_entry_pair(
@@ -223,13 +209,13 @@ def run_universal3D_gui():
223
209
  results["postname_string"],
224
210
  WIDGET_CFG,
225
211
  )
226
- postname_label.grid(row=6, column=0, sticky="e")
212
+ postname_label.grid(row=5, column=0, sticky="e")
227
213
  postname_entry.configure(state="disabled")
228
- postname_entry.grid(row=6, column=1, sticky="w")
214
+ postname_entry.grid(row=5, column=1, sticky="w")
229
215
 
230
216
  # empty label 1 (for spacing)
231
217
  empty_label_one = ctk.CTkLabel(root, text="")
232
- empty_label_one.grid(row=7, column=0)
218
+ empty_label_one.grid(row=8, column=0)
233
219
 
234
220
  # .......................... advanced cfg section ................................
235
221
 
@@ -237,7 +223,7 @@ def run_universal3D_gui():
237
223
  advanced_cfg_header_label = gaita_widgets.header_label(
238
224
  root, "Advanced Configuration", WIDGET_CFG
239
225
  )
240
- advanced_cfg_header_label.grid(row=8, column=0, columnspan=2, sticky="nsew")
226
+ advanced_cfg_header_label.grid(row=9, column=0, columnspan=2, sticky="nsew")
241
227
 
242
228
  # data file preparation window
243
229
  datafile_prep_button = gaita_widgets.header_button(
@@ -246,7 +232,7 @@ def run_universal3D_gui():
246
232
  datafile_prep_button.configure(
247
233
  command=lambda: build_datafile_prep_window(root, results, cfg),
248
234
  )
249
- datafile_prep_button.grid(row=9, column=0, columnspan=2)
235
+ datafile_prep_button.grid(row=10, column=0, columnspan=2)
250
236
 
251
237
  # column name information window
252
238
  column_info_button = gaita_widgets.header_button(
@@ -255,7 +241,7 @@ def run_universal3D_gui():
255
241
  column_info_button.configure(
256
242
  command=lambda: build_column_info_window(root, cfg, root_dimensions),
257
243
  )
258
- column_info_button.grid(row=10, column=0, columnspan=2)
244
+ column_info_button.grid(row=11, column=0, columnspan=2)
259
245
 
260
246
  # advanced cfg
261
247
  cfg_window_button = gaita_widgets.header_button(
@@ -264,17 +250,17 @@ def run_universal3D_gui():
264
250
  cfg_window_button.configure(
265
251
  command=lambda: (build_cfg_window(root, cfg)),
266
252
  )
267
- cfg_window_button.grid(row=11, column=0, columnspan=2)
253
+ cfg_window_button.grid(row=12, column=0, columnspan=2)
268
254
 
269
255
  # empty label 2 (for spacing)
270
256
  empty_label_two = ctk.CTkLabel(root, text="")
271
- empty_label_two.grid(row=12, column=0)
257
+ empty_label_two.grid(row=13, column=0)
272
258
 
273
259
  # ............................ run & exit section ................................
274
260
 
275
261
  # run analysis label
276
262
  runheader_label = gaita_widgets.header_label(root, "Run Analysis", WIDGET_CFG)
277
- runheader_label.grid(row=13, column=0, columnspan=2, sticky="nsew")
263
+ runheader_label.grid(row=14, column=0, columnspan=2, sticky="nsew")
278
264
 
279
265
  # single video checkbox
280
266
  singlevideo_checkbox = gaita_widgets.checkbox(
@@ -284,19 +270,17 @@ def run_universal3D_gui():
284
270
  WIDGET_CFG,
285
271
  )
286
272
  singlevideo_checkbox.configure(
287
- command=lambda: gui_utils.change_widget_state_based_on_checkbox(
288
- cfg, "analyse_singlerun", ID_entry
289
- ),
273
+ command=lambda: gui_utils.change_ID_entry_state(cfg, ID_entry),
290
274
  )
291
- singlevideo_checkbox.grid(row=14, column=0, columnspan=2)
275
+ singlevideo_checkbox.grid(row=15, column=0, columnspan=2)
292
276
 
293
277
  # ID string info
294
278
  ID_label, ID_entry = gaita_widgets.label_and_entry_pair(
295
279
  root, "ID to be analysed:", results["name"], WIDGET_CFG
296
280
  )
297
- ID_label.grid(row=15, column=0, sticky="e")
298
- ID_entry.grid(row=15, column=1, sticky="w")
299
- gui_utils.change_widget_state_based_on_checkbox(cfg, "analyse_singlerun", ID_entry)
281
+ ID_label.grid(row=16, column=0, sticky="e")
282
+ ID_entry.grid(row=16, column=1, sticky="w")
283
+ gui_utils.change_ID_entry_state(cfg, ID_entry)
300
284
 
301
285
  # run analysis button
302
286
  run_button = gaita_widgets.header_button(root, "Run Analysis!", WIDGET_CFG)
@@ -315,11 +299,11 @@ def run_universal3D_gui():
315
299
  build_donewindow(results, root, root_dimensions),
316
300
  )
317
301
  )
318
- run_button.grid(row=16, column=0, columnspan=2, padx=10, pady=(10, 5))
302
+ run_button.grid(row=17, column=0, columnspan=2, padx=10, pady=(10, 5))
319
303
 
320
304
  # empty label 3 (for spacing)
321
305
  empty_label_three = ctk.CTkLabel(root, text="")
322
- empty_label_three.grid(row=17, column=0)
306
+ empty_label_three.grid(row=18, column=0)
323
307
 
324
308
  # close program button
325
309
  exit_button = gaita_widgets.exit_button(
@@ -342,7 +326,7 @@ def run_universal3D_gui():
342
326
  root.after(5000, root.destroy),
343
327
  ),
344
328
  )
345
- exit_button.grid(row=18, column=0, columnspan=2, padx=10, pady=(10, 5))
329
+ exit_button.grid(row=19, column=0, columnspan=2, padx=10, pady=(10, 5))
346
330
 
347
331
  # maximise widgets
348
332
  gui_utils.maximise_widgets(root)
@@ -572,9 +556,7 @@ def build_cfg_window(root, cfg):
572
556
  adv_cfg_analysis_header_label = gaita_widgets.header_label(
573
557
  cfg_window, "Analysis", WIDGET_CFG
574
558
  )
575
- adv_cfg_analysis_header_label.grid(
576
- row=0, column=0, rowspan=2, columnspan=2, sticky="nsew"
577
- )
559
+ adv_cfg_analysis_header_label.grid(row=0, column=0, rowspan=2, sticky="nsew")
578
560
  # bin_num
579
561
  bin_num_label, bin_num_entry = gaita_widgets.label_and_entry_pair(
580
562
  cfg_window,
@@ -583,73 +565,35 @@ def build_cfg_window(root, cfg):
583
565
  WIDGET_CFG,
584
566
  adv_cfg_textsize=True,
585
567
  )
586
- bin_num_label.grid(row=2, column=0, columnspan=2)
587
- bin_num_entry.grid(row=3, column=0, columnspan=2)
588
- # acceleration label
589
- acceleration_string = "Analyse (i.e. plot & export) accelerations for:"
590
- acceleration_label = ctk.CTkLabel(
591
- cfg_window,
592
- text=acceleration_string,
593
- font=(TEXT_FONT_NAME, ADV_CFG_TEXT_FONT_SIZE),
594
- )
595
- acceleration_label.grid(row=4, column=0, columnspan=2)
568
+ bin_num_label.grid(row=2, column=0)
569
+ bin_num_entry.grid(row=3, column=0)
596
570
  # y acceleration
597
571
  y_accel_box = gaita_widgets.checkbox(
598
572
  cfg_window,
599
- "y-coordinates",
573
+ "Compute, plot & export joints' Y-accelerations",
600
574
  cfg["y_acceleration"],
601
575
  WIDGET_CFG,
602
576
  adv_cfg_textsize=True,
603
577
  )
604
- y_accel_box.grid(row=5, column=0, sticky="e")
578
+ y_accel_box.grid(row=4, column=0)
605
579
  # angular acceleration
606
580
  angular_accel_box = gaita_widgets.checkbox(
607
581
  cfg_window,
608
- "angles",
582
+ "Compute, plot & export angular accelerations",
609
583
  cfg["angular_acceleration"],
610
584
  WIDGET_CFG,
611
585
  adv_cfg_textsize=True,
612
586
  )
613
- angular_accel_box.grid(row=5, column=1, sticky="w")
614
- # height standardisation at each step cycle separately
615
- z_standardisation_box = gaita_widgets.checkbox(
616
- cfg_window,
617
- "Normalise heights separately for all step cycles",
618
- cfg["standardise_z_at_SC_level"],
619
- WIDGET_CFG,
620
- adv_cfg_textsize=True,
621
- )
622
- z_standardisation_box.grid(row=6, column=0, columnspan=2)
623
- # z standardisation to a specific joint not global minimum
624
- standardise_z_to_joint_box = gaita_widgets.checkbox(
587
+ angular_accel_box.grid(row=5, column=0)
588
+ # height normalisation at each step cycle separately
589
+ height_normalisation_box = gaita_widgets.checkbox(
625
590
  cfg_window,
626
- "Standardise heights to a joint instead of to global minimum",
627
- cfg["standardise_z_to_a_joint"],
591
+ "Normalise heights of all step cycles separately",
592
+ cfg["normalise_height_at_SC_level"],
628
593
  WIDGET_CFG,
629
594
  adv_cfg_textsize=True,
630
595
  )
631
- standardise_z_to_joint_box.configure(
632
- command=lambda: gui_utils.change_widget_state_based_on_checkbox(
633
- cfg, "standardise_z_to_a_joint", z_standardisation_joint_entry
634
- ),
635
- )
636
- standardise_z_to_joint_box.grid(row=7, column=0, columnspan=2)
637
- # z standardisation joint string label & entry
638
- z_standardisation_joint_label, z_standardisation_joint_entry = (
639
- gaita_widgets.label_and_entry_pair(
640
- cfg_window,
641
- "Height-standardisation joint:",
642
- cfg["z_standardisation_joint"][0],
643
- WIDGET_CFG,
644
- adv_cfg_textsize=True,
645
- )
646
- )
647
- z_standardisation_joint_label.grid(row=8, column=0, sticky="e")
648
- z_standardisation_joint_entry.grid(row=8, column=1, sticky="w")
649
- # to initialise the widget correctly, run this function once
650
- gui_utils.change_widget_state_based_on_checkbox(
651
- cfg, "standardise_z_to_a_joint", z_standardisation_joint_entry
652
- )
596
+ height_normalisation_box.grid(row=6, column=0)
653
597
  # export average y coordinates
654
598
  analyse_average_y_box = gaita_widgets.checkbox(
655
599
  cfg_window,
@@ -658,53 +602,14 @@ def build_cfg_window(root, cfg):
658
602
  WIDGET_CFG,
659
603
  adv_cfg_textsize=True,
660
604
  )
661
- analyse_average_y_box.grid(row=9, column=0, columnspan=2)
662
- analyse_average_y_box.configure(
663
- command=lambda: gui_utils.change_widget_state_based_on_checkbox(
664
- cfg, "analyse_average_y", standardise_y_coordinates_box
665
- ),
666
- )
667
- # standardise y coordinates
668
- standardise_y_coordinates_box = gaita_widgets.checkbox(
669
- cfg_window,
670
- "Standardise y-coordinates",
671
- cfg["standardise_y_coordinates"],
672
- WIDGET_CFG,
673
- adv_cfg_textsize=True,
674
- )
675
- standardise_y_coordinates_box.configure(
676
- command=lambda: gui_utils.change_widget_state_based_on_checkbox(
677
- cfg, "standardise_y_coordinates", y_standardisation_joint_entry
678
- ),
679
- )
680
- standardise_y_coordinates_box.grid(row=10, column=0, columnspan=2)
681
- gui_utils.change_widget_state_based_on_checkbox(
682
- cfg, "analyse_average_y", standardise_y_coordinates_box
683
- )
684
- # y standardisation joint string label & entry
685
- y_standardisation_joint_label, y_standardisation_joint_entry = (
686
- gaita_widgets.label_and_entry_pair(
687
- cfg_window,
688
- "Y-standardisation joint:",
689
- cfg["y_standardisation_joint"][0],
690
- WIDGET_CFG,
691
- adv_cfg_textsize=True,
692
- )
693
- )
694
- y_standardisation_joint_label.grid(row=11, column=0, sticky="e")
695
- y_standardisation_joint_entry.grid(row=11, column=1, sticky="w")
696
- gui_utils.change_widget_state_based_on_checkbox(
697
- cfg, "standardise_y_coordinates", y_standardisation_joint_entry
698
- )
605
+ analyse_average_y_box.grid(row=7, column=0)
699
606
 
700
607
  # ............................. advanced output .................................
701
608
  # advanced output header
702
609
  adv_cfg_output_header_label = gaita_widgets.header_label(
703
610
  cfg_window, "Output", WIDGET_CFG
704
611
  )
705
- adv_cfg_output_header_label.grid(
706
- row=12, column=0, rowspan=2, columnspan=2, sticky="nsew"
707
- )
612
+ adv_cfg_output_header_label.grid(row=8, column=0, rowspan=2, sticky="nsew")
708
613
  # number of joints to plot
709
614
  plot_joint_num_label, plot_joint_num_entry = gaita_widgets.label_and_entry_pair(
710
615
  cfg_window,
@@ -713,8 +618,8 @@ def build_cfg_window(root, cfg):
713
618
  WIDGET_CFG,
714
619
  adv_cfg_textsize=True,
715
620
  )
716
- plot_joint_num_label.grid(row=14, column=0, sticky="e")
717
- plot_joint_num_entry.grid(row=14, column=1, sticky="w")
621
+ plot_joint_num_label.grid(row=10, column=0)
622
+ plot_joint_num_entry.grid(row=11, column=0)
718
623
  # plot plots to python
719
624
  showplots_checkbox = gaita_widgets.checkbox(
720
625
  cfg_window,
@@ -723,7 +628,7 @@ def build_cfg_window(root, cfg):
723
628
  WIDGET_CFG,
724
629
  adv_cfg_textsize=True,
725
630
  )
726
- showplots_checkbox.grid(row=15, column=0, columnspan=2)
631
+ showplots_checkbox.grid(row=12, column=0)
727
632
  # plot SE
728
633
  plot_SE_box = gaita_widgets.checkbox(
729
634
  cfg_window,
@@ -732,7 +637,7 @@ def build_cfg_window(root, cfg):
732
637
  WIDGET_CFG,
733
638
  adv_cfg_textsize=True,
734
639
  )
735
- plot_SE_box.grid(row=16, column=0, columnspan=2)
640
+ plot_SE_box.grid(row=13, column=0)
736
641
  # color palette
737
642
  color_palette_string = "Choose figures' color palette"
738
643
  color_palette_label = ctk.CTkLabel(
@@ -740,7 +645,7 @@ def build_cfg_window(root, cfg):
740
645
  text=color_palette_string,
741
646
  font=(TEXT_FONT_NAME, ADV_CFG_TEXT_FONT_SIZE),
742
647
  )
743
- color_palette_label.grid(row=17, column=0, columnspan=2)
648
+ color_palette_label.grid(row=14, column=0)
744
649
  color_palette_entry = ctk.CTkOptionMenu(
745
650
  cfg_window,
746
651
  values=COLOR_PALETTES_LIST,
@@ -750,7 +655,7 @@ def build_cfg_window(root, cfg):
750
655
  button_hover_color=HOVER_COLOR,
751
656
  font=(TEXT_FONT_NAME, ADV_CFG_TEXT_FONT_SIZE),
752
657
  )
753
- color_palette_entry.grid(row=18, column=0, columnspan=2)
658
+ color_palette_entry.grid(row=15, column=0)
754
659
  # legend outside
755
660
  legend_outside_checkbox = gaita_widgets.checkbox(
756
661
  cfg_window,
@@ -759,7 +664,7 @@ def build_cfg_window(root, cfg):
759
664
  WIDGET_CFG,
760
665
  adv_cfg_textsize=True,
761
666
  )
762
- legend_outside_checkbox.grid(row=19, column=0, columnspan=2)
667
+ legend_outside_checkbox.grid(row=16, column=0)
763
668
 
764
669
  # results dir
765
670
  results_dir_label, results_dir_entry = gaita_widgets.label_and_entry_pair(
@@ -769,8 +674,8 @@ def build_cfg_window(root, cfg):
769
674
  WIDGET_CFG,
770
675
  adv_cfg_textsize=True,
771
676
  )
772
- results_dir_label.grid(row=20, column=0, columnspan=2)
773
- results_dir_entry.grid(row=21, column=0, columnspan=2)
677
+ results_dir_label.grid(row=17, column=0)
678
+ results_dir_entry.grid(row=18, column=0)
774
679
 
775
680
  # done button
776
681
  adv_cfg_done_button = ctk.CTkButton(
@@ -782,10 +687,10 @@ def build_cfg_window(root, cfg):
782
687
  command=lambda: cfg_window.destroy(),
783
688
  )
784
689
  adv_cfg_done_button.grid(
785
- row=22, column=0, rowspan=2, columnspan=2, sticky="nsew", padx=10, pady=(10, 5)
690
+ row=19, column=0, rowspan=2, sticky="nsew", padx=10, pady=(10, 5)
786
691
  )
787
692
  # maximise widgets
788
- cfg_window.columnconfigure(list(range(2)), weight=1, uniform="Silent_Creme")
693
+ cfg_window.columnconfigure(0, weight=1, uniform="Silent_Creme")
789
694
  cfg_window.rowconfigure(list(range(20)), weight=1, uniform="Silent_Creme")
790
695
 
791
696
 
@@ -15,17 +15,8 @@
15
15
  "bin_num": "25",
16
16
  "plot_joint_number": "3",
17
17
  "plot_SE": false,
18
- "standardise_z_at_SC_level": false,
19
- "standardise_z_to_a_joint": true,
20
- "z_standardisation_joint": [
21
- "Ankle"
22
- ],
23
- "flip_gait_direction": true,
18
+ "normalise_height_at_SC_level": false,
24
19
  "analyse_average_y": true,
25
- "standardise_y_coordinates": true,
26
- "y_standardisation_joint": [
27
- "Ankle"
28
- ],
29
20
  "color_palette": "Set2",
30
21
  "legend_outside": true,
31
22
  "results_dir": "",