You are viewing the documentation for OpenSim 3.x. Are you looking for the latest OpenSim 4.0 Documentation?

How Scaling Works

The topics covered in this section include:

Overview

Scaling is performed based on a combination of measured distances between x-y-z marker locations and manually-specified scale factors. The marker locations are usually obtained using motion capture equipment. The unscaled model has a set of virtual markers placed in the same anatomical locations as the experimental markers.

The dimensions of each segment in the model are scaled so that the distances between the virtual markers match the distances between the experimental markers. Manual scale factors, which may come from other anthropometric analyses, can also be used as an alternative to the measurement-based scaling for any body segment. 

Once the dimensions of the segments have been scaled to match the subject, the Scale Tool can be used to move some or all of the virtual markers on the model so that they coincide with the experimental marker locations.


Experimental and Virtual Markers. Experimental marker positions are measured with motion capture equipment (dark blue). Virtual markers are placed on a model in anatomical correspondence (e.g., over the right anterior superior iliac spine (R.ASIS)). Distances between experimental markers (ei) relative to the distances between corresponding virtual markers (mi) are used to compute scale factors.

Scaling

The scaling step scales the mass properties (mass and inertia tensor) of the model, as well as the dimensions of the body segments. Many of the elements attached to the body segments, such as muscle actuators and wrapping objects are also scaled. The scaling algorithm uses a multi-stage process and each stage is described in more detail below.

1 - Computing Scale Factors

The first task involved in the scaling step is to compute the scale factors for each body segment. This can be accomplished using a combination of measurement-based and/or manual scaling.

Measurement-based Scaling

In measurement-based scaling, scale factors are determined by comparing distances between markers on the model and experimental marker positions provided in a .trc file (see Marker (.trc) Files for more information about .trc files). A single scale factor is computed using one or more marker pairs.

For example, suppose two marker pairs are used: p1={R.ASIS, R.Knee.Lat} and p2={L.ASIS, L.Knee.Lat}. The distance for pair 1 on the model (m1) is computed by placing the model in its default configuration (all joint angles get assigned their default values, as specified in the <default_value> property of <Coordinate> in the OpenSim model (.osim) file). The experimental distance between pair 1 (e1) is computed by looking at each frame of experimental marker data in the given .trc file, computing the distance between the pair for that frame, and taking the average across all frames in a user-specified time range. The scale factor due to pair 1 is then s1=e1/m1. If the markers were further apart in the .trc file than on the model, this indicates that the segment(s) in the model supporting these markers are too small. The overall scale factor is then the average of the scale factors computed due to all of the pairs (e.g., s=(s1+s2)/2 in this case, where s2 is the scale factor due to pair 2). This overall scale factor s can then be used to scale any segments, and along any combination of the X, Y, and Z axes.

Manual Scaling

As an alternative to computing scale factors using measured marker positions, it is possible to specify the x-y-z scale factors for a segment manually. This is useful if the actual scale factors for segments are known, or were computed using some alternative algorithm.

2 - Scaling the Model's Geometry Based on Computed Scale Factors

Next, the Scale Tool scales the model's geometry based on scale factors computed from measurements or provided manually by the user. The algorithm scales joint frame locations, mass center location, force application points, and muscle attachment points. Since each of these objects is represented in a specific body frame, the scale factors for the corresponding body are applied to scale the positions. For example, the distal soleus muscle attachment point is scaled according to the scaling factors for the shank segment. Wrapping Objects are scaled by the same scaling factors as the body they’re attached to.

3 - Scaling Mass and Inertial Properties 

The scale factors computed using measurement-based or manual scaling are used to scale the sizes of the segments. In addition, the masses of the segments are adjusted so that the total mass of the body equals the specified subject mass.

There are two different ways the individual segment masses may be adjusted. One approach is to preserve the mass distribution, which ensures that the masses of the subject-specific model segments are in the same proportion as they were in the generic model. This scales the masses using a constant factor independent of the scale factors that were used to scale the individual segment sizes. The alternative approach independently scales the mass of each body from the body scale factors though the summed mass of the bodies will most likely not equal the mass of the subject entered during scaling. 

In any case, the inertia tensor of each segment is updated to reflect its new size and mass.

4 - Scaling Muscles and Other Model Components that Depend on Length

Components in a model that depend on distances or lengths, like ligaments (as of version 3.3) and muscle actuators, are next updated. For example, a muscle’s new optimal_fiber_length and tendon_slack_length are computed during the scaling process. A scale factor is computed as the ratio of the length before scaling to the length after scaling and the result is used to scale the component's length-dependent properties. The process is complicated by the fact that parameters like a muscle's length are configuration dependent, thus OpenSim tries to maintain the model configuration across scaling.

As of OpenSim version 3.3, ligament geometry and resting length are also scaled by the Scale Tool. Some model components do not have a way to handle scaling (e.g. coupler-constraints and ligaments in versions 3.2 and earlier) and need to be scaled manually by the user.

Muscle strengths are not scaled during the scaling process, and any updates must also be made by the user.

Marker Placement

After scaling the model, the next step is to move the model's markers to match experimental marker locations in a static pose. The static pose is computed by trying to match some combination of experimental marker positions and generalized coordinate values, as in the inverse kinematics (IK) step (How Inverse Kinematics Works). The marker locations corresponding to the static pose are computed by averaging the marker positions in a given .trc file across a user-specified time range. Just like IK, marker and coordinate weights are used to determine how strongly the algorithm should try to match them. Once a static pose is computed using the IK-based algorithm, all model markers (except for those designated as fixed) are moved to the averaged "static pose" positions of the experimental markers.

 

OpenSim is supported by the Mobilize Center , an NIH Biomedical Technology Resource Center (grant P41 EB027060); the Restore Center , an NIH-funded Medical Rehabilitation Research Resource Network Center (grant P2C HD101913); and the Wu Tsai Human Performance Alliance through the Joe and Clara Tsai Foundation. See the People page for a list of the many people who have contributed to the OpenSim project over the years. ©2010-2024 OpenSim. All rights reserved.