pyCGM_Single.Pipelines.transform_from_mov¶
-
pyCGM_Single.Pipelines.
transform_from_mov
(data, key, clust, last_time, i)¶ Use motion data for gap filling.
Uses previous positions of markers to estimate locations of missing markers.
- Parameters
- dataarray
Array of dictionaries of marker data.
- keystr
String representing the missing marker.
- clustarray
Array of other markers in the same cluster as the missing marker.
- last_timeint
Frame number of the last frame that the marker is not missing.
- iint
Frame number that the marker data is missing for.
- Returns
- array
Location of the missing marker in the world frame. List of 3 elements.
Examples
>>> from .pyCGM_Helpers import getfilenames >>> 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 >>> around(motionData[2]['LFHD'], 2) array([-1003.42, 81.05, 1522.14]) >>> motionData[2]['LFHD'] = array([nan, nan, nan]) #clear one frame to test gap filling >>> data = dataAsDict(motionData,npArray=True) >>> key = 'LFHD' >>> clust = ['RFHD', 'RBHD', 'LBHD'] #Other markers in the cluster >>> last_time = 1 >>> i = 2 >>> around(transform_from_mov(data,key,clust,last_time,i), 2) array([-1003.42, 81.05, 1522.13])