pyCGM_Single.pyCGM.wristJointCenter¶
-
pyCGM_Single.pyCGM.
wristJointCenter
(frame, shoulderJC, wand, elbowJC)¶ Calculate the Wrist joint axis ( Radius) function.
Takes in the elbow axis to calculate each wrist joint axis and returns it.
- Parameters
- framedict
Dictionaries of marker lists.
- shoulderJCarray
The x,y,z position of the shoulder joint center.
- elbowJCarray
The x,y,z position of the elbow joint center.
- wandarray
The x,y,z position of the wand.
- Returns
- origin, axisarray
- Returns the Shoulder joint center and axis in three array
- return = [[R_wrist_JC_x, R_wrist_JC_y, R_wrist_JC_z],
[L_wrist_JC_x,L_wrist_JC_y,L_wrist_JC_z], [[[R_wrist x axis, x,y,z position], [R_wrist y axis, x,y,z position], [R_wrist z axis, x,y,z position]], [[L_wrist x axis, x,y,z position], [L_wrist y axis, x,y,z position], [L_wrist z axis, x,y,z position]]]]
Examples
>>> import numpy as np >>> from .pyCGM import wristJointCenter >>> frame = {'RSHO': np.array([428.88, 270.55, 1500.73]), ... 'LSHO': np.array([68.24, 269.01, 1510.10]), ... 'RELB': np.array([658.90, 326.07, 1285.28]), ... 'LELB': np.array([-156.32, 335.25, 1287.39]), ... 'RWRA': np.array([776.51,495.68, 1108.38]), ... 'RWRB': np.array([830.90, 436.75, 1119.11]), ... 'LWRA': np.array([-249.28, 525.32, 1117.09]), ... 'LWRB': np.array([-311.77, 477.22, 1125.16])} >>> wand = [[255.92, 364.32, 1460.62], ... [256.42, 364.27, 1460.61]] >>> shoulderJC = [np.array([429.66, 275.06, 1453.95]), ... np.array([64.51, 274.93, 1463.63])] >>> elbowJC = [[np.array([633.66, 304.95, 1256.07]), ... np.array([-129.16, 316.86, 1258.06])], ... [[[633.81, 303.96, 1256.07], ... [634.35, 305.05, 1256.79], ... [632.95, 304.85, 1256.77]], ... [[-129.32, 315.88, 1258.00], ... [-128.45, 316.79, 1257.37], ... [-128.49, 316.72, 1258.78]]], ... [[793.32, 451.29, 1084.43], ... [-272.45, 485.80, 1091.36]]] >>> [np.around(arr, 2) for arr in wristJointCenter(frame,shoulderJC,wand,elbowJC)] [array([[ 793.32, 451.29, 1084.43], [-272.45, 485.8 , 1091.36]]), array([[[ 793.76, 450.45, 1084.12], [ 794.01, 451.39, 1085.15], [ 792.75, 450.76, 1085.05]], [[-272.92, 485.01, 1090.96], [-271.73, 485.73, 1090.66], [-271.93, 485.19, 1091.96]]])]