This repository is used for sharing a MATLAB toolbox that enables researcher in biomechanics to modify their generic musculoskeletal models by applying arbitrary torsional profiles to the long axis of the bone model.
The MATLAB tool works with musculoskeletal models in the format provided for the software for biomechanical analyses OpenSim.
The tool is introduced and described in the following publication, which we invite you to cite if you are using the content of this repository for your research or teaching:
@article{Modenese2021bonedef,
title={Dependency of Lower Limb Joint Reaction Forces on Femoral Version},
author={Luca Modenese, Martina Barzan and Christopher P. Carty},
journal={Gait & Posture},
volume = {88},
pages = {318-321},
doi = {https://doi.org/10.1016/j.gaitpost.2021.06.014},
year={2021},
keywords = {Femoral version, Femoral anteversion, Musculoskeletal modeling, Tibiofemoral contact force, Knee Loading, Femur, Walking}
}
The paper is open access and all the materials and scripts used for that manuscript are available at this repository. Please note that version of the tool used in the reproducibility repository is v0.1, while the latest version is always recommended for new users.
In order to use the bone deformation tool you will need to:
The tool should be able to detect the version of your installed OpenSim API automatically, so you do not have to modify anything related to this toolbox if you are using OpenSim 3.3.
In order to run the bone deformation tool you will need to specify variable in the example scripts, or in your own scripts:
OpenSim_Geometry_folder
)bone_to_deform
)torsionAxis
)TorsionProfilePointsDeg
)apply_torsion_to_joints
)altered_models_folder
)The bone deformation tool will execute the following operations:
vtp
file according to the specified rotational profilevtp
format and save it in the same folderWe tested the MATLAB tool with two popular lower limb models:
gait2392
model distributed with OpenSim Rajagopal full-body model
published by Rajagopal et al. (2016).
The latter model was used in the publication associated with this repository and to produce the images in this document.Please consider that the formulation of the tool is however completely generic in its managing the OpenSim model components, so nothing prevents you from testing it on other bones and models, including upper limb models.
The generic OpenSim model are provided with bone geometry for visualization purposes, and it is possible to estimate the femoral version and tibial rotation using their geometry. We have estimated the following angles as in Strecker et al. (1997)
For the full-body model by Rajagopal et al. we found:
12 degrees
28 degrees
The reference systems that we constructed for the estimation of these angles are available in the folder baseline-angles-estimation-Rajagopal and can be visualized using NMSBuilder.
WARNING the bone geometries provided with the OpenSim models are normally of low quality, not comparable with those obtainable from segmentation of CT scans, for example. Estimation of these rotational angle is therefore challenging.
Knowledge of the bone rotation for the baseline model is essential because the bone deformation prescribed with this deformation tool will be added to the existing bone rotation.
It is possible to modify the femoral anteversion of a generic model as in the figure below.
If you want, for example, to generate a model with 40 degrees of femoral anteversion, you can apply a 28 degrees of rotation to the proximal femur of generic model, which we have estimated to have a baseline femoral anteversion of 12 degrees.
The typical setting in the main script would then be:
%--------------- MAIN SETTINGS -----------
% Model to deform
modelFileName = './test_models/Rajagopal2015.osim';
% where the bone geometries are stored
OSGeometry_folder = './Geometry';
% body to deform
bone_to_deform = 'femur_l';
% axis of deformation
torsionAxis = 'y';
% define the rotation at the joint centre of the specified bone
% TorsionProfilePointsDeg = [ proximalTorsion DistalTorsion ];
TorsionProfilePointsDeg = [ 28 0 ];
% decide if you want to apply the rotation to joint as well as other objects.
apply_torsion_to_joints = 'no';
For applying a distal femoral torsion it is necessary to specify also that the torsion will be applied to the joints with the setting apply_torsion_to_joints = 'yes'
.
The typical setting would be:
%--------------- MAIN SETTINGS -----------
% Model to deform
modelFileName = './test_models/Rajagopal2015.osim';
% where the bone geometries are stored
OSGeometry_folder = './Geometry';
% body to deform
bone_to_deform = 'femur_l';
% axis of deformation
torsionAxis = 'y';
% define the torsion at the joint centre of the specified bone
% TorsionProfilePointsDeg = [ proximalTorsion DistalTorsion ];
TorsionProfilePointsDeg = [ 0 -30 ];
% decide if you want to apply torsion to joint as well as other objects.
apply_torsion_to_joints = 'yes';
Exactly the same setting can be used for applying a distal tibial torsion, with the only difference being
% body to deform
bone_to_deform = 'tibia_l';
The resulting tibial torsion will be 2 degrees.
We have provided example scripts that demonstrate how to modify the geometry of femur and tibia in the gait2392 and Rajagopal models:
Example_deform_distal_femur_gait2392.m
Example_deform_distal_femur_Rajagopal.m
Example_deform_distal_tibia_gait2392.m
Example_deform_distal_tibia_Rajagopal.m
The models resulting from these scripts, together with the bone geometries for visualizing the Rajagopal model, are available in the `examples' folder.
Luca gave a talk at the 26th Congress of the European Society of Biomechanics presenting the paper associated with the bone deformation tool. Click on the image below to see the recorded:
We welcome any contribution from the biomechanical and open source community, in any form. Few tips for contributing:
Many thanks to Axel Koussou and Emmanuelle Renoul from Fondation Ellen Poidatz (St-Fargeau-Ponthierry, France) for helping with the tool upgrade to OpenSim 4.1.