Skip to content

Commit

Permalink
Adding in the harrington function the middle of the two hip joint cen…
Browse files Browse the repository at this point in the history
…ter to be able to use it in other function
  • Loading branch information
ANaaim committed Jul 27, 2023
1 parent b9c9ce3 commit f1c3d22
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/model_creation/right_side_lower_limb.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def harrington2007(RASIS: np.ndarray, LASIS: np.ndarray, RPSIS: np.ndarray, LPSI

rhjc_global = np.zeros((4, rasis.shape[1]))
lhjc_global = np.zeros((4, rasis.shape[1]))
mid_global = np.zeros((4, rasis.shape[1]))

for i in range(rasis.shape[1]):
provv = (rasis[:3, i] - Sacrum[:3, i]) / np.linalg.norm(rasis[:3, i] - Sacrum[:3, i])
Expand Down Expand Up @@ -96,13 +97,17 @@ def harrington2007(RASIS: np.ndarray, LASIS: np.ndarray, RPSIS: np.ndarray, LPSI
# transformation from pelvis to global CS
rhjc_global[:3, i] = Pelvis[:3, :3] @ rhjc_pelvis + OB
lhjc_global[:3, i] = Pelvis[:3, :3] @ lhjc_pelvis + OB
mid_global[:3, i] = (rhjc_global[:3, i] + lhjc_global[:3, i]) / 2

rhjc_global[:3, :] /= 1000
lhjc_global[:3, :] /= 1000
mid_global[:3, :] /= 1000

rhjc_global[-1, :] = 1
lhjc_global[-1, :] = 1
mid_global[-1, :] = 1

return rhjc_global, lhjc_global
return rhjc_global, lhjc_global, mid_global


def model_creation_from_measured_data(c3d_filename: str = "statref.c3d") -> BiomechanicalModel:
Expand Down

0 comments on commit f1c3d22

Please sign in to comment.