pyCGM_Single.pyCGM.footJointCenter

pyCGM_Single.pyCGM.footJointCenter(frame, vsk, ankle_JC, knee_JC, delta)

Calculate the foot joint center and axis.

Takes in a dictionary of marker names to x, y, z positions, subject measurements and the ankle joint center. Calculate the foot joint axis by rotating incorrect foot joint axes about offset angle.

In case of foot joint center, we’ve already make 2 kinds of axis for static offset angle. and then, Call this static offset angle as an input of this function for dynamic trial.

Special Cases:

(anatomical uncorrect foot axis) if foot flat is checked, make the reference markers instead of HEE marker which height is as same as TOE marker’s height. elif foot flat is not checked, use the HEE marker for making Z axis.

Markers used: RTOE, LTOE Other landmarks used: ANKLE_FLEXION_AXIS Subject Measurement values used: RightStaticRotOff, RightStaticPlantFlex, LeftStaticRotOff, LeftStaticPlantFlex

Parameters
framedict

Dictionaries of marker lists.

vskdict

A dictionary containing subject measurements.

ankle_JCarray

An array of ankle_JC containing the x,y,z axes marker positions of the ankle joint center.

knee_JCarray

An array of knee_JC containing the x,y,z axes marker positions of the knee joint center.

delta

The length from marker to joint center, retrieved from subject measurement file.

Returns
R, L, foot_axisarray

Returns an array that contains the foot axis center in a 1x3 array of xyz values, which is then followed by a 2x3x3 array composed of the foot axis center x, y, and z axis components. The xyz axis components are 3x3 arrays consisting of the axis center in the first dimension and the direction of the axis in the second dimension. This function also saves the static offset angle in a global variable.

Examples

>>> import numpy as np
>>> from .pyCGM import footJointCenter
>>> vsk = { 'RightStaticRotOff' : 0.01, 'LeftStaticRotOff': 0.00,
...         'RightStaticPlantFlex' : 0.27, 'LeftStaticPlantFlex': 0.20}
>>> frame = { 'RHEE': np.array([374.01, 181.57, 49.50]),
...           'LHEE': np.array([105.30, 180.21, 47.15]),
...           'RTOE': np.array([442.81, 381.62, 42.66]),
...           'LTOE': np.array([39.43, 382.44, 41.78])}
>>> knee_JC = [np.array([364.17, 292.17, 515.19]),
...           np.array([143.55, 279.90, 524.78]),
...           np.array([[[364.64, 293.06, 515.18],
...           [363.29, 292.60, 515.04],
...           [364.04, 292.24, 516.18]],
...           [[143.65, 280.88, 524.63],
...           [142.56, 280.01, 524.86],
...           [143.64, 280.04, 525.76]]])]
>>> ankle_JC = [np.array([393.76, 247.67, 87.73]),
...            np.array([98.74, 219.46, 80.63]),
...            [[np.array([394.48, 248.37, 87.71]),
...            np.array([393.07, 248.39, 87.61]),
...            np.array([393.69, 247.78, 88.73])],
...            [np.array([98.47, 220.42, 80.52]),
...            np.array([97.79, 219.20, 80.76]),
...            np.array([98.84, 219.60, 81.61])]]]
>>> delta = 0
>>> [np.around(arr, 2) for arr in footJointCenter(frame,vsk,ankle_JC,knee_JC,delta)] 
[array([442.81, 381.62,  42.66]), array([ 39.43, 382.44,  41.78]), array([[[442.84, 381.65,  43.66],
[441.87, 381.96,  42.68],
[442.47, 380.68,  42.7 ]],
[[ 39.56, 382.51,  42.77],
[ 38.49, 382.13,  41.92],
[ 39.74, 381.49,  41.8 ]]])]