pyCGM_Single.pyCGM.headJC

pyCGM_Single.pyCGM.headJC(frame, vsk=None)

Calculate the head joint axis function.

Takes in a dictionary of marker names to x, y, z positions. Calculates the head joint center and returns the head joint center and axis.

Markers used: LFHD, RFHD, LBHD, RBHD Subject Measurement values used: HeadOffset

Parameters
framedict

Dictionaries of marker lists.

vskdict, optional

A dictionary containing subject measurements.

Returns
head_axis, originarray

Returns an array containing a 1x3x3 array containing the x, y, z axis components of the head joint center, and a 1x3 array containing the head origin x, y, z position.

Examples

>>> import numpy as np
>>> from .pyCGM import headJC
>>> vsk = { 'HeadOffset': 0.25 }
>>> frame = {'RFHD': np.array([325.82, 402.55, 1722.49]),
...          'LFHD': np.array([184.55, 409.68, 1721.34]),
...          'RBHD': np.array([304.39, 242.91, 1694.97]),
...          'LBHD': np.array([197.86, 251.28, 1696.90])}
>>> [np.around(arr, 2) for arr in headJC(frame,vsk)] 
[array([[ 255.21,  407.11, 1721.83],
[ 254.19,  406.14, 1721.91],
[ 255.18,  406.2 , 1722.91]]), array([ 255.18,  406.12, 1721.92])]