pyCGM_Single.Pipelines.segmentFinder

pyCGM_Single.Pipelines.segmentFinder(key, data, targetDict, segmentDict, j, missings)

Find markers in the same cluster as key.

Parameters
keystr

String representing the missing marker.

dataarray

Array of dictionaries of marker data.

targetDictdict

Dictionary of marker to segment.

segmentDictdict

Dictionary of segments to marker names.

jint

Frame number that the marker data is missing for.

missingsdict

Dictionary of marker to list representing which other frames the marker is missing for.

Returns
useablesarray

List of marker names in the same cluster as the marker key.

Examples

>>> from .pyCGM_Helpers import getfilenames
>>> from numpy import array, nan
>>> from .pycgmIO import loadData, dataAsDict
>>> from .clusterCalc import target_dict, segment_dict
>>> dynamic_trial,static_trial,_,_,_ = getfilenames(x=3)
>>> motionData = loadData(dynamic_trial)
SampleData/Sample_2/RoboWalk.c3d
>>> motionData[2]['LFHD'] = array([nan, nan, nan]) #clear one frame to test gap filling
>>> data = dataAsDict(motionData)
>>> key = 'LFHD'
>>> targetDict = target_dict()
>>> segmentDict = segment_dict()
>>> j = 2
>>> missings = {'LFHD': []} #Indicates that LFHD is not missing for any other frame
>>> segmentFinder(key, data, targetDict, segmentDict, j, missings)
['RFHD', 'RBHD', 'LBHD']