The standard file format for Motion Capture and the biomechanics community is C3D. C3D is a flexible format that can store marker, forces, forceplate, EMG, and event data. Despite being very flexible, data on C3D files are stored as binary and requires specialized readers to access. To read more information on the C3D file format, we encourage you to visit the C3D.org to learn more.
From OpenSim 4.0 API includes methods for reading C3D data into OpenSim formatted files. The OpenSim C3DFileAdapter() class uses a forked version of Arnaud Barre's BTK package. Use of the C3DFileAdapter , C3D reading and conversion into OpenSim formats are available. Currently, use of C3D reading is limited to C++ and scripting with example code belowand we will be working to make GUI C3D reading native in future releases. The easiest way of using OpenSim to read 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 Matlab side class 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 format. The Matlab file can be found in your resources directory /Code/Matlab/c3dExportUtilities/osimC3D.m.
C3DFileAdapter()
To use the OpenSim classes directly, follow the code below. This code will give you OpenSim Times Series Tables for both markers and forcesAn example of using the osimC3D function is (expandable) below. Here we read a C3D file containing markers and forces, get some information about the data (rate, number of markers, number of forces), rotate the data, 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.
Expand | ||
---|---|---|
Expand | ||
|
osimC3D
We have included a Matlab side class 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 format. The Matlab file can be found in your resources directory /Code/Matlab/Utilities/osimC3D.m.
...
Some example code for using C3DFileAdapter through Python can be found below.
|
Example code for using the C3DFileAdapter in C++ is found below. This code is part of a test script that runs the C3D reader and checks for correct values.
Expand |
---|
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Next: Scaling Previous: Tools for Preparing Motion Data Home: Preparing Your Data |
...