Biomechanical ToolKit: Open-source framework to visualize and process biomechanical data

https://doi.org/10.1016/j.cmpb.2014.01.012Get rights and content

Abstract

C3D file format is widely used in the biomechanical field by companies and laboratories to store motion capture systems data. However, few software packages can visualize and modify the integrality of the data in the C3D file. Our objective was to develop an open-source and multi-platform framework to read, write, modify and visualize data from any motion analysis systems using standard (C3D) and proprietary file formats (used by many companies producing motion capture systems). The Biomechanical ToolKit (BTK) was developed to provide cost-effective and efficient tools for the biomechanical community to easily deal with motion analysis data. A large panel of operations is available to read, modify and process data through C++ API, bindings for high-level languages (Matlab, Octave, and Python), and standalone application (Mokka). All these tools are open-source and cross-platform and run on all major operating systems (Windows, Linux, MacOS X).

Introduction

Motion capture systems produce a large variety of data (3D marker trajectory, angular speed, linear acceleration) that is used in life sciences, animation, or engineering domains. For the biomechanical community, these data are often coupled and synchronized with other devices such as force-plates and EMG systems. These data are the basis for most computations and analysis in biomechanics [1], [15], [25], [34]. It is used to compute kinematic and kinetic data during different movements or to analyze muscle activity in different applications such as clinical gait analysis (a standardized clinical examination that involves measurement of a patient's gait pattern in order to identify and understand gait deviations, with the final aim of supporting therapeutic decisions) (CGA) [28] and musculoskeletal modeling [14]. To support sharing and development of applications based on this type of data, it was necessary to standardize the data storage of all the raw data as well as other information required to interpret it. In the 1980s, the company Motion Lab Systems (Baton Rouge, USA) proposed to use a unique file format named C3D [30]. This file format can embed raw coordinates of 3D points, raw analog data, system configuration (EMG channel, force plate, etc.), trial information (sample rate, date, filename, etc.), subject information (name, age, physical parameter), and computed data (angle, moment, power, EMG envelope, etc.).

Whereas the C3D file format is a must in biomechanics due to its storage facilities, very few companies use it as their main file format, while others companies use their own proprietary file formats. This point limits greatly the potential to share data between laboratories that have different acquisition systems. Nevertheless, some companies propose to export data into the C3D file format. However, the C3D file cannot be read afterward by their software. This restricts the potential for sharing or reusing data. Other companies propose to export data into readable ASCII file formats (e.g., CSV, TXT, DAT) but the conversion to a C3D file using an external software application is then more difficult due to the large possibilities in the storage structures of the ASCII file formats. Another limitation is the development of software packages with specialized data processing. Companies often propose in their software the possibility to compute joint kinematics and kinetics based on specific biomechanical models [9], [16]. However, they could not integrate the last published biomechanical developments and many scientists in biomechanics prefer to use the raw data and their own models and computation methods. Having easy and fast access to raw data from any file format is primordial for the biomechanical community where the C3D file format will be used to share contents.

Furthermore, the need to standardize and visualize data has already been recognized in biomechanics [23]. In the field of the musculo-skeletal modeling, open-source and multi-platform software applications are used (OpenSim [10], OpenMaf [34], and NMS Physiome [32]). They give the opportunity for the community to work on sharable musculo-skeletal models but also on the underlying algorithms which can be improved in a standardized way. Regarding CGA, a web-based repository has been proposed to facilitate the sharing of gait data [33]. This web-based software provides the ability to upload C3D file onto a remote server and compare gait patterns with other uploaded data. However, for ethical reasons, not everyone is able to transfer and share patients’ data. A standalone application would be more appropriate, but no open-source project related to CGA proposes such a tool. Numerous advantages can be identified in a standardized and open-source approach [12]: quality assurance, sharing data, collaborative research, education, clinical consultation and improvement of data analysis. This would be beneficial for the community around CGA.

Some software packages, independent of acquisition systems, can visualize and process the C3D file format. These packages can be split in two categories: (1) standalone applications for the end user and; (2) software development kit (SDK) for programmers. For the first category, three products are known to display or process the content of a C3D file. The Windows applications MLSviewer (Motion Lab Systems, Baton Rouge, USA) [20] and C3Deditor (Motion Lab Systems, Baton Rouge, USA) [5] can display the structure of a C3D file and plot data into a 2D chart. The latter has also signal-processing features (e.g., low/high/band filters and gap filling). However, without the possibility to display marker trajectories and force platform data into a 3D environment, a full analysis of biomechanical data would be lacking. Another standalone Windows application (Visual3D, C-Motion, Germantown, USA) [35] offers the possibility to visualize and modify the integrality of the C3D file. However, this application goes beyond the requirements and the budgets of many people or laboratories, who only want to visualize and/or process raw signals. For the second category, one SDK was found (C3Dserver, Motion Lab Systems, Baton Rouge, USA) [6] to give access to C3D content from several programming languages (C++, C#, Excel, Matab, Labview). However, this SDK works only on Microsoft Windows 32-bit due to the use of the Microsoft component object model (COM). Moreover, accessing the data configuration (markers’ label, analog's offset, events’ time, etc.) requires knowledge of the exact internal structure of the C3D format. Other Matlab (Mathworks, Natick, USA) and Labview (National Instruments, Austin, USA) packages exist but they rely on the C3Dserver SDK. No SDK was found for the open-source programming languages Octave [21] and Python [24], which are today widely used in scientific applications [38].

Although the standardized C3D file format already exists in the biomechanics field, the software solutions associated with this file format and its availability for the biomechanical community needs to be improved. This is particularly true for facilitating data exchange between laboratories, and to bridge the gap between motion analysis software and scientific software. Therefore, our objective was to develop and disseminate free, open-source, and cross-platform framework able to read, to visualize and to process biomechanical data based on standard and proprietary file formats.

Section snippets

Framework presentation

The general picture of the framework is presented in Fig. 1. C++ is chosen as the programming language for the development due the possibility of directly generating machine code compared to other languages such as Java, C#, or Python which generate byte code executed by a virtual machine (i.e., interpreter). The C language was not taken into consideration as the authors wanted an object-oriented language to facilitate the writing of the application programming interface (API). The project

BTK core

Currently, more than 20 files format coming from the most used motion analysis systems are implemented (Table 1).

Matlab and octave bindings

More than 100 high level functions are implemented to access to the acquisition data or to transform then. Each part of an acquisition (points, analog channels, events, metadata) can be accessed and modified. Others functions gave a simple way to merge proprietary file formats and create a C3D file (Fig. 2).

Python bindings

All the C++ classes are wrapped in Python namespace ‘btk’ and use the same

Discussion

With this work we have presented a new open-source and cross-platform framework to visualize and process biomechanical data in a cost-effective and efficient manner useable as a standalone application or integrated in scientific applications. Commercial tools already exist as standalone application (Visual3D) or bindings for other languages (C3DServer) to process C3D files. However, these tools are expensive or need to know exactly the internal structure of the C3D file format to access to data

Conflict of interest statement

We do not have any financial or personal relationships with other individuals or organizations that could inappropriately influence our article.

Acknowledgements

We acknowledge all the persons who contributed to this project: Alice Bonnefoy-Mazure, Raphael Dumas, Fabien Leboeuf, Mathieu Lempereur, Florent Moissonet, Didier Pradon, Vincent Pomero, Patrick Salvia, Katia Turcot and the SOFAMEA (Francophone Society of Movement Analysis in Children and Adults). We acknowledge also all the companies which send us code, documentation or software license to integrate their file format or to compare results: AMTI, BTS Bioengineering, Codamotion, Delsys Inc. and

References (38)

  • M. Yang et al.

    iGAIT: an interactive accelerometer based gait analysis system

    Comput. Methods Programs Biomed.

    (2012)
  • J. Blanchette et al.

    C++ GUI Programming with Qt 4

    (2006)
  • S.L. Delp et al.

    OpenSim: open-source software to create and analyze dynamic simulations of movement

    IEEE Trans. Biomed. Eng.

    (2007)
  • Cited by (156)

    • Dataset of lower extremity joint angles, moments and forces in distance running

      2022, Heliyon
      Citation Excerpt :

      While validating the raw dataset from the current study, the detailed information concerning the experimental protocol and instruments employed for data collection showed consistency with recent literature of running studies [11, 24, 46, 78]. The gap in the marker trajectory and ground reaction forces were visually checked in the Vicon Nexus and Mokka BTK software [79] in C3D files. In terms of the pre-processed ready-for-use dataset in well-organized matrix, the joint angles in the sagittal plane of lower extremity joints (hip, knee and ankle) were plotted and compared against literatures.

    View all citing articles on Scopus
    View full text