pyCGM_Single.pycgmStatic.hipAxisCenter¶
-
pyCGM_Single.pycgmStatic.
hipAxisCenter
(l_hip_jc, r_hip_jc, pelvis_axis)¶ Calculate the hip joint axis function.
Takes in a hip joint center of x,y,z positions as well as an index. and takes the hip joint center and pelvis origin/axis from previous functions. Calculates the hip axis and returns hip joint origin and axis.
Hip center axis: mean at each x,y,z axis of the left and right hip joint center. Hip axis: summation of the pelvis and hip center axes.
- Parameters
- l_hip_jc, r_hip_jc: array
Array of R_hip_jc and L_hip_jc each x,y,z position.
- pelvis_axisarray
An array of pelvis origin and axis. The axis is also composed of 3 arrays, each contain the x axis, y axis and z axis.
- Returns
- hipaxis_center, axislist
Returns a list that contains the hip axis center in a 1x3 list of xyz values, which is then followed by a 3x2x3 list composed of the hip axis center x, y, and z axis components. The xyz axis components are 2x3 lists consisting of the axis center in the first dimension and the direction of the axis in the second dimension.
Examples
>>> import numpy as np >>> from .pycgmStatic import hipAxisCenter >>> r_hip_jc = [182.57, 339.43, 935.53] >>> l_hip_jc = [308.38, 322.80, 937.99] >>> pelvis_axis = [np.array([251.61, 391.74, 1032.89]), ... np.array([[251.74, 392.73, 1032.79], ... [250.62, 391.87, 1032.87], ... [251.60, 391.85, 1033.89]]), ... np.array([231.58, 210.25, 1052.25])] >>> [np.around(arr,8) for arr in hipAxisCenter(l_hip_jc,r_hip_jc,pelvis_axis)] [array([245.475, 331.115, 936.76 ]), array([[245.605, 332.105, 936.66 ], [244.485, 331.245, 936.74 ], [245.465, 331.225, 937.76 ]])]