pyCGM_Single.pycgmCalc.JointAngleCalc

pyCGM_Single.pycgmCalc.JointAngleCalc(frame, vsk)

Joint Angle Calculation function.

Calculates the Joint angles of plugingait and stores the data in array Stores: RPel_angle = [] LPel_angle = [] RHip_angle = [] LHip_angle = [] RKnee_angle = [] LKnee_angle = [] RAnkle_angle = [] LAnkle_angle = []

Joint Axis store like below form

The axis is in the form [[origin], [axis]] Origin defines the position of axis and axis is the direction vector of x, y, z axis attached to the origin

If it is just single one (Pelvis, Hip, Head, Thorax)

Axis = [[origin_x, origin_y, origin_z],[[Xaxis_x,Xaxis_y,Xaxis_z],

[Yaxis_x,Yaxis_y,Yaxis_z], [Zaxis_x,Zaxis_y,Zaxis_z]]]

If it has both of Right and Left ( knee, angle, foot, clavicle, humerus, radius, hand)

Axis = [[[R_origin_x,R_origin_y,R_origin_z],
[L_origin_x,L_origin_y,L_origin_z]],[[[R_Xaxis_x,R_Xaxis_y,R_Xaxis_z],

[R_Yaxis_x,R_Yaxis_y,R_Yaxis_z], [R_Zaxis_x,R_Zaxis_y,R_Zaxis_z]], [[L_Xaxis_x,L_Xaxis_y,L_Xaxis_z], [L_Yaxis_x,L_Yaxis_y,L_Yaxis_z], [L_Zaxis_x,L_Zaxis_y,L_Zaxis_z]]]]

Parameters
framedict

Dictionaries of marker lists.

vskdict

A dictionary containing subject measurements.

Returns
r, jctuple

Returns a tuple containing an array that holds the result of all the joint calculations, followed by a dictionary for joint center marker positions.

Examples

>>> import numpy as np
>>> from .pyCGM import JointAngleCalc
>>> from .pycgmIO import loadC3D, loadVSK
>>> from .pycgmStatic import getStatic
>>> from .pyCGM_Helpers import getfilenames
>>> import os
>>> fileNames=getfilenames(2)
>>> c3dFile = fileNames[1]
>>> vskFile = fileNames[2]
>>> result = loadC3D(c3dFile)
>>> data = result[0]
>>> frame = result[0][0]
>>> vskData = loadVSK(vskFile, False)
>>> vsk = getStatic(data,vskData,flat_foot=False)
>>> results = JointAngleCalc(frame, vsk)[1]
>>> np.around(results['Pelvis'], 2)
array([ 246.15,  353.26, 1031.71])
>>> np.around(results['Thorax'], 2)
array([ 250.56,  303.23, 1461.17])
>>> np.around(results['Head'], 2)
array([ 244.9 ,  325.06, 1730.16])
>>> np.around(results['RHand'], 2)
array([ 770.93,  591.05, 1079.05])