autogaita 1.0.8__tar.gz → 1.0.9__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.8 → autogaita-1.0.9}/PKG-INFO +1 -1
- {autogaita-1.0.8 → autogaita-1.0.9}/README.md +3 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/__init__.py +2 -2
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/batchrun_scripts/dlc_multirun.py +1 -2
- autogaita-1.0.9/autogaita/batchrun_scripts/group_dlcrun_forpaper.py +151 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/batchrun_scripts/group_universal3Drun.py +3 -1
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/batchrun_scripts/sleap_singlerun.py +21 -15
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/batchrun_scripts/universal3D_multirun.py +18 -3
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/batchrun_scripts/universal3D_singlerun.py +8 -3
- autogaita-1.0.8/autogaita/dlc/dlc_1_preparation.py → autogaita-1.0.9/autogaita/common2D/common2D_1_preparation.py +222 -119
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/common2D/common2D_3_analysis.py +12 -9
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/common2D/common2D_utils.py +111 -83
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/dlc/dlc_main.py +5 -4
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/group_2_data_processing.py +7 -6
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/group_5_plots.py +21 -21
- autogaita-1.0.8/autogaita/gui/window_2D_advanced_config.py → autogaita-1.0.9/autogaita/gui/common2D_advanced_config_gui.py +13 -11
- autogaita-1.0.9/autogaita/gui/common2D_gui_constants.py +67 -0
- autogaita-1.0.8/autogaita/gui/first_level_gui_utils.py → autogaita-1.0.9/autogaita/gui/common2D_gui_utils.py +11 -137
- autogaita-1.0.8/autogaita/gui/dlc_gui.py → autogaita-1.0.9/autogaita/gui/common2D_main_gui.py +52 -94
- autogaita-1.0.8/autogaita/gui/window_2D_run_and_done.py → autogaita-1.0.9/autogaita/gui/common2D_run_and_done_gui.py +110 -178
- autogaita-1.0.9/autogaita/gui/dlc_gui.py +15 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/dlc_gui_config.json +3 -3
- autogaita-1.0.9/autogaita/gui/first_level_gui_utils.py +124 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/group_gui.py +1 -1
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/group_gui_config.json +1 -1
- autogaita-1.0.9/autogaita/gui/gui_utils.py +51 -0
- autogaita-1.0.9/autogaita/gui/sleap_gui.py +15 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/sleap_gui_config.json +22 -15
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/universal3D_gui.py +153 -49
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/universal3D_gui_config.json +13 -3
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/sleap/sleap_main.py +4 -3
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/universal3D_1_preparation.py +96 -14
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/universal3D_3_analysis.py +188 -41
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/universal3D_4_plots.py +18 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/universal3D_constants.py +1 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/universal3D_datafile_preparation.py +1 -1
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita.egg-info/PKG-INFO +1 -1
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita.egg-info/SOURCES.txt +14 -11
- {autogaita-1.0.8 → autogaita-1.0.9}/setup.py +1 -1
- autogaita-1.0.8/tests/test_dlc_unit_1_preparation.py → autogaita-1.0.9/tests/test_common2D_unit_1_preparation.py +85 -136
- autogaita-1.0.8/tests/test_dlc_unit_2_sc_extraction.py → autogaita-1.0.9/tests/test_common2D_unit_2_sc_extraction.py +3 -3
- autogaita-1.0.8/tests/test_common2D_unit_3_main_analysis.py → autogaita-1.0.9/tests/test_common2D_unit_3_analysis.py +4 -4
- {autogaita-1.0.8 → autogaita-1.0.9}/tests/test_dlc_approval.py +9 -36
- autogaita-1.0.9/tests/test_dlc_unit_1_preparation.py +127 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/tests/test_universal3D_approval.py +13 -28
- autogaita-1.0.9/tests/test_universal3D_unit_3_analysis.py +234 -0
- autogaita-1.0.8/autogaita/dlc/dlc_utils.py +0 -28
- autogaita-1.0.8/autogaita/gui/gui_utils.py +0 -92
- autogaita-1.0.8/autogaita/gui/sleap_gui.py +0 -357
- autogaita-1.0.8/autogaita/sleap/sleap_1_preparation.py +0 -569
- autogaita-1.0.8/autogaita/sleap/sleap_2_sc_extraction.py +0 -167
- {autogaita-1.0.8 → autogaita-1.0.9}/LICENSE +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/__main__.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/batchrun_scripts/__init__.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/batchrun_scripts/dlc_singlerun.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/batchrun_scripts/group_dlcrun.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/common2D/__init__.py +0 -0
- /autogaita-1.0.8/autogaita/dlc/dlc_2_sc_extraction.py → /autogaita-1.0.9/autogaita/common2D/common2D_2_sc_extraction.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/common2D/common2D_4_plots.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/common2D/common2D_constants.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/dlc/__init__.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/__init__.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/group_1_preparation.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/group_3_PCA.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/group_4_stats.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/group_constants.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/group_main.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/group/group_utils.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/__init__.py +0 -0
- /autogaita-1.0.8/autogaita/gui/window_2D_columninfo.py → /autogaita-1.0.9/autogaita/gui/common2D_columninfo_gui.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/gaita_widgets.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/gui_constants.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/gui/main_gui.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/resources/__init__.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/resources/constants.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/resources/icon.icns +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/resources/icon.ico +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/resources/logo.png +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/resources/pic_to_demo_for_repo.png +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/resources/utils.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/sleap/__init__.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/__init__.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/universal3D_2_sc_extraction.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/universal3D_main.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita/universal3D/universal3D_utils.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita.egg-info/dependency_links.txt +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita.egg-info/requires.txt +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/autogaita.egg-info/top_level.txt +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/setup.cfg +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/tests/__init__.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/tests/test_group_approval.py +0 -0
- {autogaita-1.0.8 → autogaita-1.0.9}/tests/test_group_unit.py +0 -0
- /autogaita-1.0.8/tests/test_universal3D_unit.py → /autogaita-1.0.9/tests/test_universal3D_unit_1_preparation.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.9
|
|
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
|
|
@@ -81,6 +81,9 @@ Step cycles are normalised via averaging temporally adjacent data points if thei
|
|
|
81
81
|
|
|
82
82
|
**We strongly advise** users to think carefully about an appropriate bin number for their datasets. The correct value varies and depends strongly on the studied species, behaviour and the frame rate of cameras.
|
|
83
83
|
|
|
84
|
+
## 2D Kinematics in AutoGaitA Universal 3D
|
|
85
|
+
**We strongly advise** AutoGaitA Universal 3D users to carefully consider how our toolbox computes kinematics in 2D, i.e., angles along the y/z-plane and velocities along the y-dimensions. For more information, please see the corresponding **[important note on 2D kinematics in our documentation](https://docs.google.com/document/d/1iQxSwqBW3VdIXHm-AtV4TGlgpJPDldogVx6qzscsGxA/edit?tab=t.0#heading=h.xc5ome7hzfid)**.
|
|
86
|
+
|
|
84
87
|
## Analysing other behaviours - AutoCyclA 🚴
|
|
85
88
|
Even though AutoGaitA's main focus is to automate and standardise gait analyses, our toolbox can be used to automate the analyses of any rhythmic behaviour of interest. For a proof-of-principle demonstration and an introduction of the general workflow of such analyses, see **[AutoCyclA - Automated Cycling Analysis with AutoGaitA.](https://github.com/mahan-hosseini/AutoGaitA/tree/main/autocycla)**
|
|
86
89
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# main gui
|
|
2
2
|
from .gui.main_gui import run_gui # autogaita.run_gui()
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
# 4 sub-guis
|
|
5
5
|
from .gui.dlc_gui import run_dlc_gui # autogaita.run_dlc_gui()
|
|
6
6
|
from .gui.sleap_gui import run_sleap_gui # autogaita.run_sleap_gui()
|
|
7
7
|
from .gui.universal3D_gui import (
|
|
@@ -17,7 +17,7 @@ from .universal3D.universal3D_main import (
|
|
|
17
17
|
) # autogaita.universal3D(info, folderinfo, cfg)
|
|
18
18
|
from .group.group_main import group # autogaita.group(folderinfo, cfg)
|
|
19
19
|
|
|
20
|
-
#
|
|
20
|
+
# 7 batchrun functions - call via e.g. autogaita.dlc_singlerun()
|
|
21
21
|
from .batchrun_scripts.dlc_singlerun import dlc_singlerun
|
|
22
22
|
from .batchrun_scripts.dlc_multirun import dlc_multirun
|
|
23
23
|
from .batchrun_scripts.sleap_singlerun import sleap_singlerun
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from autogaita.common2D.common2D_utils import extract_info, run_singlerun_in_multirun
|
|
2
|
-
import os
|
|
3
2
|
|
|
4
3
|
# %% main function
|
|
5
4
|
|
|
@@ -63,7 +62,7 @@ def dlc_multirun():
|
|
|
63
62
|
"upper_joint": ["Knee ", "Hip ", "Iliac Crest "],
|
|
64
63
|
}
|
|
65
64
|
# run a single gaita run for each entry of info
|
|
66
|
-
info = extract_info(folderinfo)
|
|
65
|
+
info = extract_info("DLC", folderinfo)
|
|
67
66
|
for idx in range(len(info["name"])):
|
|
68
67
|
run_singlerun_in_multirun("DLC", idx, info, folderinfo, cfg)
|
|
69
68
|
|
|
@@ -0,0 +1,151 @@
|
|
|
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()
|
|
@@ -27,8 +27,10 @@ def group_universal3Drun():
|
|
|
27
27
|
# cfg
|
|
28
28
|
cfg["do_permtest"] = True
|
|
29
29
|
cfg["do_anova"] = True
|
|
30
|
-
cfg["permutation_number"] =
|
|
30
|
+
cfg["permutation_number"] = 10000
|
|
31
31
|
cfg["PCA_n_components"] = 3
|
|
32
|
+
cfg["PCA_custom_scatter_PCs"] = ""
|
|
33
|
+
cfg["PCA_bins"] = ""
|
|
32
34
|
cfg["PCA_save_3D_video"] = False
|
|
33
35
|
cfg["stats_threshold"] = 0.05
|
|
34
36
|
cfg["plot_SE"] = False
|
|
@@ -11,18 +11,22 @@ def sleap_singlerun():
|
|
|
11
11
|
# folderinfo
|
|
12
12
|
folderinfo = {}
|
|
13
13
|
folderinfo["root_dir"] = (
|
|
14
|
-
"/Users/mahan/sciebo/Research/AutoGaitA/SLEAP/
|
|
14
|
+
"/Users/mahan/sciebo/Research/AutoGaitA/SLEAP/Human/Analysis/Old/"
|
|
15
15
|
)
|
|
16
16
|
folderinfo["results_dir"] = ""
|
|
17
|
-
folderinfo["sctable_filename"] = "
|
|
18
|
-
folderinfo["data_string"] = "
|
|
17
|
+
folderinfo["sctable_filename"] = "AnnotationTableOldSLEAP"
|
|
18
|
+
folderinfo["data_string"] = ""
|
|
19
19
|
folderinfo["beam_string"] = ""
|
|
20
|
+
folderinfo["premouse_string"] = "Human"
|
|
21
|
+
folderinfo["postmouse_string"] = "_Run"
|
|
22
|
+
folderinfo["prerun_string"] = "Run"
|
|
23
|
+
folderinfo["postrun_string"] = "_SLEAP"
|
|
20
24
|
|
|
21
25
|
# cfg
|
|
22
26
|
cfg = {}
|
|
23
27
|
# 25 Hz sampling rate for SLEAP's example fly dataset (3000 frames @ 2 minutes)
|
|
24
28
|
# https://github.com/talmolab/sleap/tree/main/docs/notebooks/analysis_example
|
|
25
|
-
cfg["sampling_rate"] =
|
|
29
|
+
cfg["sampling_rate"] = 100
|
|
26
30
|
cfg["subtract_beam"] = False
|
|
27
31
|
cfg["dont_show_plots"] = True
|
|
28
32
|
cfg["convert_to_mm"] = False
|
|
@@ -35,31 +39,33 @@ def sleap_singlerun():
|
|
|
35
39
|
cfg["bin_num"] = 25
|
|
36
40
|
cfg["plot_SE"] = True
|
|
37
41
|
cfg["standardise_y_at_SC_level"] = False
|
|
38
|
-
cfg["standardise_y_to_a_joint"] =
|
|
39
|
-
cfg["y_standardisation_joint"] = ["
|
|
40
|
-
cfg["plot_joint_number"] =
|
|
42
|
+
cfg["standardise_y_to_a_joint"] = False
|
|
43
|
+
cfg["y_standardisation_joint"] = ["Midfoot"]
|
|
44
|
+
cfg["plot_joint_number"] = 7
|
|
41
45
|
cfg["color_palette"] = "viridis"
|
|
42
46
|
cfg["legend_outside"] = True
|
|
43
|
-
|
|
44
|
-
cfg["flip_gait_direction"] =
|
|
47
|
+
cfg["invert_y_axis"] = True
|
|
48
|
+
cfg["flip_gait_direction"] = True
|
|
45
49
|
cfg["analyse_average_x"] = False
|
|
46
50
|
cfg["standardise_x_coordinates"] = False
|
|
47
|
-
cfg["x_standardisation_joint"] = ["
|
|
48
|
-
cfg["hind_joints"] = ["
|
|
51
|
+
cfg["x_standardisation_joint"] = ["Midfoot"]
|
|
52
|
+
cfg["hind_joints"] = ["Midfoot", "Ankle", "Knee", "Hip"]
|
|
49
53
|
cfg["fore_joints"] = []
|
|
50
54
|
cfg["beam_col_left"] = [] # list of len == 1
|
|
51
55
|
cfg["beam_col_right"] = []
|
|
52
56
|
cfg["beam_hind_jointadd"] = []
|
|
53
57
|
cfg["beam_fore_jointadd"] = []
|
|
54
58
|
cfg["angles"] = {
|
|
55
|
-
"name": ["
|
|
56
|
-
"lower_joint": ["
|
|
57
|
-
"upper_joint": ["
|
|
59
|
+
"name": ["Ankle", "Knee"],
|
|
60
|
+
"lower_joint": ["Midfoot", "Ankle"],
|
|
61
|
+
"upper_joint": ["Knee", "Hip"],
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
# info
|
|
61
65
|
info = {}
|
|
62
|
-
info["
|
|
66
|
+
info["mouse_num"] = 32
|
|
67
|
+
info["run_num"] = 1
|
|
68
|
+
info["name"] = "ID " + str(info["mouse_num"]) + " - Run " + str(info["run_num"])
|
|
63
69
|
if folderinfo["results_dir"]:
|
|
64
70
|
info["results_dir"] = os.path.join(folderinfo["results_dir"], info["name"])
|
|
65
71
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from autogaita.resources.utils import try_to_run_gaita
|
|
2
2
|
import os
|
|
3
|
-
|
|
3
|
+
import copy
|
|
4
4
|
|
|
5
5
|
# %% main function
|
|
6
6
|
|
|
@@ -24,11 +24,16 @@ def universal3D_multirun():
|
|
|
24
24
|
cfg["angular_acceleration"] = True
|
|
25
25
|
cfg["bin_num"] = 25
|
|
26
26
|
cfg["plot_SE"] = True
|
|
27
|
-
cfg["
|
|
27
|
+
cfg["standardise_z_at_SC_level"] = True
|
|
28
|
+
cfg["standardise_z_to_a_joint"] = True
|
|
29
|
+
cfg["z_standardisation_joint"] = ["Foot, left"]
|
|
28
30
|
cfg["plot_joint_number"] = 7
|
|
29
31
|
cfg["color_palette"] = "viridis"
|
|
30
32
|
cfg["legend_outside"] = True
|
|
33
|
+
cfg["flip_gait_direction"] = False
|
|
31
34
|
cfg["analyse_average_y"] = True
|
|
35
|
+
cfg["standardise_y_coordinates"] = True
|
|
36
|
+
cfg["y_standardisation_joint"] = ["Foot"]
|
|
32
37
|
cfg["joints"] = ["Midfoot", "Ankle", "Knee", "Hip", "Pelvis", "Shoulder", "Neck"]
|
|
33
38
|
cfg["angles"] = {
|
|
34
39
|
"name": ["Ankle", "Knee"],
|
|
@@ -51,8 +56,13 @@ def run_singlerun(idx, info, folderinfo, cfg):
|
|
|
51
56
|
keynames = info.keys()
|
|
52
57
|
for keyname in keynames:
|
|
53
58
|
this_info[keyname] = info[keyname][idx]
|
|
59
|
+
# make a deep copy of cfg that used in each run, otherwise changes to the cfg dict
|
|
60
|
+
# would translate to subsequent runs
|
|
61
|
+
# ==> see https://stackoverflow.com/questions/2465921/
|
|
62
|
+
# how-to-copy-a-dictionary-and-only-edit-the-copy
|
|
63
|
+
this_cfg = copy.deepcopy(cfg)
|
|
54
64
|
# important to only pass this_info to main script here (1 run at a time!)
|
|
55
|
-
try_to_run_gaita("Universal 3D", this_info, folderinfo,
|
|
65
|
+
try_to_run_gaita("Universal 3D", this_info, folderinfo, this_cfg, True)
|
|
56
66
|
|
|
57
67
|
|
|
58
68
|
def extract_info(folderinfo):
|
|
@@ -88,6 +98,11 @@ def extract_info(folderinfo):
|
|
|
88
98
|
info["results_dir"].append(
|
|
89
99
|
os.path.join(root_dir, "Results", info["name"][-1])
|
|
90
100
|
)
|
|
101
|
+
if len(info["name"]) < 1:
|
|
102
|
+
no_files_message = (
|
|
103
|
+
f"Unable to find any files at {root_dir}!" + "\ncheck your inputs!"
|
|
104
|
+
)
|
|
105
|
+
print(no_files_message)
|
|
91
106
|
return info
|
|
92
107
|
|
|
93
108
|
|
|
@@ -18,16 +18,21 @@ def universal3D_singlerun():
|
|
|
18
18
|
# cfg
|
|
19
19
|
cfg = {}
|
|
20
20
|
cfg["sampling_rate"] = 100 # base cfg
|
|
21
|
-
cfg["dont_show_plots"] =
|
|
21
|
+
cfg["dont_show_plots"] = True
|
|
22
22
|
cfg["y_acceleration"] = True
|
|
23
23
|
cfg["angular_acceleration"] = True
|
|
24
24
|
cfg["bin_num"] = 25
|
|
25
25
|
cfg["plot_SE"] = True
|
|
26
|
-
cfg["
|
|
26
|
+
cfg["standardise_z_at_SC_level"] = True
|
|
27
|
+
cfg["standardise_z_to_a_joint"] = True
|
|
28
|
+
cfg["z_standardisation_joint"] = ["Midfoot, left"]
|
|
27
29
|
cfg["plot_joint_number"] = 5
|
|
28
30
|
cfg["color_palette"] = "Set2"
|
|
29
31
|
cfg["legend_outside"] = True
|
|
30
|
-
cfg["
|
|
32
|
+
cfg["flip_gait_direction"] = True
|
|
33
|
+
cfg["analyse_average_y"] = True
|
|
34
|
+
cfg["standardise_y_coordinates"] = True
|
|
35
|
+
cfg["y_standardisation_joint"] = ["Midfoot, left"]
|
|
31
36
|
cfg["joints"] = [
|
|
32
37
|
# "R1-ThCx",
|
|
33
38
|
"Midfoot",
|