Github Project

c3d2opensim

Matlab code for processing motion data into OpenSim ready files

Download this project as a .zip file

c3d2Opensim

Taking experimental c3d data to OpenSim format.

Quick Start

Matlab interface

Variables can be entered using a ('Variable Name',{variable}) construction. If variables are not specified, they will either not be used or be resolved with default settings.

Variable Name Variable Example Description
'c3dFilePath' 'C:\c3dfolder\example.c3d' The absolute path to a c3d file
'rotation' {'x' 90 'y' 90} Rotation axes and the rotation amount in degrees
'filter' {'mrks' 'butt' 16 'grf' 'critt' 40} The data type, filter type and cut-off to be used
'threshold' {5} Zero forces (Newtons) below this value
'mrklist' {'LTH1' 'LTH2' 'RTH1' 'RTH2' 'RTH3'} List of markers to be exported to .trc file.

Examples

Using the default command will open a dialogue box that allows you to select a c3d file to process. When done in this manner, a default rotation of 90 degrees about x is performed, no filtering of marker and forces,

c3d2Opensim

Using the ('Variable Name', {Variable}) input method, you can chain processing commands together. The code below specifies the file 'example.c3d', rotates all data 90 degrees about X then 90 degrees about Z, filters the markers with a butterworth filter at 16Hz and the ground reaction forces with a critically damped filter at 40Hz, and only exports the markers named LTH1, LTH2, RTH1, RTH2, RTH3.

c3d2Opensim( 'c3dFilePath','C:\c3dFolder\example.c3d', ...
             'rotation', {'x' 90 'z' 90}, ...
             'filter', {'mrks' 'butt' 16 'grf' 'critt' 40},...
             'mrkList', {'LTH1' 'LTH2' 'RTH1' 'RTH2' 'RTH3'});

The below code block uses 'example2.c3d', rotates the data 90 degrees about X and filters the ground reaction forces with a butterworth filter at 40Hz. No marker filtering occurs and all markers are exported.

c3d2Opensim( 'c3dFilePath','C:\path2c3dFile\example2.c3d', ...
             'rotation', {'x' 90}, ...
             'filter', {'grf' 'butt' 40});

Limitations and known issues

Acknowledgements

First, we would like to acknowledge Arnaud Barre and Stephane Armand for their wonderful BTK (Biomechanical Toolkit) software, which is used for c3d reading. We are sure that we are not leveraging it as much as we could. Please support the btk project.

Barre, A. Armand, S. (2014) Biomechanical ToolKit: Open-source framework to visualize and process biomechanical data. Computer methods and programs in biomedicine. 114:1 Page: 80 - 87

We would also like to acknowledge Thor Besier (U Ackland), Cyril Donnelly (U Western Australia) and Glen Litchwark (U Queensalnd) for their significant code contributions to the c3d2OpenSim pipeline.

Licensing

The MIT License (MIT)

Copyright (c) 2015 James Dunne

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.