Skip to content

Commit

Permalink
First commit + file in french
Browse files Browse the repository at this point in the history
  • Loading branch information
aceglia committed Dec 7, 2023
1 parent 8ce52aa commit 52d642f
Show file tree
Hide file tree
Showing 13 changed files with 563 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __pycache__/
# C extensions
*.so


# Distribution / packaging
.Python
build/
Expand All @@ -21,6 +22,8 @@ sdist/
var/
wheels/
share/python-wheels/
.idea/

*.egg-info/
.installed.cfg
*.egg
Expand Down
517 changes: 517 additions & 0 deletions calcul_scap_mat.py

Large diffs are not rendered by default.

Binary file added docs/Draft07_Manuel_utilisateur_de_la_pièce.docx
Binary file not shown.
Binary file added docs/Readme.docx
Binary file not shown.
43 changes: 43 additions & 0 deletions show_scap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import biorbd
import bioviz
import numpy as np
from biosiglive import load, MskFunctions, InverseKinematicsMethods, save

data_mat = load("data_scap/P8/markers_file_recons.bio", merge=False)
all_bioviz = []

for i, data in enumerate(data_mat):
if "abduction_max_2" in data["file: "]:
print("curent_file is ", data["file: "])
mat_sl = data["data"]["mat_sl"]
mat_cluster = data["data"]["mat_cluster"]
mat_scap = data["data"]["mat_scap"]
idx_nan = np.argwhere(np.isnan(mat_sl[:, 0, :]))
mat_sl[idx_nan[:, 0], 0, idx_nan[:, 1]] = mat_cluster[idx_nan[:, 0], 0, idx_nan[:, 1]]
# mat_scap[idx_nan[:, 0], 0, idx_nan[:, 1]] = mat_cluster[idx_nan[:, 0], 0, idx_nan[:, 1]]

mat_sl[:, 0, :] = mat_cluster[:, 0, :]
model = biorbd.Model("wu_reduc_left.bioMod")
all_mark = np.concatenate((mat_sl, mat_cluster, mat_scap), axis=1)
ik_function = MskFunctions(model=model, data_buffer_size=mat_sl[:, :, :].shape[2])
q, _ = ik_function.compute_inverse_kinematics(markers=all_mark[:3, :, :]*0.001,
method=InverseKinematicsMethods.BiorbdLeastSquare)
print("q sl:", np.mean(q[:3, :], axis=1) * 180 / np.pi)
print("q cluster:", np.mean(q[6:9, :], axis=1) * 180 / np.pi)
print("q scap:", np.mean(q[12:15, :], axis=1) * 180 / np.pi)
# q_cluster, _ = ik_function.compute_inverse_kinematics(markers=mat_cluster[:3, :, :]*0.001,
# method=InverseKinematicsMethods.BiorbdKalman)
b = bioviz.Viz(loaded_model=model, show_markers=True)
b.load_movement(q)
b.load_experimental_markers(all_mark[:3, :, :]*0.001)
b.exec()

should_continue = True
while should_continue:
for i, b in enumerate(all_bioviz):
if b.vtk_window.is_active:
b.update()
else:
should_continue = False
# b.exec()
# bioviz.Kinogram()
Binary file added stl_files/cluster.STL
Binary file not shown.
Binary file added stl_files/counter_weight.STL
Binary file not shown.
Binary file added stl_files/inferior_angle_wand.STL
Binary file not shown.
Binary file added stl_files/pivot.STL
Binary file not shown.
Binary file added stl_files/pointer.STL
Binary file not shown.
Binary file added stl_files/pointing_collar.STL
Binary file not shown.
Binary file added stl_files/rgbd_markers.STL
Binary file not shown.
Binary file added stl_files/spine_wand.STL
Binary file not shown.

0 comments on commit 52d642f

Please sign in to comment.