pyCGM_Single.pycgmStatic.footJointCenter

pyCGM_Single.pycgmStatic.footJointCenter(frame, static_info, ankle_JC, knee_JC, delta)

Calculate the foot joint center and axis function.

Takes in a dictionary of xyz positions and marker names, the ankle axis and knee axis. Calculates the foot joint axis by rotating the incorrect foot joint axes about the offset angle. Returns the foot axis origin and axis.

In the case of the foot joint center, we’ve already made 2 kinds of axes for the static offset angle and then, we call this static offset angle as an input of this function for thedynamic trial.

Special Cases:

(anatomically uncorrected foot axis) If flat foot, make the reference markers instead of HEE marker whose height is the same as TOE marker’s height. Else use the HEE marker for making Z axis.

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

Parameters
framedict

Dictionary of marker lists.

static_infoarray

An array containing offset angles.

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 ankle_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_axislist

Returns a list that contain the foot axis’ (right and left) origin in 1x3 arrays of xyz values and a 2x3x3 list composed of the foot 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. This function also saves the static offset angle in a global variable.

Notes

Axis changes the following in the static info.

You can set the static_info with the button and this will calculate the offset angles. The first setting, the foot axis shows the uncorrected foot anatomical reference axis(Z_axis point to the AJC from TOE).

If you press the static_info button so if static_info is not None, then the static offset angles are applied to the reference axis. The reference axis is Z axis point to HEE from TOE

Examples

>>> import numpy as np
>>> from .pycgmStatic import footJointCenter
>>> frame = { 'RHEE': np.array([374.01, 181.58, 49.51]),
...           'LHEE': np.array([105.30, 180.21, 47.16]),
...           'RTOE': np.array([442.82, 381.62, 42.66]),
...           'LTOE': np.array([39.44, 382.45, 41.79])}
    >>> static_info = [[0.03, 0.15, 0],
    ...               [0.01, 0.02, 0]]
>>> knee_JC = [np.array([364.18, 292.17, 515.19]),
...           np.array([143.55, 279.90, 524.78]),
...           np.array([[[364.65, 293.07, 515.19],
...           [363.29, 292.61, 515.04],
...           [364.05, 292.24, 516.18]],
...           [[143.66, 280.89, 524.63],
...           [142.56, 280.02, 524.86],
...           [143.65, 280.05, 525.77]]])]
>>> ankle_JC = [np.array([393.76, 247.68, 87.74]),
...            np.array([98.75, 219.47, 80.63]),
...            [[np.array([394.48, 248.37, 87.72]),
...            np.array([393.07, 248.39, 87.62]),
...            np.array([393.69, 247.78, 88.73])],
...            [np.array([98.47, 220.43, 80.53]),
...            np.array([97.79, 219.21, 80.76]),
...            np.array([98.85, 219.60, 81.62])]]]
>>> delta = 0
>>> [np.around(arr,2) for arr in footJointCenter(frame,static_info,ankle_JC,knee_JC,delta)] 
[array([442.82, 381.62,  42.66]), array([ 39.44, 382.45,  41.79]), array([[[442.89, 381.76,  43.65],
        [441.89, 382.  ,  42.67],
        [442.45, 380.7 ,  42.82]],
       [[ 39.51, 382.68,  42.76],
        [ 38.5 , 382.15,  41.93],
        [ 39.76, 381.53,  41.99]]])]