...
Starting with OpenSim 4.0, C3D reading and conversion into OpenSim formats is available. Currently, use of C3D reading is limited to C++ and scripting and we will be working to support direct C3D reading in the GUI in future releases. The easiest way to use OpenSim to read your C3D data is through the Matlab interface. Once you have setup OpenSim use in Matlab, you can read C3D files and write marker and force data to .trc and .mot file formats, easily.
Reading C3D files through Matlab
osimC3D
We have included a utility in Matlab that can be used to perform some common operations, such as rotating data, converting data into Matlab data types, and writing marker and force data to OpenSim file formats. The Matlab file can be found in your resources directory /Code/Matlab/Utilities/osimC3D.m. An example of using the osimC3D function is in the expandable section below. In this example we
- read a C3D file containing markers and forces,
- get some information about the data (rate, number of markers, and number of forces),
- rotate the data, and
- then write the markers to a .trc file, and the forces to a .mot file.
Expand |
---|
Reading C3D files through Python and C++
Some example code for using C3DFileAdapter through Python can be found below. This code is part of a test script that runs the C3D reader and writes data marker and force data to a storage (.sto) file.
...