pyCGM_Single.Pipelines.rigid_fill

pyCGM_Single.Pipelines.rigid_fill(Data, static)

Fills gaps in motion capture data.

Estimates marker positions from previous marker positions or static data to fill in gaps in Data.

Parameters
Dataarray

Array of dictionaries of marker data.

staticdict

Dictionary of marker data corresponding to a static trial.

Returns
dataarray

Array of dictionaries of marker data after gap filling is done.

Examples

>>> from .pyCGM_Helpers import getfilenames
>>> from .pyCGM import pelvisJointCenter
>>> from numpy import array, nan, around
>>> from .pycgmIO import loadData, dataAsDict
>>> dynamic_trial,static_trial,_,_,_ = getfilenames(x=3)
>>> motionData = loadData(dynamic_trial)
SampleData/Sample_2/RoboWalk.c3d
>>> staticData = loadData(static_trial)
SampleData/Sample_2/RoboStatic.c3d

Sacrum must be calculated for this file using pyCGM.pelvisJointCenter.

>>> for frame in motionData:
...     frame['SACR'] = pelvisJointCenter(frame)[2]

Testing gap filling.

>>> Data = dataAsDict(motionData,npArray=True)
>>> around(Data['LFHD'][2], 2) 
array([-1003.42, 81.05, 1522.14])
>>> Data['LFHD'][2] = array([nan, nan, nan]) #clear one frame to test gap filling
>>> static = dataAsDict(staticData,npArray=True)
>>> data = rigid_fill(Data, static)
>>> around(data['LFHD'][2], 2) 
array([-1003.42, 81.05, 1522.13])