pyCGM_Single.pycgmCalc.calcFrames

pyCGM_Single.pycgmCalc.calcFrames(data, vsk)

Calculates angles and joint values for given marker data

Parameters
dataarray of dict or array

List of xyz coordinates of marker positions in a frame. Each coordinate is a dict where the key is the marker name and the value is a 3 element array of its xyz coordinate. Can also pass as a 2 element array of [labels, data], where labels is a list of marker names and data is list of corresponding xyz coordinates.

vskdict or array

Dictionary containing subject measurement values, or array of labels and data [labels, data].

Returns
angles, jointstuple

angles is an array of the joint angle values. joints is an array of joint center locations. Indices correspond to frames in the trial.

Examples

First, we load motion capture data from Sample_Static.c3d and subject measurement values from Sample_SM.vsk in /SampleData/ROM/.

>>> from numpy import around
>>> from .pycgmIO import loadC3D, loadVSK
>>> from .pycgmStatic import getStatic
>>> from .pyCGM_Helpers import getfilenames
>>> filenames = getfilenames(x=2)
>>> c3dFile = filenames[1]
>>> vskFile = filenames[2]
>>> result = loadC3D(c3dFile)
>>> data = result[0]
>>> vskData = loadVSK(vskFile, False)
>>> vsk = getStatic(data,vskData,flat_foot=False)
>>> angles, joints = calcFrames(data, vsk)
>>> around(angles[0][0], 2)
-0.46
>>> around(joints[0]['Pelvis'], 2) 
array([ 246.15,  353.26, 1031.71])