pyCGM_Single.Pipelines.transform_from_static¶
-
pyCGM_Single.Pipelines.
transform_from_static
(data, static, key, useables, s)¶ Use static data for gap filling.
Uses data from static and clusters to fill estimate missing marker values. Only used for markers missing from frames in the start of the trial.
- Parameters
- dataarray
Array of dictionaries of marker data.
- staticarray
Array of static marker data.
- keystr
String representing the missing marker.
- useablesarray
Array of other markers in the same cluster as the missing marker.
- sint
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 .Pipelines import clearMarker >>> from numpy import around >>> from .pycgmIO import loadData, dataAsDict >>> dynamic_trial,static_trial,_,_,_ = getfilenames(x=3) >>> motionData = loadData(dynamic_trial) SampleData/Sample_2/RoboWalk.c3d >>> around(motionData[1]['LFHD'], 2) array([-1003.5 , 81.03, 1522.18]) >>> motionData = clearMarker(motionData, 'LFHD') #clear LFHD to test gap filling >>> staticData = loadData(static_trial) SampleData/Sample_2/RoboStatic.c3d >>> data = dataAsDict(motionData,npArray=True) >>> static = dataAsDict(staticData,npArray=True) >>> key = 'LFHD' >>> useables = ['RFHD', 'RBHD', 'LBHD'] #Other markers in the cluster >>> s = 1 >>> around(transform_from_static(data,static,key,useables,s), 2) array([-1007.74, 71.31, 1522.61])