Muscle Optimizer setup file¶
There are 7 properties that need to be specified in a Muscle Optimizer setup file:
- The model to which the Muscle Optimizer is to be applied;
- The model to use as reference;
- The coordinates to consider during the optimization process;
- The muscles for which optimized parameters will be calculated;
- The number of sampling points per coordinate;
- The minimum degree interval allowed when sampling coordinate ranges;
- The location where to write the optimized output model
A sample muscle optimizer setup file is provided in the example below:
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="30000">
<MuscleOptimizeTool name="Hamner_optimized_2">
<!--Notes for the subject.-->
<notes>Unassigned</notes>
<!--Specifies the name of the optimized model (.osim)-->
<model>MSK_Models/Target_Hamner_scaled_L.osim</model>
<!--Specifies the name of the reference model(.osim)-->
<reference_model>MSK_Models/Reference_Hamner_L.osim</reference_model>
<!--Specifies parameters for optimizing the muscle parameters for the model.-->
<MuscleOptimizer>
<!--Whether or not to use the model optimizer during optimization-->
<apply>true</apply>
<!--Specifies the coordinates (degrees of freedom) to consider
(default: ALL)-->
<coordinates />
<!--Specifies the muscles to consider (default: ALL)-->
<muscles> </muscles>
<!--Number of evaluation points for each degree of freedom-->
<n_evaluation_points>10</n_evaluation_points>
<!--Minimum degree interval when sampling a degree of freedom
(<=0 -> no limit check). Default value: 2.5 (degrees)-->
<min_degrees_increment>2.5</min_degrees_increment>
<output_model_file>
Optim_Models/cpp_Optimized_Hamner_scaled_L.osim
</output_model_file>
</MuscleOptimizer>
</MuscleOptimizeTool>
</OpenSimDocument>
Muscle Optimizer Execution Parameters¶
The parameters/properties for running the Muscle Optimizer tool are enclosed inside the opening and closing tags <MuscleOptimizeTool>
and </MuscleOptimizeTool>
. The name attribute name=”Hamner_optimized_2” can be used to specify the execution name, and it will be used as name for the optimized output model.
Model¶
The <model>
property specifies the file name of the OpenSim (.osim) model for which you want to optimize muscle parameters, so that the same operative range as a reference model is kept. Typically this will be a scaled model generated by the Scale Tool, or a subject-specific model generated from medical images.
Reference model¶
The <reference_model>
property specifies the file name of the OpenSim (.osim) model to be used as reference for muscle optimization, i.e. the operational ranges of muscles included in this model are used to calculate muscle parameters in the model defined at the previous point.
Coordinates¶
The <coordinates>
property specifies which coordinates to consider when optimizing muscle parameters. If the property is empty or is ALL, all input model coordinates are considered. Limiting the coordinate set might be useful to ignore degrees of freedom that are not relevant for the tasks that the optimized model will be employed for, thus reducing computation time and accuracy for the relevant degrees of freedom. Note that all the enabled coordinates must be present in both input and reference models.
Muscles¶
The <muscles>
property specifies for which muscles the optimization is to be performed. If the property is empty or is ALL, all input model muscles are considered. Note that all the enabled muscles must be present in both input and reference models.
Number of evaluation points¶
The <n_evaluation_points>
property is an integer specifying the number of sampling points to consider for each coordinate of the model that is involved in the action of a muscle. Default value: 10.
Minimum degree increment¶
The <min_degrees_increment>
property specifies the minimum interval between two consecutive sampling points on each coordinate. This is useful to avoid over-sampling on coordinates with a very small range, which might affect optimization on other coordinates with larger range of motion.
Output file¶
The <output_model_file>
property specifies the file name of the OpenSim (.osim) model that will be created after the optimization is completed.