pyCGM_Single.pycgmIO.loadData

pyCGM_Single.pycgmIO.loadData(filename, rawData=True)

Loads motion capture data from a csv or c3d file.

Either a csv or c3d file of motion capture data can be used. loadCSV or loadC3D will be called accordingly.

Parameters
filenamestr

Path of the csv or c3d file to be loaded.

Returns
dataarray

data is a list of dict. Each dict represents one frame in the trial.

Examples

RoboResults.csv and RoboResults.c3d in SampleData are used to test the output.

>>> csvFile = 'SampleData/Sample_2/RoboResults.csv'
>>> c3dFile = 'SampleData/Sample_2/RoboStatic.c3d'
>>> csvData = loadData(csvFile)
SampleData/Sample_2/RoboResults.csv
>>> c3dData = loadData(c3dFile)
SampleData/Sample_2/RoboStatic.c3d

Testing for some values from the loaded csv file.

>>> csvData[0]['RHNO'] 
array([-772.184937, -312.352295, 589.815308])
>>> csvData[0]['C7'] 
array([-1010.098999, 3.508968, 1336.794434])

Testing for some values from the loaded c3d file.

>>> c3dData[0]['RHNO'] 
array([-259.45016479, -844.99560547, 1464.26330566])
>>> c3dData[0]['C7'] 
array([-2.20681717e+02, -1.07236075e+00, 1.45551550e+03])