pyCGM_Single.pyCGM.hipAxisCenter

pyCGM_Single.pyCGM.hipAxisCenter(l_hip_jc, r_hip_jc, pelvis_axis)

Calculate the hip center axis and hip axis.

Takes in the left and right hip joint center of x,y,z positions and pelvis origin and axis, and calculates and returns the hip center and axis.

Hip center axis: Midpoint of left and right hip joint centers.

Hip axis: sets the pelvis orientation to the hip center axis (i.e. midpoint of left and right hip joint centers)

Parameters
l_hip_jc, r_hip_jcarray

left and right hip joint center with x, y, z position in an array.

pelvis_axisarray

An array of pelvis origin and axis. The first element is an 1x3 array containing the x, y, z axis of the origin. The second elemnt is a 3x3 containing 3 arrays of x, y, z coordinates of the individual pelvis axis.

Returns
hipaxis_center, axisarray

Returns an array that contains the hip axis center in a 1x3 array of xyz values, which is then followed by a 3x1x3 array composed of the hip axis center x, y, and z axis components. The xyz axis components are 1x3 arrays consisting of the x, y, z pelvis axes added back to the hip center.

Examples

>>> import numpy as np
>>> from .pyCGM import hipAxisCenter
>>> r_hip_jc = [182.57, 339.43, 935.52]
>>> l_hip_jc = [308.38, 322.80, 937.98]
>>> pelvis_axis = [np.array([251.60, 391.74, 1032.89]),
...                np.array([[251.74, 392.72, 1032.78],
...                    [250.61, 391.87, 1032.87],
...                    [251.60, 391.84, 1033.88]]),
...                np.array([231.57, 210.25, 1052.24])]
>>> [np.around(arr,2) for arr in hipAxisCenter(l_hip_jc,r_hip_jc,pelvis_axis)] 
[array([245.48, 331.12, 936.75]), array([[245.62, 332.1 , 936.64],
[244.48, 331.24, 936.73],
[245.48, 331.22, 937.74]])]