pyCGM_Single.pyCGM.shoulderAxisCalc¶
-
pyCGM_Single.pyCGM.
shoulderAxisCalc
(frame, thorax, shoulderJC, wand)¶ Calculate the Shoulder joint axis ( Clavicle) function.
Takes in the thorax axis, wand marker and shoulder joint center. Calculate each shoulder joint axis and returns it.
- Parameters
- framedict
Dictionaries of marker lists.
- thoraxarray
- The x,y,z position of the thorax.
- thorax = [[R_thorax joint center x,y,z position],
[L_thorax_joint center x,y,z position], [[R_thorax x axis x,y,z position], [R_thorax,y axis x,y,z position], [R_thorax z axis x,y,z position]]]
- shoulderJCarray
- The x,y,z position of the shoulder joint center.
- shoulderJC = [[R shoulder joint center x,y,z position],
[L shoulder joint center x,y,z position]]
- wandarray
- The x,y,z position of the wand.
- wand = [[R wand x,y,z, position],
[L wand x,y,z position]]
- Returns
- shoulderJC, axisarray
- Returns the Shoulder joint center and axis in three array
- shoulder_JC = [[[[R_shoulder x axis, x,y,z position],
[R_shoulder y axis, x,y,z position], [R_shoulder z axis, x,y,z position]], [[L_shoulder x axis, x,y,z position], [L_shoulder y axis, x,y,z position], [L_shoulder z axis, x,y,z position]]], [R_shoulderJC_x, R_shoulderJC_y, R_shoulderJC_z], [L_shoulderJC_x,L_shoulderJC_y,L_shoulderJC_z]]
Examples
>>> import numpy as np >>> from .pyCGM import shoulderAxisCalc >>> frame = None >>> thorax = [[[256.23, 365.30, 1459.66], ... [257.14, 364.21, 1459.58], ... [256.08, 354.32, 1458.65]], ... [256.14, 364.30, 1459.65]] >>> shoulderJC = [np.array([429.66, 275.06, 1453.95]), ... np.array([64.51, 274.93, 1463.63])] >>> wand = [[255.92, 364.32, 1460.62], ... [256.42, 364.27, 1460.61]] >>> [np.around(arr, 2) for arr in shoulderAxisCalc(frame,thorax,shoulderJC,wand)] [array([[ 429.66, 275.06, 1453.95], [ 64.51, 274.93, 1463.63]]), array([[[ 430.12, 275.94, 1454.04], [ 429.67, 275.15, 1452.95], [ 428.77, 275.52, 1453.98]], [[ 64.09, 275.83, 1463.78], [ 64.59, 274.8 , 1464.62], [ 65.42, 275.35, 1463.61]]])]