Bodybuilder For Biomechanics
Bodybuilder For Biomechanics
BodyBuilder for
Biomechanics
Revision history
Created July 1995
Development version of VICON Editor and Modeller software (16 bit)
First update August 1995
Version 1.0 of VICON Editor and Modeller (16 bit) - limited release
Second update February 1996
Production version 2.0 (32 bit), renamed BodyBuilder
Third update April 1996
Production version 2.0 (32 bit), BodyLanguage manual separately bound
Fourth update February 1997
Production version 3.0, BodyLanguage manual re-integrated
Fifth update November 1997
Production version 3.5
Biomechanics edition
Intended Audience
This manual is intended for operators of VICON 370 systems who are familiar with Windows 95 or
Windows NT operating software, and with VICON 370 application software. Manuals for these
products are supplied separately
The following are registered trademarks or trademarks with registration pending:
Windows 95
Windows NT
i486, Pentium
IBM
Acclaim
Power Animator
Kinemation
SoftImage 3D
N-World
Lightwave 3D
Prisms
VICON, VICON 370, VICON 370E, VICON 140
BodyBuilder
BodyLanguage
DynaCal
Microsoft Corp.
Microsoft Corp.
Intel Corp.
International Business Machines Inc.
Acclaim Technologies Inc.
Alias Inc
Wavefront Inc
SoftImage Inc
Nichimen Graphics
NewTek
Side Effects Inc.
Oxford Metrics Ltd
Oxford Metrics Ltd
Oxford Metrics Ltd
Oxford Metrics Ltd
Contents
Introduction
Overview .................................................................................................................................. 1
Licensing .................................................................................................................................. 2
Computer Requirements ........................................................................................................... 2
Related Documentation and Technical Support........................................................................ 3
How to Use this Manual ........................................................................................................... 3
Software Installation................................................................................................................. 4
Using BodyBuilder
Workspace Window
21
Contents i
29
33
File Menu................................................................................................................................ 33
Open........................................................................................................................................ 33
Merge ...................................................................................................................................... 34
Close ....................................................................................................................................... 34
Save......................................................................................................................................... 34
Range to Save ......................................................................................................................... 35
Save As ................................................................................................................................... 36
Write C3D............................................................................................................................... 37
Axis Changing .......................................................................................................... 39
Write ASCII ............................................................................................................................ 39
Options ..................................................................................................................... 41
Previous Files.......................................................................................................................... 42
Preferences.............................................................................................................................. 42
43
Re-Sampling ........................................................................................................................... 62
65
69
77
Parameters .............................................................................................................................. 77
Starting Interactive Adjustment .............................................................................................. 77
Parameter List......................................................................................................................... 78
Adjusting Values .................................................................................................................... 79
Finishing IPA.......................................................................................................................... 80
81
Workspace Menu.................................................................................................................... 81
Select Centre........................................................................................................................... 81
Hide Trajectories .................................................................................................................... 81
Show Trajectories ................................................................................................................... 81
Hide Other Trajectories .......................................................................................................... 82
Hide All Trajectories .............................................................................................................. 82
Show All Trajectories............................................................................................................. 82
Toggle All Trajectories........................................................................................................... 82
Toggle Before Display............................................................................................................ 82
Version 3.5 BodyBuilder for Biomechanics
Contents iii
85
BodyLanguage
95
Overview................................................................................................................................. 95
Kinematic Modelling with BodyLanguage ............................................................................. 95
Before Starting ........................................................................................................................ 96
Writing the Model Script ........................................................................................................ 96
Verifying Model Scripts ........................................................................................... 96
Using Kinetic Data: Terms and Definitions ............................................................................ 97
Force ......................................................................................................................... 97
Moment..................................................................................................................... 98
Reaction.................................................................................................................... 98
Work and Energy...................................................................................................... 98
Power........................................................................................................................ 99
Moment of Inertia ..................................................................................................... 99
Applying the Model ................................................................................................................ 99
Displaying the Results ............................................................................................ 100
Objects
101
Expressions
109
Kinetic Modelling
125
Operators
135
Functions
Version 3.5 BodyBuilder for Biomechanics
141
Contents v
Macros
151
Other Expressions
153
155
169
Glossary of Terms
191
Index
195
vi Contents
Introduction
Overview
BodyBuilder for Biomechanics is a software package which enables the
user to:
Introduction 1
Licensing
It is intended that BodyBuilder for Biomechanics should be installed on
the PC Workstation which forms part of each VICON 370 motion
capture system. BodyBuilder for Biomechanics is hardware-protected,
meaning that you require a dongle (hardware key), issued by Oxford
Metrics, plugged into your computers parallel port, in order to run the
program.
Licensed users may wish to run additional copies of BodyBuilder for
Biomechanics on other computers. This will require additional dongles,
even if those computers are part of the same local area network. For
additional dongles, refer to Oxford Metrics Ltd or local agent.
Computer Requirements
To run BodyBuilder for Biomechanics, you need a PC with a 486
(minimum) or Pentium (recommended) processor. The better your
processor and the faster your clock speed, the faster the program will
run. A substantial video memory is advisable, with PCI bus 800600
accelerated graphics, and at least 16MB RAM. A large hard disk
(recommended minimum 200MB, ideally 1GB)is essential; and a backup
device such as a ZIP or DAT drive is strongly recommended. A 32-bit
operating system, either Windows NT (recommended) or Windows 95 or
98, is required.
When large .C3D files are opened or generated, the computer may
require a very large swap file. This will cause slow running if your hard
disk does not have a significant amount of free space (as much as 60MB
may be needed). If you are using Windows 95, this may give the
appearance of hanging up; Windows NT behaves better in this respect,
and is the recommended operating system. Windows NT comes in two
versions, Server and Workstation. The Server version, as the name
implies, is intended for computers which are the hub of a network,
controlling shared resources, while the Workstation version is for
computers used for running applications such as BodyBuilder for
Biomechanics. Standalone computers should use the Workstation
version.
2 Introduction
This manual contains all the information which you need to use,
or learn to use, BodyBuilder for Biomechanics.
If you are a new user, you should read this chapter, which contains
general information about the software, and then install the software if
that has not already been done. You should also read the next chapter,
Using BodyBuilder, which is a brief introduction to the BodyBuilder
program. The following ten chapters contain detailed reference material
relating to BodyBuilder. Keep this section to hand when you start using
the program and need to look up information on specific points. The
following two chapters, about designing biomechanical models using
BodyLanguage, provide a general discussion of the principles of
modelling, and should be read by all users. The following seven chapters
contain detailed reference material about BodyLanguage.
It is possible to use BodyBuilder for Biomechanics without learning the
details of BodyLanguage, or writing models, because example models
are supplied. However, the flexibility of being able to write or modify
models is the most important feature for many users. Users who do not
Version 3.5 BodyBuilder for Biomechanics
Introduction 3
Software Installation
For all VICON-related software, the top level directory should be
C:\VICON
where C: is the local hard disk drive. Each application program should
have a subdirectory in the above top level directory, so BodyBuilder and
Reporter will be installed in the directories
C:\VICON\BODYBLD
and
C:\VICON\REPORTER
4 Introduction
Using BodyBuilder
Manipulating Data
BodyBuilder can be used for data editing without modelling. The editing
functions include filtering, interpolation, trajectory snipping and
deleting, trajectory copying and moving, re-sampling of trajectories to a
different sample frequency, and relabelling. These functions alone
provide a significant range of tools which may be used to improve data
which is imperfect (for example, interpolating short gaps, filtering of
high-frequency noise, and rectifying errors in the reconstruction and
initial labelling). These functions may be regarded as tools for cleaning
up previously unsatisfactory data. Often, these functions are used before
going on to modelling and data presentation.
The editing functions also allow the user to modify the data by moving
points, creating new trajectories, and otherwise making substantial
changes to the original data so that the output no longer represents what
Version 3.5 BodyBuilder for Biomechanics
Using BodyBuilder 5
model script. The results are then displayed in the Workspace window,
and may be saved (until saved, the newly calculated points are held only
in volatile system memory; the original data file on disk is not modified
unless the user chooses to overwrite it).
It is possible to make changes to a model script and immediately apply
the changed script to some data to see the effect. This allows rapid model
development and testing. It is also possible to make changes to the values
of parameters and to see the effects of these changes immediately in the
workspace, using interactive parameter adjustment.
When a model script has been fully developed, the text editor window
need not be displayed; the model can simply be loaded and run without
change.
Work Flow
The flexibility of BodyBuilder for Biomechanics allows the following
order to be changed according to needs, however this is the normal flow
of work when processing data using an existing model:
Using BodyBuilder 7
Static Trials
A common variation on the above procedure is the inclusion of a static
trial. This is a short data capture during which the subject remains still
(or nearly so) and is for the purpose of measuring certain parameters.
Users who need to produce Acclaim Skeleton Files use static captures for
this purpose. Static trials can also be used together with conditional parts
of a model script, to measure certain quantities and write them to the
parameter file, so that they are available when the dynamic data is
processed. In some cases, variations on the marker set are used for the
static trial. An example is the extra heel markers used during the static
trial required by VICON Clinical Manager (VCM) gait analysis software.
In that case, the purpose of the static trial is to allow the dynamic gait
analysis to take place using the minimum possible marker set.
In version 2.5 of VICON 370 software, it is possible to label data semiautomatically, having first manually labelled a static trial. The C3D (trial
data) files produced in this way retain information about the subject
name and the marker set used during auto-labelling, and whether the trial
was a static trial for auto-labelling purposes.
8 Using BodyBuilder
Workspace Window
Workspace Window 9
Selecting Trajectories
Up to 24 trajectories may be
selected at a time. Current
selections are lost when the
current trial is closed.
There is an aid, called the Mouse Helper, to assist selection. When the
tip of the pointer arrow is close enough to a trajectory to allow that
trajectory to be selected, a box appears on the pointer containing the
label and the field number of the point closest to the mouse pointer. If
the trajectory is unlabelled, the box contains a dash.
Use the View|Markers command to turn the marker display on and off.
If the user needs to label (or re-label) a trajectory or segment of a
trajectory, a .MKR file containing the desired label set must be made
available. Use the Model | Subject Settings... command to select a .MKR
10 Workspace Window
file with the required label names and stick connections between labelled
points. The initial .MKR file available when BodyBuilder is started, is
the one selected in the application preferences. This may not be
appropriate to the file you wish to edit. When editing a .MKR file, take
care to enter the correct number of labels and stick connections.
Some marker set files may contain several different display sets (that is,
different sets of sticks). These may be selected from the drop down list
above the list of markers at any time.
Stick connections may be defined which connect the points which result
from the reconstruction of real marker positions by VICON 370, and also
the virtual points created by a kinematic model. Sticks are displayed as
green lines.
Unlabelled trajectories and points are displayed in white. Labelled
trajectories and points are displayed in cyan. Selected trajectories are
displayed in a colour which depends on the order of selection. By
default, the length of trajectory displayed is one field either side of the
current field. The length displayed may be controlled by the user.
Initially, the trajectory
length displayed is one field
either side of the current
field.
Use the Before and After scroll bars in the lower right corner of the main
window to control the length of the trajectory display before and after
the current field.
If the Before and After slide bars are moved all the way to the left, no
trajectories are displayed in any Workspace window. The markers on the
current field may still be displayed, according to the setting of the View |
Markers command. In this state, trajectory selection is not possible in the
Workspace window.
Workspace Definition
Workspaces are built on an outlined and tiled floor that represents the
area or workspace where the kinematic data was collected. The size
and shape of the outline and tiles are automatically set and are not userselectable, as they are in VICON 370. This simplification has been made
in order to avoid a cluttered appearance in the window, and because
BodyBuilder is not concerned with kinetic (force) data.
Version 3.5 BodyBuilder for Biomechanics
Workspace Window 11
It is easiest to select the best point of view after stopping the replay of
moving points and sticks.
If the replay is running, you can stop it by pressing the spacebar.
Rotate about a vertical axis through the current centre of the image by
positioning the pointer anywhere within the dark area of the Workspace
window, holding down the left mouse button, and moving the mouse left
or right. The workspace rotates in the direction of mouse movement until
the pointer runs off the edge of the screen.
12 Workspace Window
Rotate about a horizontal axis by holding down the left mouse button and
moving the mouse up and down. The workspace rotates in the direction
of mouse movement. The viewpoint can move through a range which
takes it from directly underneath (yellow floor grid) to directly overhead
(white grid). In VICON 370 software, the viewpoint cannot be moved
below floor level or over the top of the workspace, since this would turn
the view upside down. In BodyBuilder, this potentially confusing point
of view is permitted, but should be used with caution.
Horizontal and vertical rotations can be combined in a single mouse
movement.
Workspace Window 13
Zoom by positioning the pointer anywhere within the dark area of the
Workspace window, hold down the right mouse button, and move the
pointer up to zoom-in or down to zoom-out. If the mouse pointer runs off
the edge of the screen, release the button, move the pointer back into the
screen, and repeat the zoom action. There is no theoretical limit to the
range of zoom that can be applied.
Rotations and zooms cannot be made simultaneously.
14 Workspace Window
The selected trajectory remains selected after centring. The chosen point
on a selected trajectory may not correspond to the current field. In the
above example, the selected trajectory is shown yellow; the chosen point
for centring is marked by a white cross. You cannot select a trajectory
until the mouse helper appears - this may take a few moments depending
on your PC.
Shortcut: C key
Hold the pointer steadily at the chosen point and click with the left
mouse button to select this point. If the trajectory segment is the
only one selected, it changes colour to yellow. If other trajectories
are already selected, another colour is used. Use the Workspace |
Select Centre command to make the selected point the new
rotation centre.
Workspace Window 15
Labels List
The .MKR file can be edited
using any text editing utility,
and is normally found in
the \MODELS directory.
If the Windows NOTEPAD
editor is used, remember to
Save any changes, and then
update the displayed list by
using the Edit | Attach
Marker Set... command.
It is not necessary to close
the NOTEPAD editor
between modifications as it
does not "lock the file.
On the right hand side of the main program window, there is space for a
list of labels. When a .C3D file is opened, if it was autolabelled, the
marker set used for labelling will be loaded. For a manually labelled
C3D file, if it is located in a session directory, BodyBuilder reads the
SES file and locates the corresponding MKR file.
If there is no such .MKR file, BodyBuilder displays the last label list
used in previous work. If this list is unavailable, the label list is blank.
If multiple .C3D files are open simultaneously, the list corresponding to
the currently active Workspace window is displayed.
If all Workspace and Graph Editor windows are closed, the list box is
blank. If a Text Editor window is active, the list box turns blank
temporarily.
If the list of labels is too long to be displayed in the box, a scroll bar is
displayed at the right allowing you to scroll up or down to see further
labels.
If you select a different (or edited) .MKR file, the new list appears and is
available for use immediately. Different .MKR files may be selected
using the Model | Subject Settings command.
The label box has three modes: Label, Select and Graph, chosen by
clicking on the relevant button at the bottom of the list.
When in Label mode, you can select a trajectory and click on the
appropriate label name to apply that label to the selected trajectory.
When in Select mode, you can click on a label name to select the
corresponding trajectory. When in Graph mode, you can click on a label
name to open a Graph Editor window for that trajectory (or change the
current Graph Editor window to the new trajectory).
16 Workspace Window
Label Mode
In BodyBuilder, it is unlikely
that you will find it
convenient to unlabel and
relabel more than one
trajectory at a time.
If you want to change the label of a segment, select and unlabel that
segment. It will then be displayed in white, and can be given a new label.
To label trajectories, ensure you are in Label mode, then select between
one and twenty-four unlabelled trajectories by clicking on each in turn,
using the left mouse button. Selected trajectories are highlighted
cyclically in yellow, red, purple, and blue. Next, click on the required
label for each trajectory, in the same order as the selection. Each
trajectory changes to cyan as it is labelled.
If a trajectory is broken, the same label should be applied to each
segment.
Workspace Window 17
Relabelling
The label of a trajectory or segment can be changed directly by selecting
it and clicking on the revised label in the Labels List.
Select Mode
In Select mode, click on a label in the list to select and highlight the
trajectory or segments with that label. Up to 24 trajectories can be
selected in this manner.
De-Selection
De-select trajectories by clicking the right mouse button while pointing
anywhere within the Workspace window.
Unlabelling
Use the Unlabel button to remove a label from a selected trajectory. Up
to 24 trajectories may be selected and unlabelled in sequence.
18 Workspace Window
Drag the slider on the central field number bar to move to an individual
video field. Single-step by clicking on the small arrow buttons at either
end of the slide bar.
Workspace Window 19
20 Workspace Window
Graph Editor
The Graph Editor window provides a range of tools allowing the user to
alter trajectories, move points, and to create new points and trajectories.
The Graph Editor window contains three graphs, which display the X, Y
and Z components of the selected trajectory, against time, and makes a
variety of tools available for manipulating the data.
In order to use these tools, you must have a .C3D file open. Although it
is possible to close the Workspace window and still use the Graph Editor
window to operate on the .C3D file, the two windows are designed to be
viewed together, vertically tiled within the main program window. There
are three methods of opening a Graph Editor window:
Select Graph mode at the bottom of the labels list, and then
click on the label corresponding to the trajectory you want to
alter. A new Graph Editor window opens, displaying the
components of the selected trajectory.
The second method can also be used to change the trajectory displayed in
an existing Graph Editor window. If a Graph Editor window is active
(with a highlighted title bar), you can use the second method to select an
alternative trajectory, which will replace the one currently displayed in
the active Graph Editor window. Alternatively, it is also possible to open
additional Graph Editor windows, using the Window | New Graph Editor
command, but multiple Graph Editor windows which are tiled will be too
small to be useful. It is recommended that only one Graph Editor window
is used at one time. Any operation which deletes the trajectory displayed
in a Graph Editor window will close that window.
Version 3.5 BodyBuilder for Biomechanics
The vertical red cursor indicates the current field, and in each graph the
current point is highlighted by a black square.
The top left corner of each graph shows the label of the trajectory (unless
it is a newly-created and unlabelled trajectory), the name of the
component (X, Y or Z), the units of the vertical scale marks and the
current field number.
If the current field number is changed, either by using the replay buttons,
the replay slider bar, or by clicking the left mouse button at a different
left-right position within the Graph Editor window, the red cursor will
move to the appropriate position. Any change in the current field, by any
means, will cause the replay slider bar, the Workspace window, and the
Graph Editor window, to be updated together.
Keyboard alternative: G
To change the time scale, position the pointer within the Graph Editor
window and press the right mouse button. Slide the pointer to the right to
expand the time scale. There is a limit on this expansion to prevent the
horizontal space between markers becoming too large. Slide the pointer
to the left to contract the time scale. A limit is reached when the display
scale is one pixel per field.
The horizontal time scale is the same on all three graphs within a single
Graph Editor window whichever component the pointer is positioned
over when the change is made. The red cursor remains static while the
time scale is changed.
It is also possible to move the graph display laterally, either using the
scroll bar at the bottom of the window, or by positioning the pointer
within the Graph Editor window, holding down both mouse buttons, and
moving the pointer left or right. This has the effect of dragging the
display. It is possible to continue dragging over the border of the Graph
Editor window, thus taking the current field out of view. All three
components move together during this adjustment.
Select the start of the range by making it the current field by any method
(eg. point and click within the Graph Editor window, or drag the replay
slider bar). The red cursor will indicate this point. Then position the
pointer within the Graph Editor window at the end of the desired range
and left-click while holding down the Control key. A green cursor will
appear over the selected end field.
In this example, the current field number (311) is shown above the field
numbers and the red cursor. The start and end points of the range (292
and 339) are shown below and with the two green cursors, and points
within the range are highlighted by black squares.
You can change the selected end field by repositioning the pointer and
repeating the Control-click. The second green cursor will move to the
new end field.
Each field within the range is highlighted by a black point, unless the
time scale is such that there is no space to show each point. In this case, a
reduced number of points within the range is shown. Use the scale
change and lateral drag features to fit the selected range to the size of the
window.
Once the start and end fields of the range have been selected, you can
change the current field without changing the start and end fields of the
range, by dragging the slider bar or by clicking on a highlighted point
within the range (on any of the three graphs). If you change the current
field, the red cursor will move from the start field of the range, to the
new current field. The start of the range will then be indicated by a green
cursor. However, if you change the current field by pointing and clicking
within the Graph Editor window (other than on a highlighted point), the
selected range will be dropped, and the new current field can be used as
the start of a different range.
The operations which can be carried out on the points within a range are
described in the chapter on Edit Menu commands.
Point Dragging
If the pointer is placed on a highlighted square, that co-ordinate can be
dragged by the mouse and dropped at a new value. This has the effect of
changing the chosen co-ordinate to a new value. The effect of point
dragging is displayed in the associated Workspace window, if one is
open.
In this example, the Z component of the point LFWT has been dragged
down. The effect this has on the data is displayed in the associated
Workspace window, in which the point is shown displaced downwards.
This form of point dragging is the simplest form of data manipulation
using the Graph Editor window. More sophisticated tools are available in
the Edit Menu.
For more details on point moving operations, see Move Point Mode.
Text Editing
Two types of file - .MOD and .MP - control the action of BodyBuilders
most important function, kinematic modelling. When developing
BodyLanguage models and adjusting parameters, it is often convenient to
work by a process of repeated trials, with small changes to the model or
parameter file tested immediately by application to typical data.
It would be possible to do this by using any standard text editor, such as
Notepad, saving the text file after each change, switching to BodyBuilder
by Alt-Tab, reloading the modified file, and then testing it. This would
be a laborious procedure if it involved more than a few repetitions.
A text editing window has been provided within BodyBuilder so that this
procedure can be carried out more efficiently.
File Menu
The File menu is always available while BodyBuilder is running,
although the options within it depend on whether a .C3D file is open.
The File menu can be accessed by pointing and clicking on the word
File, or by the keyboard alternative Alt-F.
Open
The File | Open command (keyboard alternative: Control-O) opens the
File Open browse box:
The default file type is .C3* and the desired file can be selected either by
clicking on its name and then on the OK button, or double-clicking on
the file name.
The File Open toolbar symbol is at the left end of the toolbar. The last
four files used are listed in the file menu for quick re-selection.
Merge
If a very long data capture has been carried out, creating a large .TVD
file, it may speed processing if it is cut into subsections before
reconstruction and labelling. This is because very long 3D files make
excessive demands of system memory. A utility is available with VICON
370 for this purpose. The result of reconstructing a divided .TVD file is
multiple .C3D files, and before kinematic modelling is carried out, it may
be necessary to merge these back into a single file. In order to carry out
this merging, begin by opening the first .C3D file in the normal way.
Then, use the Merge command. This opens a browse box similar to the
Open File browse box. The second .C3D file can be selected from this
browser. The contents of this file will be merged with the first.
Subsequent files are added in the same way.
Only files which belong together as part of the same data capture should
be merged, or there may be unpredictable results.
Close
The Close command (or its toolbar shortcut) has the effect of closing the
active window, whether it is a Workspace, Graph Editor, or Text Editor.
If the active window is a Workspace or Graph Editor, and there are other
windows displaying the same .C3D file, all will be closed.
Save
The Save command saves the the data in the currect trial, overwriting the
C3D file containing the original data. The data is saved in the same
format as the original file.
If a limited range of fields has been selected for saving, only the select
number of fields will be saved.
36 File Menu Commands
All data resulting from editing and modelling is written to file. Virtual
points created by modelling are flagged as such within the working
session in which they are created, and can be identified as such and
removed using the Delete Model Output command. However, once they
are written to file, the flag is lost and modelled points become
indistinguishable from any others.
Kinematic angles calculated by modelling are stored as angles, and will
be recognised as such when the file is read back in BodyBuilder or
Reporter. A new parameter POINT:ANGLES is used to identify them.
As with modelled points, they are flagged as model output when first
created. (Previous versions of BodyBuilder saved angles in a form
indistinguishable from points.)
Kinetic variables are also saved as trajectories in the file, and marked
according to their type. They are recognised when re-loaded in
BodyBuilder, and can be deleted by the Delete Model Outputs function.
Range to Save
The Range to Save command opens the Trial Save Range box:
By default, the save range is set to the whole length of the file. If, though,
only part of the data is of interest, it is possible to select a range of fields
which will be written to file when one of the commands Save As, Write
C3D or Write ASCII is used.
When a save range is specified, analog data outside that range will not be
saved.
Save As
The Save As dialog box appears. By default the name of the original file
is prompted. If this is accepted, the original data will be over-written.
Any other name will cause a new file to be created with the edited data.
It is possible to save edited data under the same name if the extension is
changed (eg. to .C3E or .C3F). Note that Windows 95 may not show all
file extensions in applications such as Explorer unless requested. If you
save your work under a new name, this will appear in the title bar of the
current Workspace and Graph Editor windows.
The Range To Save frame range will be used.
The data can be stored in the file in different formats, according to the
C3D file specifications. The data can be saved as Integer data or Real
38 File Menu Commands
Write C3D
Write C3D is similar to the Save As command, in that it allows you to
save the data displayed in the Workspace window to disk as a .C3D file.
However, Write C3D provides the facility to choose what data is saved.
If a limited range of fields has been selected for saving, this command
appears in the menu as Write C3D Range
The user must select data to write to the output file using the Add (or
Add All) and Remove (or Remove All) buttons. Two other buttons are
provided: the first, Add Model Inputs, enters the labels of all trajectories
in the input file in the Data to Write field; the second, Add Model
Outputs, enters the labels of all the trajectories and angles generated by
kinematic modelling in the current working session. If the Remember
List box is checked, the same write list will be presented the next time
the operation is invoked, subject to that data being available. Otherwise
the Write list will initially be blank.
At least one label must be entered in the Data to Write list for a .C3D file
to be created, and a valid path and file name must be provided.
All analog data and parameters are maintained when saving a .C3D file.
(Previous versions of BodyBuilder could write only kinematic data
output.)
Axis Changing
Write C3D provides the facility to change the order in which the coordinates are written to file. Normally (but not necessarily), VICON 370
measurements are expressed in a Cartesian frame of reference in which
the vertical axis is called Z. Thus, in the .C3D files created under this
convention, the first two co-ordinates of a point represent the two
horizontal components, and the third, the vertical.
Write ASCII
The Write ASCII command provides a highly flexible means of writing
motion data to a text file suitable for display in a spreadsheet or for input
to other applications.
If a limited range of fields has been selected for saving, this command
appears in the menu as Write ASCII Range
The Write ASCII command opens a box:
The user must select data to write to the output file using the Add (or
Add All) and Remove (or Remove All) buttons. Two other buttons are
provided: the first, Add Model Inputs, enters the labels of all trajectories
in the input file in the Data to Write field; the second, Add Model
Outputs, enters the labels of all the trajectories and angles generated by
kinematic modelling in the current working session. If the Remember
List box is checked, the same write list will be presented the next time
the operation is invoked, subject to that data being available. Otherwise
the Write list will initially be blank.
At least one label must be entered in the Data to Write list for a .C3D file
to be created, and a valid path and file name must be provided.
The Delimiter is the character which separates values which are entered
on a single line. By default, values are separated by tabs. In this format,
the file created will be easily readable by spreadsheet applications.
If another delimiter is required, click on Other, and enter the delimiter in
the Other field. Any character may be used apart from combination
keystrokes (eg Control-character).
The Invalid Co-ordinate Value field is blank by default. This means that
if a co-ordinate does not exist in a given data field (perhaps because the
marker was not visible in that field), a space will be left in the output file.
Some applications require a value to be entered on every line whether or
not a particular marker was in view; this is called the Invalid Co-ordinate
value. For example, the value -9999 might be used instead of a blank
space, but the value does not have to be a numeral.
The Map XYZ function behaves similarly to the corresponding function
in Write C3D described above in the section on Axis Changing.
Options
The Options allow the user to control details of the file format.
Header Information, if checked, causes file header lines to be written
containing information required by the 3D Studio computer animation
package, and other application software. To maintain 3D Studio
compatibility, select Header Information, Column Headings, Sample
Number Columns, Time Column, and Force Start to Sample 1, Time 0.
Column Headings causes each column to be headed with the label and
component (X, Y or Z). By default the label appears on one line, and the
component name on the next line; but if Headings on One Line is
selected, the labels and component names are placed on the same line,
separated by a colon.
Sample Number Column causes the first entry on each line to be the field
(sample) number of the data on that line.
Time Column causes the second entry on each line to be the time of the
field in seconds (unless Sample Number is deselected, in which case
Time is the first entry on the line).
Force Start to Sample 1, Time 0 writes the sample number and time
information such that the first line of data is always sample number 1, at
time zero, whether or not the first field in the trajectory save range is
actually field number 1 of the .C3D file.
Separate Files per Data Item causes each trajectory to be written to a
different file. If this option is selected, a sub-directory is created with the
Version 3.5 BodyBuilder for Biomechanics
name shown in the Filename box. Each ASCII file is placed in it, with
the same name as the trajectory it describes and the extension as chosen
in the Filename box.
Previous Files
A list of the four .C3D files most recently opened is available in the File
Menu for rapid access.
Preferences
The Preferences command allows the user to control certain aspects of
the Undo operation of BodyBuilder.
Certain operations cannot be Undone: these are listed in the Preferences
under the General tab. If you check these operations, a warning message
will appear when these operations are invoked to remind the user that the
Undo command will not be available after the operation. Such warnings
allow the user to save their work prior to invoking irreversible
operations. However, if the user prefers not to have warning messages,
they can be disabled.
The number of operations which can be Undone is user-controllable.
However, it is recommended that this number should not be increased
much beyond the default value of 10 because it makes substantial
demands on system memory.
If the Maximise CPU usage box is checked, the application will remain
active when it has no tasks running, rather than lying idle. Depending on
system resources, this may allow certain functions to perform a little
better, such as data replay and workspace rotation. In most situations,
though, this will make no noticeable difference.
The marker size as displayed in the workspace can be changed. The
value is in millimetres. This has no effect on any modelling, where the
marker size should be accounted for in the modelling script.
The default modelling files listed under the Model tab indicate the file
names that are searched for when an Anonymous trial (one that has
44 File Menu Commands
Edit Menu
The Edit Menu provides a range of powerful tools for manipulating the
data in a .C3D file as displayed in Workspace and Graph Editor
windows.
The exact range of options available depends on the types of window
open. The full range of options is available when a .C3D file is open in a
Workspace Window and a Graph Editor window has also been opened.
Snip
A trajectory consists of a time-series of points which are linked together
by having a common label. If you want to separate a trajectory into more
than one segment, possibly so that one or other segment can be given a
different label, the snipping function allows you to introduce breaks
without deleting any points.
Version 3.5 BodyBuilder for Biomechanics
To snip a trajectory, select the point at which you want to snip, and
choose Snip from the Edit menu. A break is introduced after the selected
point (ie. the selected point becomes the last point of the earlier segment,
and the next point becomes the first point in the later segment). At this
stage, the two segments still share the same label, but they can be
selected separately, and can be re-labelled individually.
This function may be useful if two nearby trajectories show a crossover error. Both trajectories can be snipped at the cross-over and relabelled without losing any data.
Selecting a range of two
consecutive points is the
same as only selecting the
first.
It is also possible to snip out a range of points. Select the first point as
above, and the second using Control-click. The Snip command deletes
the points between the selected end points. The selected points
themselves remain undeleted.
The end points of the range remain; the points in between are deleted.
The earlier of the two trajectory segments remains selected (shown
yellow); the later segment is unselected (cyan).
Delete
To delete a single point, position the pointer on it and click the left
mouse button. A white cross will appear on the selected point. The
trajectory will also change colour, indicating selection. If the wrong point
is selected, move to the correct point and left click again.
Keyboard Alternative: (minus sign)
Add Point
This command is available if a Graph Editor window is open and
showing a trajectory which has a gap, and if the current field is set within
that gap.
The action of the Add Point command is to create a new point with the
label of the selected trajectory, which is placed in the current field by
linear interpolation from the rest of the data.
In the above example, after raising the maximum fill gap limit from the
default 10 fields, the Fill Gap command is invoked. The interpolator fills
in the missing points. The new data can be filtered and adjusted as
necessary.
attach a label to the new data, so as to have the effect of producing a new
trajectory. This is an alternative method to using kinematic modelling to
create trajectories, but may have advantages in certain situations.
If the Add Point command is invoked in a blank Graph Editor, a new
point will be created at the origin (0,0,0). It is possible, for example, to
create such a point, move it to a desired place, create another point in a
different field, move it somewhere else, and interpolate between the two.
This has the effect of creating a new, straight-line trajectory.
Delete Trajectory
The Delete Trajectory command deletes all selected trajectories. The
command can be Undone.
Defragment Trajectories
If a trajectory is broken, or has been snipped, into several segments, it
will have a fragmented appearance. Selecting one segment will not
necessarily select the others with the same label. This can be repaired
using the Defragment Trajectories command. All segments with the same
label will be stored as a single trajectory. After defragmenting, selecting
any segment will select the whole trajectory. Defragment does not invoke
any interpolation.
54 Edit Menu Commands
If two segments with the same name overlap, when the defragment
command is invoked, some points may be lost from the earlier trajectory.
When a .C3D file is saved (written to disk), defragmentation takes place
automatically. This operation is not reversible by the Undo command.
Fill Gaps In
If a trajectory has been selected, this command appears as, for example,
Fill Gaps In LELB. If several trajectories have been selected, the last
selected is nominated.
This command invokes an interpolation routine which creates new points
in any gap in the selected trajectory which are shorter than the maximum
number of fields for interpolation (default 10).
The interpolation routine produces a series of points in the gap(s) which
should be a reasonable estimate of the position of the marker during the
period it was obscured from view. If the maximum fill gap is set to a
much larger value than 10, the interpolated points will not be an accurate
estimate of the position of the marker. In this case it may be better to use
kinematic modelling to recreate the missing points, if possible.
The Set button applies the selected limit and closes the box without
invoking the interpolation routine. The Fill All Now button applies the
new limit, closes the box, and invokes the Fill All Gaps command.
Copy Pattern
The Copy Pattern command is available only once a Graph Editor
window is open, displaying one trajectory, and a Workspace window
displaying the same .C3D file data is also open, with a different
trajectory selected.
The purpose of Copy Pattern is to fill a gap in one trajectory over a
certain range, using another trajectory as a pattern. The trajectory with
the gap to be filled should be displayed in the Graph Editor window,
with the start and end points of the range to be filled selected. There must
be data points at the start and end of the range to be filled: if necessary,
one or both of these can be created using Add Point and dragged to
suitable places. The selected range is indicated by green cursors, with the
red cursor, as usual, indicating the current field.
The Copy Pattern command takes another trajectory as the template for
filling the gap highlighted in the Graph Editor window. You can use
point-and-click within the Workspace window to select the pattern
trajectory. The pattern trajectory should be complete throughout the
selected range.
In this example, the Graph Editor window shows the trajectory RFHD,
which is missing from the range 20 to 85. The first appearance of this
point is in field 85; a point has been added in field 20, and dragged to a
realistic position. The two points, highlighted in the Graph Editor
window, have been selected as the beginning and end of the range.
Next, the pattern trajectory (RBHD) should be selected in the Workspace
window.
When these steps have been completed, click on the Graph Editor
window title bar to make it the active window. The Copy Pattern
command will then be available in the Edit menu. In the example above,
the command would appear as Copy Pattern from RBHD.
Continuing the example above, the trajectory RBHD has been selected in
the Workspace, and the Graph Editor window made active once again.
At this point, the Copy Pattern command has been used. A trajectory
similar to that of RBHD in the range 20 to 85, has been added to RFHD,
and forced to fit the end points of the gap in RFHD.
If necessary, the new points can be further manipulated until satisfactory.
The Copy Pattern function works as follows. For each component (X, Y
and Z), the pattern trajectory is analysed and the deviations of the
trajectory from a straight line between the end-points of the range are
stored. (The function makes no changes to the pattern trajectory).
The target trajectory must have two end points, so that a straight line can
be drawn between them. The Copy Pattern function then applies the
stored deviations to that straight line, creating the new data. In this way,
the shape of the new trajectory resembles that of the pattern, but
stretched to fit the required end points.
Simple
In Simple mode, a range of one component of a trajectory may be
dragged using the mouse. The whole of the selected range is dragged up
or down the graph together, by an equal amount, with a sharp
discontinuity resulting at the end of the range.
Weighted A mode
To make a smoother trajectory, you can use Weighted A mode, in which
the point that is dragged is moved according to the distance dragged, and
the rest of the points in the range are moved by a lesser amount.
In this example, the selected range of the Y component has been moved
in Weighted A mode. The actual point dragged - shown by the red cursor
- moves according to the extent of mouse movement. The other points in
the range move by a lesser amount, forming a sigmoid curve. The
steepness of the sigmoid curve is determined by side-to-side mouse
movement. This example shows mid-range steepness.
The function used to create the new values of the modified component is
called a sigmoid. Three rules govern this curve:
Weighted B mode
This is similar to Weighted A mode, but follows different rules. The midpoint of each wing of the curve is no longer fixed; instead, it is moved by
lateral mouse shift to create either a convex or concave curve:
This effect results from
moving the mouse to the left
while dragging the apex
point down.
The midpoint of the lateral mouse shift range produces a straight sided
triangle. The opposite extreme is a convex curve with a spike
appearance:
Expand/Reduce mode
The fourth Move Point mode allows you to exaggerate the curvature (ie.
departure from a straight line) of the selected range of points. Once
again, the dragged point (indicated by the red cursor) is moved by the
amount of up/down drag. All other points are moved by an amount which
depends on their deviation from a straight line drawn between the start
and end points, and proportional to the amount of mouse drag.
This effect was produced by
selecting expand/reduce
mode and dragging the apex
point (red cursor) upwards.
Filter
Filter Characteristics
The second option determines the filter characteristics. The filter with the
highest passband is called 3-point. This filter modifies each coordinate according to the function
New Value = (previous sample + 2 old value + subsequent sample)/4
where previous sample and subsequent sample are the neighbouring
points in the trajectory. This is called a 1-2-1 filter function, and will
smooth out trajectories with a sawtooth appearance.
Stronger filters are also available, with 5-point (1-3-4-3-1) and 7-point
(1-4-7-8-7-4-1) functions. These substantially reduce the frequency
content of the data and should therefore be used with caution. For
example, the motion of body parts which naturally have high-frequency
components, such as feet or fists, may become blurred by excessive
filtering. Repeated use of the 1-2-1 filter will have a similar effect to the
use of a stronger filter.
Because filters remove high frequency components, they also have the
effect of reducing the excursion of a point from the overall direction of
its movement. With repeated heavy filtering, the trajectory of a marker
which was moving in a roughly linear path, would ultimately become a
straight line. Similarly, if a marker is moving in a circular path, without
overall displacement, the effect of filtering will be to reduce the radius of
curvature of the path. If repeated, this would ultimately bring the point to
a standstill.
If a segment of a trajectory is snipped at both ends and selected, the filter
will act only on the selected segment. Repeated filtering will tend to
reduce it to a straight line. This is unlike the delete and fill function,
which produces a smooth path between the end points, but maintains
curvature. Repeated delete and fill operations on the same segment
would not produce further changes.
Spike Removal
If Remove Spikes is selected from the Filter box, you may choose to
remove spikes from the selected trajectory. Spikes occur when the
reconstruction process has located a single point which is to one side of
the position which would be expected from the surrounding points. Spike
removal is a special case of the Delete and Fill function, in which the
program automatically identifies such points and carries out a delete and
fill on each one.
The threshold setting determines how far a point has to be from those on
either side, to be identified as a spike. A higher value leads to fewer
points being identified as spikes. Once again, this function should be
used with care.
When spike removal is used, the selected trajectory is analysed, and a
spike value representing the degree to which each point deviates from a
smooth path is calculated. A point which lies directly between its
neighbours has the minimum spike value of 1; a point which deviates
Version 3.5 BodyBuilder for Biomechanics
from this path has a higher spike value. Any point with a spike value
higher than the threshold is then deleted and filled. A threshold value
close to 1 will, therefore, result in a high proportion of points being
deleted and filled. A value of 2 may result in only a few points being
removed. The most appropriate value of the threshold can only be
determined by trial, beginning with a higher value and reducing it until
the desired result is obtained.
Refer to VICON 370 Users
Manual for advice on
improving your data.
If there are many spikes, it may be better to filter the whole trajectory
rather than spike-remove a high proportion of points. If spikes are a
frequent problem, it would be a good idea to re-calibrate and see if a
better result can be obtained. It may be necessary to re-linearise the
cameras. However, if the problem is not excessive, spike removal and
filtering will enable you to produce satisfactory results without repeating
data capture.
If both filtering and spike removal are selected, spike removal is carried
out first.
Re-Sampling
If the desired output is a time-series of point data at time intervals
different to that of the input file, the re-sample function allows the user to
fit a curve to the data and calculate new points at a user-specified time
interval. This function may be used to produce new points at either a
higher or lower sample rate than the original sample rate.
If the output field rate is a precise sub-multiple of the original (eg. 10Hz
from an original 60Hz), the user may choose to use the original data by
discarding the appropriate intermediate points. However, in most cases
the re-sampling function works by fitting a curve which is a close
approximation to the original data, and then using this to calculate new
points. There is, in this case, a minor low-pass filtering effect.
If gaps are present in the data, re-sampling will have the effect of
invoking the Fill All Gaps command with no maximum gap size limit.
Re-sampling is not reversible using the Undo command - if you are in
any doubt about re-sampling, save the data to your hard disk before using
this command.
Because of the problems involved in resampling analog data, especially
when it is captured at a multiple of the video rate, the resample feature is
disabled when analog data is present.
View Menu
The View Menu controls the appearance of certain items in the main and
Workspace windows. Most of the commands in the View menu are only
available if a Workspace window is active.
Toolbar
The toolbar appears by default (ie. unless you select otherwise). The
toolbar is a row of buttons which provide rapid alternatives to menu
commands. Each button corresponds to a frequently used command. Not
all commands are represented by tools; the View menu commands are
not represented.
The tools cannot be changed by the user, only selected for display or
otherwise. They are grouped according to the menu to which the related
command belongs, and given symbols suggesting function. The File
Open tool is commonly used by Windows programs and will be familiar;
others are specific to BodyBuilder. The user should gain familiarity with
the tools by pointing at them; a device called Tool Tips causes the name
of the related command to appear when you point at a tool for longer
than one second. If the user prefers not to have the toolbar displayed, the
Toolbar command in the View menu toggles the display on or off.
Status Bar
The Status Bar appears at the bottom of the main program window,
occasionally displaying helpful messages indicating program function
and status.
Version 3.5 BodyBuilder for Biomechanics
If the user finds this unhelpful, it can be removed, which allows the
working windows to be displayed slightly larger. If the user prefers not to
have the status bar displayed, the Status Bar command in the View menu
toggles the display on or off.
Rotation Centre
In a Workspace window, the centre of rotation (if selected) is shown by a
purple diamond. The axes of Workspace viewpoint rotation pass through
this point, and the zoom function acts towards or away from this point.
Like all the View menu commands, this one works as a toggle, meaning
that it has two states, and each point-and-click on the command changes
the state. If the user prefers not to have the rotation centre displayed, this
command can be used to turn off the display. The keyboard alternative is
R.
Markers
In the Workspace window, the positions of the markers in the current
field are shown by small circles (or, to be precise, octagons).
If Markers are deselected, these will be hidden, leaving the trajectory and
stick displays to indicate the motion of points. The keyboard alternative
is M.
Stick Figure
The display of sticks joining points is usually helpful, but if the user
prefers not to display sticks, they can be deselected. The keyboard
alternative is S.
Floor
70 View Menu Commands
The 500mm square tile floor appears by default in the plane defined by
Z=0. If this is not helpful, it can be deselected by this toggle. The
keyboard alternative is W.
Flicker Free
Depending on the hardware (in particular the use of graphics
acceleration) it may reduce flickering if the processor takes control of the
Workspace window, at the expense of replay speed. Use this toggle to
select the display mode which gives the best result on your PC. The
keyboard alternative is Control-F.
Always Refresh
Depending on personal preference, the user may choose to refresh the
Workspace window after each field is drawn, during a replay, at the
expense of replay speed. Use this toggle to select the preferred mode.
The keyboard alternative is Control-R.
Model Menu
The model menu commands allow the user to apply kinematic models
written in BodyLanguage, and to view the results in the Workspace
window. The model menu is also the key to animation-format output
functions.
Run Model
The Run Model command runs the BodyLanguage model for the current
trial (.C3D file). The sequence of operations is as follows:
The Run Model command causes a model to be run for each subject in
the trial, using the model and parameters as specified in the Subject
Settings dialogue box.
Although the Workspace window will appear different after the Run
Model command is invoked, no new file is created. The model outputs
are held in system memory, until the user saves the data by writing to
disk. Until the data is saved, the operation can be Undone by selecting
the Delete Model Outputs command from the Edit menu.
Note that if required, a new model can be selected, and run, using the
outputs from the previous model as inputs to the new model.
If there are any errors in the model script, an error message will appear
describing the error, and if appropriate, a text editor window will be
opened with the offending line in the script highlighted. See the View
Last Error command for more details.
Create ASF
Acclaim Skeleton Files are
used by certain computer
animation systems. Refer to
the documentation provided
for those systems.
The Create ASF command is intended for those users who want to
produce an Acclaim Skeleton File using a BodyLanguage model and a
.C3D file of static data. The specific requirements for this are explained
in the section on Acclaim format modelling.
The .ASF file produced is based on a template file with the extension
.AST which must match the input data and the model script.
The Create ASF command carries out the same procedure as the Run
Model command, with the difference that the line
74 Model Menu Commands
$Static = 1
is added to the beginning of the .MP file before the combined script is
executed. This signifies that the data is a static trial, to be used for
creating the skeleton data file. The result of running such a model is a
text file with the extension ASF.
The .ASF file created by this command will have the same name as the
input .C3D file.
Create AMC
The Create AMC command is used to create an Acclaim motion file
using a BodyLanguage model and a .C3D file of motion data. The
specific requirements for this are explained in the section on Acclaim
format modelling.
The Create AMC command carries out the same procedure as the Run
Model command, with the difference that the line
$Static = 0
is added to the beginning of the .MP file before the combined script is
executed. The result of running this kind of model is a text output file
with the same name as the input .C3D file, and the extension .AMC.
An .ASF file is required before this command can be used.
the required AMC files from the folder. By default, all trials are selected
except for those which already have .AMC files.
In the case of auto-labelled trials, the ASF file, and model and parameter
files used for processing are determined from the subject name, and the
marker set file name used during auto-labelling. Where these files cannot
be found, or a manually labelled trial is selected, the default files as
shown at the bottom of the dialogue will be used. The model and
parameter files are the same as those set in the Preferences dialogue, and
the ASF file is initially set to be most recently generated one. A different
ASF can be selected by clicking the browse button.
When the OK button is pressed, the trials will be processed automatically
without any need for further intervention by the operator. One AMC file
will be generated for each subject, in each of the selected trials.
Axis Permutation
The Axis Permutation command is used before the Run Model or Create
ASF/AMC commands to change the axis convention used from the usual
VICON convention (vertical component = Z) to another convention.
The Axis Permutation box appears:
Any global point co-ordinates in the output will be permuted in the way
selected. In .AMC files, in which most movements are described relative
to other body segments rather than in global co-ordinates, there is a root
View Model
The View Model command will open a text editor window displaying the
model script file for the current subject of the active trial. Subsequent
invoking of the View Model command brings the model window to the
top and opens it if it is minimised.
The window can be closed directly.
View Parameters
The View Parameters command displays the current subjects parameter
file in a text editor window, in the same manner as the View Model
command.
line at which the error occurred will be highlighted, and the error
message will appear at the bottom of the main application window. If the
error was due to a macro call, subsequent selections of View Last Error
will toggle the highlighted line between the call to the macro, and the
offending line within the macro.
Adjust Parameters
The Adjust Parameters command starts Interactive Parameter
Adjustment (IPA) mode. The use of this mode is described in the next
section.
Subject Settings
The first field in the Subject Settings box is a drop-down list of subjects
for the current trial. Below this are the marker, model and parameter files
currently selected for the given subject. These files may be changed
using the Browse button beside each field.
When an automatically labelled C3D file is first opened in BodyBuilder,
the model and parameter files are assumed to have the same name as the
marker set used to perform the auto-labelling. Thus, a subject labelled
using the file LEGS.MKR is assumed to be compatible with the model
LEGS.MOD. For a dynamic trial, the parameter file is assumed to have
the same name as the subject. For a static trial, if the parameters file is
not explicitly named, the basic parameter file for the model is loaded
initially (e.g. LEGS.MP) to act as a template for a new parameters file
with the subjects name.
Parameters
Parameters are numerical values which are part of a model, but which are
stored in a parameter file separate from the model script itself, because
the numbers are subject to frequent change. For example, they may
include values of segment sizes which depend on the individual subject
and the exact placement of markers, and so can vary from day to day.
The parameter file is added to the model script when the model is run,
but stored separately.
Often it is useful to edit the values in the parameter file during a
modelling session, in order to change the results in some way. You may
want to tilt a segment, or change the location of an internal point (such as
a joint centre) in relation to the actual markers. These adjustments can be
made interactively, with the effects of the change displayed immediately
in the Workspace window. When interactive adjustment is completed,
the final values of the selected parameters are entered in the parameter
file just as if they had been entered using the keyboard.
being used by the IPA function. The Static check box is also locked for
the same reason.
Parameter List
The upper part of the IPA dialog bar contains a list of all the parameters
found in the parameter file for the current subject in the C3D file (if a
multiple subject file is open, only the currently selected subject is
affected by changes). Parameter names must begin with the $ symbol to
be recognised. The name of the parameter is shown on the left, and the
value on the right. The relative width of the name and value columns
may be changed by moving the split at the top of the pane.
Each parameter name has a symbol to its left, indicating the type - scalar,
point or angle. A scalar has a small circle beside the name. A point (three
dimensional quantity) has an arrow. An angle has a mathematical angle
symbol. In some cases, a parameter is defined by an expression, rather
than a simple definition. These values cannot be adjusted directly, but
they are listed anyway with their values, and have no symbol beside the
name.
Adjusting Values
To adjust a parameter, left-click the parameter name. If that parameter is
adjustable, a small thumbwheel window will appear.
A single thumbwheel will appear for scalar values, and a window with
three thumbwheels will appear for Point and Angle types. Up to three
such windows can exist at once. Further parameters can be adjusted by
Control-Left-Clicking other names. The three thumbwheel windows are
distinguishable by a coloured lozenge in their top bar. An identical
lozenge also appears to the left of the corresponding parameter name.
Values can then be adjusted in two ways. First, the thumbwheels can be
grabbed by left clicking the mouse, and dragged up, to increase the
value and down to decrease it. For Point and Angle thumbwheels, the
leftmost wheel controls the X value, the middle wheel the Y value, and
the right wheel Z. Pressing the Shift key while dragging in increases the
amount the value is changed, and pressing Control reduces it.
Second, the value can be changed by typing in the edit box in the centre
of the IPA bar. The parameter that appears here is the one most recently
adjusted. When typing, invalid formats (e.g. missing commas for Point
definitions) are ignored.
Each time the value is changed, the model is run for the single frame that
is displayed in the workspace, and the outputs updated. Changes to the
parameter values can be undone or redone by selecting Undo or Redo
from the edit menu.
The thumbwheel windows can be closed by clicking the button at the
bottom of the window. They also disappear automatically when new
parameters are selected for adjustment.
The current frame may be changed during IPA. Model outputs for each
frame selected during IPA will remain intact. The trial may also be
played (using the forward and back arrow buttons) but play will stop if a
parameter value is changed, and the model therefore re-run.
Finishing IPA
Once the parameters have been adjusted to the required values, IPA
mode may be switched off by pressing the Finish button at the bottom
of the IPA dialog bar. The bar will disappear, and the final values for the
parameters adjusted will be inserted in their appropriate places in the
parameter file text. At this stage, the model can be run for the complete
static trial, generating the required additional parameters.
Any changes to the parameters file or the trial made during IPA must be
saved before closing the trial as the Finish button does not write the new
values to disk. If a text editor window is not open for the parameters, the
option to save them is offered when the Workspace window is closed.
The Cancel button also exits IPA mode without making any changes to
the parameters text, and any trajectories generated by the model during
the IPA mode are removed.
The Reset button causes the IPA mode to restart. The thumbwheel
windows disappear, the parameter name and output panes are cleared and
re-filled by re-reading the parameter file and re-running the model.
Workspace Menu
The commands in the Workspace menu are all concerned with the
display of data in the Workspace window.
Select Centre
The centre of rotation and zoom can be changed to any point on a
selected trajectory. Hold the pointer steadily at the chosen point and
click with the left mouse button to select this point. If the trajectory
segment is the only one selected, it changes colour to yellow. If other
trajectories are already selected, another colour is used. Use the Select
Centre command to make the selected point the new rotation centre.
Hide Trajectories
If you want to turn off the display of certain trajectories, such as phantom
points (false reconstructions), select them and use the Hide Trajectories
command. When a trajectory is hidden, it cannot be selected, and the
mouse helper will not appear, even if the marker outline is still visible.
Show Trajectories
To turn the display of selected trajectories back on, use the Show
Trajectories command.
If the hidden trajectory(s) is no longer selected, you can either use the
label list to re-select them, or use the Show All Trajectories command.
In the first case, the user will make extensive use of the BodyLanguage
model-writing facility, editing the model and testing the changes to see
the effect they have. In the second case, the user will process data using a
particular model, and assess the results to see if they are anatomically
useful. In the third case, the user aims to learn something about the
individual subject or patient, rather than about the model.
The flexibility of BodyBuilder for Biomechanics therefore allows the
user to study individual subjects; to study a modelling method; or to
develop new methods and test them against real life. The purpose of the
work being carried out will affect every aspect of data processing and
Version 3.5 BodyBuilder for Biomechanics
presentation, and for this reason it is only possible to use the tools
available once the purpose has been thoroughly defined.
The process of designing and writing a model is fundamental to the use
of BodyBuilder for Biomechanics. Even if the purpose of a particular
study is to apply an existing model to a particular subject, it is useful to
understand the way in which a model is developed.
The design of a model begins with a need to describe the human body
and its motion for a certain purpose. The purpose may be the study of an
abnormality by comparison with normal individuals; the study of physical
stresses and the avoidance of injury; the study of mechanical efficiency
and its improvement; or the study of a sporting skill and the effects of
various kinds of training and coaching. There are limitless possibilities,
and each case requires an appropriate model.
The purpose will determine the way in which the body is modelled. The
body must be divided into segments, which are assumed to behave as
rigid elements, joined in certain ways. The number of segments and the
overall complexity of the model will be determined by the purpose of the
study. For example, if the purpose is to analyse power transmission at the
knee joint in Olympic weightlifters, it is not necessary (and may be
impossible) to measure and model the movement of each finger.
However, if the purpose is to analyse repetitive movements in typing,
each finger may need to be modelled as two or even three segments.
In a more anatomically
sophisticated model, it will
be necessary to consider the
relationship of actual bones
to modelled segments; the
degree of complexity
required; the level of
realism needed; what it is
possible to measure using
markers attached to the
skin; and the significance of
any kinetic quantities to be
derived from the model.
The foot is an example of a
body part which may be
modelled with various levels
of complexity. The degree of
anatomical realism required
depends on the purpose for
which the results are to be
used.
Single Point
Two Points
Three Points
Four Points
If we have the positions of four markers belonging to one segment, again
on the condition that they are not co-linear, we have redundant
information, which we can use for other purposes. For example, if one of
the markers is temporarily obscured from view, we can use our
knowledge of its relationship to the other three, to fill in the gap. This
technique is very useful in kinematic modelling, especially in the case of
complex motions where markers are often obscured from view.
Alternatively, we could use the redundant information to average out
errors due to measurement noise, skin movement and so on.
To summarise:
one marker defines the location of one point, but not of a whole
segment
the first axis of the segment coincides with the line between the
centres of rotation of the distal and proximal joints linking the
segment to its neighbours (ie. it is the long axis of an elongated
segment such as a limb segment)
if compatible with the above, the second axis coincides with the
most significant axis of rotation of the distal joint
While these are only guidelines and will not apply in all cases, certain
BodyLanguage functions (especially kinetic functions) assume that they
are followed unless otherwise specified. If you decide not to follow these
guidelines, pay particular attention to the calculation of force, moment
and power quantities in your model.
Version 3.5 BodyBuilder for Biomechanics
These guidelines cannot be used in all cases, for example segments, such
as the pelvis, which have more than one distal segments attached. The
treatment of such segments is illustrated in the example model scripts
supplied with BodyBuilder and discussed later in this manual.
Rotations
To describe the attitude of one segment relative to another, it is
necessary to choose a mathematical convention for the description. For
example, if we choose to model the elbow as a simple hinge joint,
knowing that it can only flex within a limited angular range, all we need
to choose is the position we call zero, and a sign convention to describe
flexion and extension. However, if the model is more complex, we must
use a more sophisticated definition. To describe ball-and-socket joints,
we must find an unambiguous convention for describing a particular
orientation using three angles.
The convention most relevant to biomechanics is called the Euler angle
convention, after the mathematician Leonhard Euler. Euler angles
correspond best to the concepts of flexion, abduction and rotation which
are used in anatomy and biomechanics. The use of this approach to
define rotations between segments is illustrated in all the example
models supplied. A ball-and-socket joint capable of rotating about three
different axes from any given position will be described using three Euler
angles; a joint with fewer degrees of freedom (for example, a hinge joint)
is equivalent to a ball-and-socket joint in which one or two of the angles
is given a fixed value. It is a useful simplification to describe a joint
using the minimum number of variables necessary for the model to fulfil
its purpose. For example, if it is acceptable to describe the knee as a
simple hinge joint with only flexion/extension movement permitted, ie.
no valgus/varus or rotation movements, then this will simplify the model
and reduce the number of markers required.
The characteristics of Euler angles, their full mathematical definition,
and an explanation of the effect known as gimbal lock, are given in
textbooks of mathematics and biomechanics, and will not be repeated
here.
BodyLanguage
Overview
BodyLanguage is an interpreted programming language for defining
kinematic and kinetic models of complex moving objects, such as the
human body. BodyLanguage is designed to be used by non-programmers
who have a reasonable grasp of geometry, but not necessarily of vector
algebra.
BodyLanguage scripts are read by VICON BodyBuilder and used to
process motion data, generating virtual trajectories, kinematic angles,
moment and power quantities, and other outputs of interest in
Biomechanics.
This section, inevitably, resembles a mathematics textbook; however,
every effort has been made to express meaning as clearly as possible and
to illustrate each technique with diagrams and examples.
BodyLanguage 99
Before Starting
The first step in using motion capture for computer animation is to
decide on the kinematic model to be used. This means choosing the
number and type of body segments which are to be defined and
measured, and the relationships between them. It also involves deciding
the locations of markers to be placed on the body of the subject or
patient, whose motion is to be captured; and writing down, in a
BodyLanguage script, the relationship between those real points and the
kinematic model body segments which are subsequently calculated.
Force
Force is a vector quantity, ie. one which has a magnitude and a direction.
Forces acting on a rigid body may be added and subtracted to each other
to obtain the net force on the body. All forces may be broken down into
three components which are parallel to any given set of mutually
perpendicular axes. The total, or net, force acting on a body is the sum of
the different forces acting on it at any given time, such as gravity, ground
reaction forces, and forces from other bodies linked to the body being
considered. If the net force acting on a body is zero, the body will remain
at rest or move at a constant velocity. If the net force on a body is nonzero, the body will be accelerated. Some forces can be measured directly
(eg. weight, ground reaction forces), others (eg. muscular forces) can be
estimated using appropriate kinetic models. The SI unit of force is the
Newton (N). Weight is an example of a force; it is the effect of gravity
on mass. A mass of 1kg has a weight of about 9.8N. Note that although a
force may be fully specified by a magnitude and a direction as far as the
strict definition is concerned, the needs of kinetic modelling may require
additional information such as the point of application of a force.
Moment
BodyLanguage 101
Reaction
In mechanics, a reaction is a kind of force. When a body presses against
another, it experiences an equal and opposite force from that body. This
is the reaction. In biomechanics, the term is normally used to describe the
force exerted by the ground on the foot (or other body part) in contact
with it.
Ground reaction force vectors can be directly measured by force plates.
Strictly speaking, a reaction is a three-component force, but the quantity
measured by a force plate has an additional three moment components as
well, which are measured round a calibrated forceplate centre.
In BodyLanguage, a Reaction groups together a force and a moment
with the moment reference point, around which the force is deemed to
act, as a single convenient unit.
Power
102 BodyLanguage
Power is the rate of doing work. The power generated by a force acting
in a straight line is the product of the force and its velocity. The power of
a force causing a rotation is the product of the moment and its angular
velocity. Power is a scalar quantity, but sometimes in biomechanics it is
treated as a pseudo-vector by calculating power separately for each
component of a force or moment. The SI unit of power is the Joule per
second (J/s) or Watt (W). In BodyBuilder, the milliwatt is the normal
unit (mW). Ground reaction forces, however strong, do not move
through a distance, and thus do no work and generate zero power.
Moment of Inertia
Inertia is the tendency of a body to maintain a state of rest or constant
motion. It is effectively identical to mass. Moment of inertia is the
tendency of a body to maintain a state of rest or constant rotation about a
specified axis. It is a scalar quantity which depends on the mass of a
body, the way the mass is distributed, and the chosen axis of rotation.
The SI unit of moment of inertia is kgm2. Radius of gyration k is a
related quantity, defined as follows: if a body of mass M has a certain
moment of inertia about a specified axis, a point-like body of mass M
placed a distance k from that axis would have the same moment of
inertia. Radius of gyration is a distance and in biomechanics is generally
measured in millimetres.
The definitions, calculation, measurement, and inter-relationships of
these and other quantities are given in textbooks of biomechanics. The
user should take care to use consistent sign conventions for quantities
such as power, which can be either generated or absorbed by a muscle.
When power is transmitted across a joint, one segment does work on the
other and it is a matter of convention and preference which is considered
to be positive.
BodyLanguage 103
104 BodyLanguage
Objects
Types of Object
BodyLanguage models are built up from 5 types of object:
numbers
points
segments
rotations
reactions
Numbers
Numbers are the simplest type of object, from which all other objects are
constructed. Numbers can be variable (such as the height of a point) or
constant (such as a body measurement like knee width). An important
use of constant numbers is for the physical parameters of a measured
subject.
Points
Points are locations in space, specified by Cartesian co-ordinates. Each
point has three ordered components, corresponding to the X, Y and Z
coordinates of the location in space, so a point may also be considered as
a vector. The co-ordinates may be specified relative to the overall
laboratory frame of reference, in which case the point is described as
global, or relative to a particular segment, in which case it is described as
local.
Objects 105
There are two kinds of point, real and virtual. Real points, derived from
physical markers, are the measured locations of reflective spheres
attached to the subject. Virtual points, created by modelling or other data
manipulation techniques, have all the properties of real points, but may
be in locations where no actual reflective marker existed. Virtual points
can be used:
Segments
A segment is defined by a group of points, both real and virtual, which
move together. A segment can move and rotate with respect to the global
frame of reference.
Each segment has a single point which is defined as the segment origin,
and three segment axes. The orientation of the segment is described by
rotations about the origin, relative to the global frame of reference.
A segment is generally used to describe the position and orientation of a
body part, such as the head, the pelvis, or a limb segment, which can be
considered as a rigid body which moves relative to neighbouring body
segments (although, as human body parts are not perfectly rigid,
allowance is made for the fact that markers placed on a body segment
may move a little relative to each other).
Rotations
A rotation is a quantity with three ordered components, representing
angular movement about 3 specified axes. These ordered angles are
called Euler angles.
106 Objects
Reactions
A reaction groups a Force, and a related moment a reference point
together, all of which are represented as three dimensional quantities.
Reactions are used to describe the kinetic interactions between segments,
and between segments and forceplates. See the kinetic modelling section
fopr more details.
Object Names
Every object has a name, composed of up to 256 letters and numbers,
plus some additional characters such as % and $. There must be no
spaces in an object name. Object names must not start with a number.
The names of real points in the input .C3D file are determined in other
parts of the VICON system (after reconstruction, when trajectories are
given labels) and must match exactly the names used in the .MOD file.
For example, if your BodyLanguage script (.MOD file) uses a point
called "KNEE", the input .C3D data file should contain a trajectory
named "KNEE". (If the trajectory of the relevant marker in the .C3D file
has been given a different label, you can either use BodyBuilder to relabel the trajectory, or edit the script to use the different name.)
BodyLanguage is case-insensitive, meaning that it ignores the difference
between upper and lower case characters in an object name. For
example, LeftKnee and leftknee are recognised as the same object.
To make a long object name more readable, upper case letters may be
used in the middle of a name (for example,
LeftElbowJointCentre).
Objects 107
Reserved Names
The following reserved names cannot be used for objects, since they are
reserved for special functions (see section on Functions):
ACOS
ALIGN
AND
ASIN
ATAN
ATAN2
ATTITUDE
AVERAGE
BODYMASS
CHORD
COMP
CONNECT
COS
DEADBAND
DEFINE
DIST
DISTANCETHRESHOLD
ELSE
ELSIF
ENDIF
ENDMACRO
EXIST
FIELD
FORCETHRESHOLD
GRAVITY
IF
LAST
MACRO
MOMENT
108 Objects
NORM
NOT
O (letter "oh")
OPTIONALFORCES
OPTIONALMOMENTS
OPTIONALNUMBERS
OPTIONALPOINTS
OPTIONALPOWERS
OPTIONALREACTIONS
OR
OUTPUT
PARAM
PERP
POWER
REACTION
ROT
SAMPLE
SIN
SINGULAR
SPINE
SQRT
TAN
THEN
VELOCITYTHRESHOLD
Objects 109
Inputs
Since BodyLanguage processes VICON motion data, its variable inputs
are real points from VICON three-dimensional data files (.C3D), which
move sample-by-sample. Each point used in the model must be referred
to by the same name in BodyLanguage as the label attached to it in the
.C3D file.
Other fixed inputs, known as "parameters", are constant for an individual
subject and may either have been typed in or calculated from a static
trial.
points
real or virtual
trajectories, read
from a C3D file
Optional Points
All objects referenced in a BodyLanguage script must be defined. For an
object to be defined, it must either be:
110 Objects
Outputs
The purpose of a BodyLanguage model is to generate outputs:
virtual points
as .C3D trajectories
(eg. joint centres)
segment rotations
joint rotations
Parameters
A BodyLanguage script is divided into two parts, a parameter section
(.MP file) and model section (.MOD file), which are loaded, edited, and
saved separately.
Objects 111
Samples
BodyLanguage differs from programming languages in one fundamental
respect.
The input to a BodyLanguage model is always a series of sampled data
points, equally spaced in time. In a conventional program, there would
need to be a "main loop" containing the instructions:
set first sample number
read sampled data from file
apply model to data in current sample
test for last sample number
loop back to read next sample
112 Objects
Objects 113
Expressions
Types of Expression
An expression is a combination of objects, operators and functions by
which a new object is defined. Every assignment statement (by which
objects are defined or modified) takes the following form:
ObjectName = Expression
The expression in every assignment in a script must match the type of the
object being assigned. (If it is the first assignment of that object, it will
define the type of the object). The type of an expression is determined as
follows:
Numbers
A number expression can be:
a number input
Points
A point describes a position in space. The same point can be described
either:
Expressions 115
a point input
numbers - {numberA,numberB,numberC}
Segments
A segment is a group of points which remain at fixed distances from one
another. As a segment moves, all the points in it move together. A
segment can move and rotate with respect to the global VICON frame of
reference. Strictly speaking, a segment expression does not require that
the points referred to are absolutely, rigidly fixed relative to each other since human body parts are not mechanically rigid, there must be some
flexibility. However, segment expressions should include points which
move together, at least approximately.
If the global positions of at least 3 points in a segment, (which are not in
a straight line) are known, the segments position (ie. the position of the
segment origin), and orientation, can be determined. Any other local
points in the segment can then be output as global, virtual points (see
section on Operators). This is the method of locating points, such as joint
centres, where a real marker cannot be fixed.
A pair of square brackets [ ] is used to construct a segment from a set of
points. A segment expression can be:
116 Expressions
Segment Definition
In a segment definition, one global point defines the segment origin. (If
there is no real point at the desired location of the segment origin, the
segment is first defined with a different origin, and then moved to the
required position).
Up to 4 other global points are used to create two defining lines which
together uniquely describe the segment rotation. Rotation of a segment is
represented by the orientation of its 3 axes, pointing in mutually
perpendicular directions from the segment origin.
The point that defines the segment origin can also be used in the
definition of either defining line. Defining lines may also share a
common point, so a minimum of 3 global points are sufficient to define a
segment.
The global axes X, Y and Z, are established by the VICON calibration.
(Although they can be manipulated in BodyBuilder, for the purposes of
this document, they will be taken as fixed). Co-ordinates of global points
are an ordered triplet of numbers, in the order X co-ordinate, Y coordinate, Z co-ordinate. Segment axes, to avoid confusion with global
axes, are referred to as 1, 2 and 3, rather than X, Y and Z. Local coordinates are an ordered triplet of numbers, in the order 1-axis, 2-axis, 3axis. When a segment is defined, it is possible to control which axis has
which label, as long as the right-hand rule is followed.
One segment axis is set parallel to, or coincident with, the first defining
line (depending whether the segment origin lies on the first defining
line).
A second segment axis is in a direction perpendicular both the first and
second defining lines. The positive direction of the second segment axis
is towards the tip of an imaginary corkscrew whose handle turns, by the
shortest angle, from the direction of the second defining line onto the
first.
A third segment axis is perpendicular to the first two segment axes, and
the positive direction is determined using the right-hand rule.
Version 3.5 BodyBuilder for Biomechanics
Expressions 117
The order in which the global points are entered in the definition of a
segment is critical. If it is intended that:
(from J to K)
118 Expressions
st
st
nd
1 /2 lines define
the axis labelled
Token
alternative
xyz
-1
xzy
yzx
-2
yxz
zxy
-3
zyx
Example
The virtual point CPelvis is the origin. The first defining line is from
RPelvis to LPelvis. The second defining line is from BPelvis to
FPelvis. The token yzx means that the axis parallel to the first
defining line is Axis 2; Thus Axis 2 is parallel with the first defining line
but originates from the origin at CPelvis. Axis 3 is perpendicular to both
defining lines, and its direction is determined by the right hand screw
rule. Axis 1 is, then, perpendicular to the other two axes, such that the
three axes form a right-handed frame. It is therefore not necessarily
parallel to the 2nd defining line.
This example uses five points to define a segment, since the defining
lines have no common points, and the origin is not part of a defining line
definition.
Expressions 119
120 Expressions
IF SINGULAR(Tibia) DEAD={1,1,1}
(followed by an OUTPUT statement) would create a point labelled
DEAD at the location 1,1,1 in each field in which the segment Tibia is
in the dead band.
The default value for the dead band is 1 on either side of straight. For
human movement analysis, unless marker positions are adjusted with
great care, this value is often too small to eliminate axis swings. A dead
band value can be set by including the following assignment anywhere in
the script, either as part of the model itself, or more conveniently as a
parameter.
DeadBand=numberA
where numberA is the half-width of the dead band in degrees.
In static trials, if the arms and legs are stretched out, it is possible for the
knees and elbows to lie in the dead band all the time, causing the
expression to be invalid throughout the trial. In this case it is necessary to
set a low value of dead band, or to comment out the line altogether. In
static trials, the problem of axis swing is irrelevant, so a dead band is not
required.
Anti-Flip
In addition to the problem of defining lines which are almost co-linear,
which is addressed using the dead band, there is another potential
problem which may arise if (for example) a knee hyperextends slightly
(goes past the straight position). Because the shortest angle from the
second defining line to the first is now in front of the knee, the knee
extension axis will appear to flip around so that it points inward rather
than outward. To overcome the flip problem, an optional argument can
be added to a segment definition, in the form of an anti-flip line.
To understand the use of the anti-flip line, visualise the 2 segment
defining lines projected into a plane to which they are both parallel.
Next, project the anti-flip line into the same plane. Now move these three
vectors in the plane, without changing their directions, until they
originate at the same point.
Expressions 121
Example
The following segment definition is taken from the model script
FULLBODY.MOD which is listed fully in a later section.
RFemur=[RKNE,RHJC-KneeOffset*2(Pelvis)RKNE,RANK-RKNE,zyx,RTOE-RKNE]
The name of the segment defined in this line is RFemur. The expression
in square brackets consists of a real point (RKNE) and two defining lines,
along with the token zyx and the anti-flip line RTOE-RKNE. The first
defining line is from the real point RKNE to the virtual point RHJCKneeOffset*2(Pelvis), which is to the right of the estimated
122 Expressions
position of the right hip joint centre, by an amount equal to half the width
of the knee joint (the knee offset is a number read from the parameter
file). The reason for this complex line definition is that the virtual point
RKJC at the knee joint centre has not yet itself been defined, so cannot
be used in the simpler definition RHJC-RKJC. The line established
instead is closely parallel to RHJC-RKJC but shifted to the right. The
second defining line is simply RANK-RKNE, and the anti-flip line is from
RKNE to the point RTOE. The token zyx ensures that the first defining
line establishes axis 3, and the axis established by the right hand screw
rule is axis 2. In the normal situation in which the knee is flexed, the
construction is as shown below.
In this diagram, the plane of the paper is the plane containing the two
defining lines; the projection of the point RTOE is also shown. The
curved arrow shows the shortest rotation bringing the second defining
line onto the position of the first. This causes axis 2 to be aligned out of
the paper.
Version 3.5 BodyBuilder for Biomechanics
Expressions 123
In this case, the shortest rotation of the second defining line passes
through the anti-flip line, reversing the right-hand screw rule, and
therefore ensuring that axis 2 is still aligned out from the paper.
If a dead band is defined, then in the case of the two defining lines being
co-linear (or close to co-linear), the position of axis 2 will be interpolated
from better-defined positions either side of the frames in which the leg is
straight.
Hierarchical Skeletons
It is not necessary to specify the interconnections of segments in a
kinematic model. Any number of segments may be independently
defined using separate sets of three or more markers, and the movement
of those segments will be completely independent. In some situations,
this may be appropriate and necessary. For example, it is possible to
124 Expressions
measure the movements of two subjects who are not connected to each
other and whose movements are fully independent. Alternatively, it is
possible to model two indirectly linked body parts of the same subject
(such as the two feet), without modelling all the segments which form the
bridge between them.
However, in many models, especially those which use the kinetic
functions, it is necessary for segments to be linked in specified ways,
corresponding to the actual physical joints between the body parts they
represent. In such a model, there is a hierarchy of segments beginning
with a root segment, from which chains of other segments branch out.
For example, the pelvis may be defined as a root segment, with the legs
and upper body represented by chains branching out from it. Each
segment in such a chain is called a child segment, and must have a
specified parent segment (which may be the root segment, or another
segment one level closer to the root). A segment may have only one
parent, but may have more than one child. In the example of a pelvis root
segment, the left and right thigh segments will both be child segments of
the root. No closed loops are permitted.
Any segment definition which does not state the name of a parent
segment is interpreted as a root segment definition. There is no limit to
the number of root segments which may be defined in one model script
(if the hierarchical scheme is not used, every segment is a root segment).
The choice of root segment does not correspond to any special
anatomical significance. Normally, if a simple diagram is drawn showing
the segments used in a particular model, one segment will suggest itself
as the root.
The naming of a parent for a particular segment does not itself define the
kind of joint between the two; their positions can still be measured
independently, and the distance between them is not fixed by their
hierarchical relationship. In some cases it may be desirable to limit the
degrees of freedom between the parent and the child, but this is
controlled entirely by the kinematic part of the segment definition (the
choice of origin and defining lines) not by the hierarchy. However,
segments which are defined as parent and child will be considered to be
physically linked, so that forces can act directly between the two.
Each child segment is defined by an expression which states the name of
the parent to which it is attached, and the connection point in the child
segment. The segment definition statement syntax is:
segmentS=[pointI,(pointK-pointJ),(pointM-pointL),xyz,<pointA>,
<parent<,pointC>>]
Version 3.5 BodyBuilder for Biomechanics
Expressions 125
where the first five arguments in the expression are the origin, defining
lines, token, and antiflip point; parent is the name of the parent
segment, which must have been defined earlier in the script; and
pointC is the connection point in the child, defined in global space. If
the connection point is not specified, the connection will be at the origin
of the parent segment.
A hierarchical definition may be made by reference to a previously
defined segment, using an assignment statement which adds a parent and
attachment point to an existing free segment
segmentS=[segmentS,parent,pointC]
Attachment=segmentS(4)
The IF ELSE block is
described later
or
4(segmentS)
Rotations of Segments
A rotation refers to either:
Rotation Definition
A special pair of brackets <> is used to define a rotation. A rotation
expression can be:
If one segment and a token are enclosed in the <> brackets, the segment
rotation is global. If two segments are enclosed in the <> brackets, the
rotation is relative between the segments.
The first segment in the <> brackets is the child, or moving segment,
whose orientation is to be described relative to the second segment (or
global frame of reference). The second segment, if present, is the parent
or fixed segment.
In addition to the segment(s), a rotation definition includes a token of the
form xyz, which defines the order in which the angles are calculated.
If the token is omitted, the default is xyz.
The rotation is expressed as angles in degress about the fixed axes of the
second segment (or global frame if no second segment is supplied). The
order of the rotations is the same as that given by the axis token.
For a given rotation between two segments, there are twelve possible sets
of Euler angles. BodyLanguage specifically performs a fixed axis
calculation where the three angles are calculated in the given order
around the fixed axes of the parent segment.
However manipulation of the parameters passed to this routine allows
any of the floating axes possibilities to be used. This is described below.
Helical Vectors
Expressions 127
Global Rotations
A global rotation is a special case where one of the segments is aligned
with the global frame of reference. In any expression involving segments,
the global unit segment
[{0,0,0},{1,0,0},{0,0,1},xyz]
can be indicated by the numeral 1. For example, the expression
<Pelvis,1>
defines the global rotation of Pelvis, with angles measured about
global axes in the order xyz. This is equivalent to the expressions
<Pelvis,xyz> and <Pelvis,1,xyz>
For example,
CG: < LeftShank, LeftThigh,yxz>
Bio: -< LeftThigh, LeftShank,yxz>
The first example gives the fixed axis values, and the second gives
floating axis values from the Thigh to the Shank, which gives quite
different results. For further information about the underlying
mathematics of this operation, please refer to the document
EulerAngles.rtf.
Gimbal Lock
The most widely-used form for recording the rotation between two
segments is as 3 Euler (Cardan) angles. The primary rotation angle
(normally flexion) is defined about one axis (side-to-side, or lateral), a
secondary rotation angle (normally abduction/adduction) is defined about
a second axis (forward, or anterior), and a third rotation angle is defined
about the remaining axis (nominally vertical). This is the method used by
BodyBuilder.
However, Euler angles suffer from one well-known problem. If any of
the rotation angles becomes close to 90 degrees, for example lifting the
arm to point directly sideways (shoulder abduction about a forward axis),
the other two axes of rotation become aligned with one another, making
it impossible to distinguish them from one another (shoulder flexion and
rotation). This is known as gimbal lock.
True gimbal lock is rare, arising only when two axes are perfectly
aligned. A similar effect occurs when a segment spins through more than
one revolution. If the range of all three Euler angles is +/-180, there are
two possible sets of Euler angles which describe a given orientation. This
ambiguity may cause switching between one solution and the other,
resulting in sudden discontinuities. This situation resembles gimbal lock.
To avoid this, one of the angles must be restricted to +/-90 . In
BodyLanguage, the second angle is chosen to be restricted in this way.
This restriction applies to static trials.
In dynamic trials, if a segment rotates continuously, BodyLanguage
prevents discontinuities by keeping an internal record of rotations in a
form which does not suffer gimbal lock.
Expressions 129
130 Expressions
Kinetic Modelling
where
2.
3.
4.
In this example, the numbers on each line are taken from published
anthropometric data (Biomechanics and Motor Control of Human
Movement, David A. Winter, publ. John Wiley, p. 56).
The total body mass must be given, either in the model script or
(preferably, since it will be different for each subject) in the parameter
file, using the name BODYMASS, in a line such as
BODYMASS = 75 {*kilos*}
Force
Force objects have identical properties to points. They can be plotted and
saved as points, using OUTPUT() statements, or stored as parameters
using PARAM() statements. They can be defined from named or
constant numbers in the same way as points:
forceF = {numberA,numberB,numberC}
Moment
Moments, like forces, have identical properties to points. They can be
plotted and saved as points, using OUTPUT() statements, or stored as
parameters using PARAM() statements. They can be defined from
named or constant numbers in the same way as points:
momentM = {numberD,numberE,numberF}
Reaction
Reaction is a combination of force, moment, and point of application:
reactionR = |forceF,momentM,pointP|
Reactions can be added and subtracted. The result is referred to the point
referenced by the first reaction specified. Reactions can be negated in
sign. Reactions can also be added to the parameters list
PARAM(<. . .,>reactionR<,. . .>)
The three trajectory labels are generated from the reaction name, with the
suffixes F, M and P applied to the force, moment and point components
respectively, and the force and moment trajectories are marked
accordingly. The moment values are converted to Nm when they are
output, making them less distracting in the workspace view by limiting
the amplitude of their motions.
REACTION(segmentS)
REACTION(segmentS, PointP)
Gravity
Gravity is specified internally in a point format
GRAVITY = {0,0,9810}
POWER(segmentA,segmentB)
OUTPUT(LeftPowers)
Units
The following units are assumed within the calculations :
Mass
kilograms
kg
Distance
millimetres
mm
Force Newtons
Newtons
Moment
Newton millimetres
N.mm
Inertia
kilogram.millimetre.millimetre
Power
milliwatts
kg.mm2
mW
So if, for example, the force plate moment data is supplied in the C3D
file in Newton metres, it should be converted to N.mm by a line such as
ForcePlate1 = |ForcePlate1(1),
ForcePlate1(2)*1000, ForcePlate1(3)|
This line will not affect the reactions automatically applied from the
force plates. Instead, automatic application must be disabled, by setting
either the ForceThreshold to a very high value (at least 100*BodyMass
for example), or the DistanceThreshold to zero. Then the reaction from
the force plate can be applied to the segment using the CONNECT
function.
If such corrections to the incoming data are not made, then the output
values should be converted as necessary. Note that in calculating the
moment due to the angular acceleration, the moment is divided by 1000
internally, to convert correctly to N.mm, given that the inertia is supplied
in kg.mm2.
If using tables, the units the inertia are in depends on the units of the
length and mass of the segment, as supplied by BodyMass and the
segment definition of the origin and attachment point or the supplied
length expression.
Operators
Types of Operator
Operators are symbols used to combine, select, or compare objects in an
expression.
There are three types of operator: arithmetic, selective, and logical.
Arithmetic and selective operators can be used together in an arithmetic
expression.
The arithmetic operators are +, -, *, and /. They can be used to
combine objects of the same or of different types. The type of an
arithmetic operation is defined by the type of its result.
The selection operator is ?. It is used in an arithmetic expression
between clauses (sub-expressions) of the same type.
The logical operators AND, OR, NOT, <, >, and = are used to
compare numbers, or number expressions, within logical expressions.
Logical expressions are used only in Conditionality Tests.
In an expression, clauses are evaluated according to the order of
precedence:
(used to indicate negation)
/,*
-, +
>=, <=, >, <
<>, ==
NOT, OR, AND
Version 3.5 BodyBuilder for Biomechanics
Operators 145
Number Operations
Numbers can be added (+), subtracted (-), multiplied (*), or divided (/) in
an arithmetic expression. The result is always a number and the normal
arithmetic precedents apply.
Numbers can be compared in a logical expression. The result of a logical
expression is true or false:
numberA AND numberB
numberA OR numberB
numberA<numberB
numberA>numberB
is true if numberA is
greater than numberB
numberA==numberB
Point Operations
Points can be added (+) and subtracted (-):
(pointI+pointJ)/2
(pointJ-pointI)
146 Operators
Examples:
Point addition and subtraction:
FPelvis=(LFWT+RFWT)/2
defines the virtual point FPelvis as the mid-point of the line joining
the real markers LFWT and RFWT.
LFemur=[LKJC,LHJC-LKJC,LAJC-LKJC,zyx,LTOE-LKJC]
defines the segment LFemur using the lines LHJC-LKJC and LAJCLKJC as defining lines, and LTOE-LKJC as the anti-flip line.
Number comparison:
If
$Static==1
$#Child#Length=DIST(0(Child),0(Parent))
PARAM($#Child#Length)
EndIf
Example:
%LHJC=PelvisDiameter*$%HipOffsetFactor
Version 3.5 BodyBuilder for Biomechanics
Operators 147
%pointI = pointI/segmentP
Note that it is the operators in the expression which define the action, not
the % character in the name of the point object.
Segment Operations
Points can be added to (+) and subtracted from (-) segments. The result
is a segment in a new position but with the same rotation.
segmentP = segmentP+pointI
-0(segmentP)
segmentP is moved to
pointI
Selection Operator
148 Operators
Operators 149
150 Operators
Functions
Types of Function
A number of special functions and constructions may used in an
expression. They are defined according to the type of their result.
Number Functions
1(pointI),2(pointI),
Components of
3(pointI)
pointI
or
pointI(1),..(2),..(3)
Components of
pointI
n(rotation) or
rotation(n)
of rotation
COMP(pointI,pointJ)
Component of pointI in
direction of pointJ
DIST(pointI,pointJ)
SIN(Angle)
COS(Angle)
Functions 151
TAN(Angle)
ASIN(Value)
ACOS(Value)
ATAN(Value)
ATAN2(x,y)
SQRT(Value)
Point Functions
O(segmentP), or 0(segmentP)
152 Functions
1(segmentP), 2(segmentP),
3(segmentP), or
segmentP(1), ..(2), ..(3)
Directions of axes of
segmentP
NORM(pointI,pointJ,pointK)
Direction perpendicular to
plane of 3 points I,J,K
PERP(pointI,pointJ,pointK)
Point at perpendicular
bisector from point I to line
J-K
CHORD(numberA,pointI,
pointJ,pointK)
The CHORD function may be useful in locating the centre of the knee
joint given the hip joint centre and a marker on the mid-thigh and lateral
condyle of the knee. This method is used in VICON Clinical Manager
gait analysis software.
In the illustration above, the green point is created using the CHORD
function. The line between points I and J is used as the diameter of a
Version 3.5 BodyBuilder for Biomechanics
Functions 153
circle. The plane of the circle is the plane of this line and point K. Any
point on the red semicircle will fulfill the right-angle criterion, and the
distance A specifies the point indicated. The distance A is thus used in
the construction as the chord of a circle, hence the name of the function.
Segment Functions
ATTITUDE(segmentP)
Rotation Functions
rotation(-n)
<numberA,numberB,numberC>
Define a rotation from three numbers. This
function has the same syntax as rotation
definition
Special Functions
LAST()is a special function used to recall the most recent arithmetic
value of an object from the current or any previous field. If the object has
never previously been defined, it remains undefined.
LAST(pointI)
154 Functions
EXIST(pointI)
AVERAGE(pointI)
AVERAGE(segmentP)
AVERAGE(rotation )
Functions 155
The "sample offset" function has many uses, including the creation of
special filters.
FIELD or SAMPLE, FIRSTSAMPLE and LASTSAMPLE are special
predefined values that can be used in the script to provide the current,
first and last sample numbers in the trial that is being processed. These
are fixed values, and cannot be changed.
Spine
SPINE()is a special segment function for creating new segments based
on the position and orientation of existing ones. As the name implies, it
is designed for creating vertebrae between the segments Pelvis, Thorax
and Head. The general form is
SPINE(<length,><direction,>SegmentL,<location,
>SegmentU<,stiffnessL><,stiffnessU>)
The parameters in <> brackets are optional. The default values listed
below are used if they are omitted:
SegmentL
SegmentU
length
The default length of the spine is the length of the cubic base spline
between the end segments.
direction
156 Functions
directions of the ends of the spine. The same local direction is used for
new segments generated within the spine. Default is the Z or 3 axis.
is the relative distance (0 - 1) along the spine
from SegmentL to SegmentU where the
origin of the new segment will be located. Default is 0.5
location
Functions 157
Segment1,Segment2,...,SegmentN
<location1>,<location2>,...,<locationN>
are the optional relative distances of the
new segments along the spine. Locations always appear before the
segment to which they apply.
The optional parameters length, direction and stiffness can be included
and have the same effect as in the previous mode.
This mode of the SPINE function is used on its own, rather than as an
expression in an assignment. It does not appear on the right of a = sign.
=
=
=
=
=
=
1
2
3
-1
-2
-3
Their values may be changed, but they may not be assigned as points,
segments or rotations.
158 Functions
Non-Assigning Statements
There are three statement lines which do not make assignments.
OUTPUT(pointI,rotation ,..)
Create output records of pointI and rotation for
all the samples for which they exist. Output records are
displayed in the 3D Workspace and can be saved.
PARAM(numberA,pointI,segmentP,rotation )
Append assignments for
numberA,pointI,segmentP and rotation to
parameter section of current BodyLanguage script.
Parameter sections can be saved.
OptionalPoints(pontI,pointJ,..)
Listed points may be referenced in an expression even if
they do not exist in the input C3D file. Any expression
derived a non-existent optional point is not evaluated. There
are also OptionalNumbers, OptionalForces etc. functions
too.
Conditionality Tests
BodyLanguage allows user-specified assignments to be made if, and only
if, the current value of a logical expression is TRUE or FALSE.
The form of a Conditionality Test is:
IF logicalexpression (THEN) assignment...
(ELSIF logicalexpression...) (ELSE
assignment...) ENDIF
where brackets indicate optional elements of the test.
Functions 159
160 Functions
Macros
Uses of Macros
In a BodyLanguage script, many separate sections can end up repeating
the same basic set of instructions. For example, the procedure for filling
gaps in a group of related points may be identical but for the names of
the points involved.
In order to make scripts shorter, easier to read, and more reliable,
BodyLanguage supports the defining and calling of macros. A macro
works like a subroutine in a compiled program. Once defined, a macro
can be called as many times as required, thereby eliminating repetitions
of text. Only when the script is executed, is each macro call
automatically replaced by the lines in the macro definition.
In order to make a macro applicable in different situations, it can be
defined using a set of dummy variables or macro parameters. These
parameters are listed at the start of the macro definition. When the macro
is executed, the parameters are replaced by a matching set of real
variable names.
A macro definition, which must occur earlier in the script than any
corresponding macro calls, starts with:
define macro <macroname>(parameter1,
parameter2, ...)
(although the word define is optional), and ends with:
endmacro
where:
Version 3.5 BodyBuilder for Biomechanics
Macros 161
162 Macros
Other Expressions
Comments
Comments are encouraged. Each comment string starts with characters
{* and ends with characters *}. Comments can be "nested", ie. a
complete section of script can be commented out although it includes
comments. This requires strict matching of the {* and *} symbols in
pairs. If an unmatched comment symbol causes a model script to fail to
run, an error message will indicate the cause of failure, and the cursor
will be placed at the first unmatched {*symbol.
Error Codes
Every time a BodyLanguage script is run, it first checks the parameters
and model for errors.
If an error is found, a dialog box displays the error message. The line
containing the error is highlighted and diplayed in the appropriate text
window. If necessary, the text editor window will be opened, and the text
will be scrolled to make the line visible. The error message also appears
in the status bar at the bottom of the main application window. If you
change windows of scroll the text, pressing the "show last error" button
will re-display the offending line, and the error message.
If the cause is in a macro expansion, pressing the "show last error"
button, or selecting the menu command, will display the line in the macro
where the error occured. Pressing the button further will alternate
between the two lines, to allow you to check both the macro code, and
the arguments you are passing to the macro.
Anatomical Structure
The model FOOT divides the foot into several segments with limited
degrees of freedom between them. The first segment defined is the tibia.
Beneath this, and related to it by a simple hinge joint about an
intermalleolar axis, is the talus segment. The position and orientation of
the talus is deduced entirely from the segments around it - no markers are
attached to it directly. The calcaneus is defined below the talus and
related to it by a simple hinge joint, the subtalar joint, about an axis
which is defined by the placement of a marker on the instep. The central
part of the foot is represented by a midfoot segment, and the toes by a
hallux segment.
Axis Definitions
The axes of rotation for the tibia-talus joint (ankle flexion joint) and the
subtalar joint, in this model, are not derived from any assumed
relationship between exterior landmarks and interior anatomy. The
locations of these axes are determined entirely by marker placement. It is
assumed, for example, that the ankle flexion joint axis lies between the
malleoli, and it is suggested that the two markers labelled LMAL and
MMAL are placed on these exterior landmarks, however, if they are
placed elsewhere, the axis will be located on a line between them. Thus,
the user has the freedom to define the location of this axis by placing the
markers where they choose on the subject.
This contrasts with the assumptions made in the kinematic model used in
VICON Clinical Manager, for example, where it is assumed that the
markers will be placed on stated landmarks (such as the anterior superior
iliac spines) and a theory of anatomy (based on cadaver studies) is used
to derive the locations of the hip joint centres. In such a model,
misplacement of the markers will invalidate the assumptions, and lead to
erroneous interior points being calculated. In FOOT, there are no such
Version 3.5 BodyBuilder for Biomechanics
assumptions, and if the user has their own opinion about the location of
the axes concerned, they can place the markers accordingly. Users of
models like this should be aware of the implications for comparability of
data from different workers.
Handedness
This model has two equivalent sections, one for the left foot, dealing
with all the markers whose labels begins with L, and one for the right
foot, dealing with the markers whose labels begin with R. The two
sections are very similar, but not quite identical - the corresponding
segments on either side cannot be mirror images of each other, because
of the requirement that all segment axes form a right handed system.
Model Script
Comment Section
The following comment section describes the markers used.
{*VICON BodyLanguage*}
{*copyright Oxford Metrics 1997*}
{*Foot.MOD, for use with Foot.MP paramter file*}
{*This a sample file for BodyBuilder for
Biomechanics. It is supplied to illustrate some
of the range of modelling techniques made
possible by this program. It should NOT be used
for clinical or research purposes without
independent verification. Oxford Metrics
accepts no liability for its performance.*}
{*The model uses a total of 28 markers:
Lateral and Medial Epicondyles of the Knee
RLEPC, RMEPC, LLEPC, LMEPC
Tibial Tuberosity
L/RTTUB
Shin
L/RSHN1, L/RSHN2
Lateral and Medial Malleoli L/RMMAL, L/RLMAL
Lateral and Medial Calcaneus L/RMCAL, L/RLCAL
166 Example Model - FOOT
Macro Substitute4
{*Start of macro section*}
{*======================*}
macro Substitute4(p1,p2,p3,p4)
This line defines the segment s234, whose origin is at p3, whose Axis
1 is parallel to the line from p3 to p2, and whose second defining line is
the line from p4 to p3. This segment will exist in every frame in which
the points p2, p3 and p4 are all present.
p1V = Average(p1/s234)*s234
The above line defines the global point p1V in the following way. First,
the expression in () brackets is evaluated in every frame for which it is
valid. p1/s234 is the local position of p1 relative to the segment s234.
Therefore, the expression is valid in each frame in which all four points
are present. Then, the average of this throughout the trial is evaluated,
resulting in a single averaged local point (ie. not a separate value for
each frame). Finally, this is converted to a global point by the *s234
operator, and this is evaluated in each frame, as the segment s234 is not
fixed. The result is a new point, p1V, which is fixed relative to segment
Version 3.5 BodyBuilder for Biomechanics
s234, and exists in every frame in which s234 exists. The averaging
process acts as a kind of filter, in which the movement of p1 is smoothed
by relating it to p2, p3 and p4. The result is that p1V will behave more
smoothly than p1. Also, p1V will exist in frames in which p1 itself does
not exist. This is the key feature of the operation.
s341 = [p4,p3-p4,p4-p1]
p2V = Average(p2/s341)*s341
s412 = [p1,p4-p1,p1-p2]
p3V = Average(p3/s412)*s412
s123 = [p2,p1-p2,p2-p3]
p4V = Average(p4/s123)*s123
p1 = (p1+p1V)/2
p2 = (p2+p2V)/2
p3 = (p3+p3V)/2
p4 = (p4+p4V)/2
endmacro
?
?
?
?
p1
p2
p3
p4
?
?
?
?
p1V
p2V
p3V
p4V
Optional Points
{*Points which may not be present in every
trial*}
OptionalPoints(RMEPC,RMMAL,RP5MT,RTTUB,RSHN2)
OptionalPoints(LMEPC,LMMAL,LP5MT,LTTUB,LSHN2)
168 Example Model - FOOT
Segment Definitions
{* Tibia segment *}
{* ============= *}
{* This segment uses 7 markers in static trials
(L/MEPC,TTUB,SHN1/2,L/MMAL), with medial markers
(MEPC and MMAL) removed for motion trials*}
{*Minimise dropouts of RLEPC and RLMAL*}
SUBSTITUTE4(RLEPC,RTTUB,RSHN1,RSHN2)
SUBSTITUTE4(RLMAL,RTTUB,RSHN1,RSHN2)
{*Create a dummy segment using most visible
tibia markers, present in all trials*}
DummyTibia = [RLMAL,RLEPC-RLMAL,(RLMAL+RLEPC)/2RSHN1]
In this part, the marker RMMAL and virtual points RAJC and RKJC are
recreated from the parameters calculated earlier.
{*Define Tibia segment with third axis aligned
with long axis of tibia*}
RTibia = [RAJC,RKJC-RAJC,RMMAL-RLMAL,zxy]
In this definition, the segment origin is at the ankle centre, and the first
defining line is the line from the ankle centre to the knee centre. This line
(because of the token zxy) becomes the third axis. The second defining
line is from the lateral to the medial malleolus. Because of the token, this
means the second axis of the tibia section is in the plane defined by the
first axis and the line RMMAL-RLMAL, and is positive in the lateral-tomedial direction (inward). This segment is of genuine interest, unlike
DummyTibia, which is not referred to again.
{*Draw Tibia, using 16 vertices, scaled to
length of Tibia*}
RTIB1 = $RTibiaScale*{10,0,95}*RTibia
RTIB2 = $RTibiaScale*{-4,-10,100}*RTibia
RTIB3 = $RTibiaScale*{-4,0,100}*RTibia
RTIB4 = $RTibiaScale*{-4,10,100}*RTibia
RTIB5 = $RTibiaScale*{3,0,80}*RTibia
170 Example Model - FOOT
RTIB6
RTIB7
RTIB8
RTIB9
RTB10
RTB11
RTB12
RTB13
RTB14
RTB15
RTB16
=
=
=
=
=
=
=
=
=
=
=
$RTibiaScale*{0,-8,80}*RTibia
$RTibiaScale*{-3,0,80}*RTibia
$RTibiaScale*{0,3,80}*RTibia
$RTibiaScale*{3,0,20}*RTibia
$RTibiaScale*{0,-6,20}*RTibia
$RTibiaScale*{-3,0,20}*RTibia
$RTibiaScale*{0,3,20}*RTibia
$RTibiaScale*{10,0,10}*RTibia
$RTibiaScale*{0,-10,0}*RTibia
$RTibiaScale*{-5,0,10}*RTibia
$RTibiaScale*{0,10,4}*RTibia
OUTPUT(RKJC,RAJC)
OUTPUT(RTIB1,RTIB2,RTIB3,RTIB4,RTIB5,
RTIB6,RTIB7,RTIB8)
OUTPUT(RTIB9,RTB10,RTB11,RTB12,RTB13,
RTB14,RTB15,RTB16)
This section defines sixteen new virtual points for the purpose of
drawing a simulacrum of the tibia in the Workspace display. The points
will be joined together when a suitable MKR file is selected with the
required links.
{*Draw y-axis of Tibia*}
RAKJ1 = RAJC+100*2(Tibia)
RAKJ2 = RAJC-100*2(Tibia)
OUTPUT(RAKJ1,RAKJ2)
In this section, two points are defined to illustrate the second axis of the
tibia section. Note that the above two sections contained OUTPUT
commands, which means that they actually generate new data points in
the C3D file.
RTibia2=[RAJC,RLMAL-RMMAL,RAJC-RKJC,yxz]
{* Talus *}
{* ===== *}
{* This segment uses 3 real (RL/RMMAL,RP2MT) and
one virtual (RCCAL) markers*}
{*Find mid-point of Calcaneous*}
RCCAL = (RLCAL+RMCAL)/2
{*Minimise dropouts of LEPC and LMAL*}
SUBSTITUTE4(RLMAL,RMMAL,RCCAL,RP2MT)
{* Draw Malleolar axes along y-axis of Tibia*}
RMALC= (RLMAL+RMMAL)/2
RMAL1 = RMALC+(RLMAL-RMMAL)
RMAL2 = RMALC-(RLMAL-RMMAL)
OUTPUT(RMAL1,RMAL2)
In this section, two points are defined which illustrate the inter-malleolar
axis. This axis is not parallel to the tibia lateral axis.
{*Define Upper Talus segment with lateral(y)
axis along inter-malleolar (RLMAL-RMMAL) line*}
RTalusU = [RAJC,RMMAL-RLMAL,RP2MT-RCCAL,yzx]
The Upper Talus segment is defined with its origin at the same point as
that of the tibia, and with the intermalleolar line as its second axis.
If $Static ==1
{*Save Upper Talus scale as parameter*}
$RTalusScale = ((DIST(RLMAL,RMMAL)$MarkerDiameter)/1.5)/100
PARAM($RTalusScale)
EndIf
RTalusU=ROT(RTalusU,1(RTalusU),-$TalusRotation)
This section creates virtual points which are used to draw a box shape to
represent the talus in the Workspace window.
{*Define Lower Talus segment with anterior(x)
axis along subtalar (RP2MT-RCCAL) line*}
RTalusL = [RSTJ,RP2MT-RCCAL,RMMAL-RLMAL,xzy]
{*Draw Subtalar axis along x-axis of Lower
Talus*}
RSTJ1 = RSTJ+100*1(TalusL)
RSTJ2 = RSTJ-100*1(TalusL)
OUTPUT(RSTJ1,RSTJ2)
This section defines another segment which has a different origin and
orientation to Upper Talus, but which does not move relative to Upper
Talus.
{* Calcaneus *}
{* ========= *}
{* This segment has 3 real (RL/RMCAL,RP2MT)
markers*}
If $Static ==1
{*Save Calcaneus scale as parameter*}
$RCalcaneusScale = ((DIST(RP2MT,RCCAL)$MarkerDiameter)/3)/100
PARAM($RCalcaneusScale)
EndIf
{*Define Calcaneus segment with anterior(x) axis
along subtalar (P2MT-CCAL) line*}
RCalcaneus = [RCCAL,RMCAL-RLCAL,RP2MT-RCCAL,yzx]
This segment is defined with its origin at the point RCCAL (mid-point of
calcaneus markers).
{*Apply rotation offset parameters*}
Calcaneus =
ROT(Calcaneus,2(Calcaneus),$CalcaneusFlexion)
Calcaneus =
ROT(Calcaneus,3(Calcaneus),$CalcaneusAbduction)
Calcaneus =
ROT(Calcaneus,1(Calcaneus),$CalcaneusInversion)
{* Midfoot *}
{* ======= *}
{* This segment has 3 real (RD5MT,RP/RD2MT)
markers*}
{* Hallux *}
{* ====== *}
{* This segment has 1 real (RHLX) marker*}
{*Apply toe width offset*}
RD1MT=RD2MT-$ToeWidth*2(RMidfoot)
{*Define Hallux segment with lateral (y) axis
aligned with Midfoot y-axis*}
RHallux=[RHLX,-2(RMidfoot),RHLX-RD1MT,yxz]
Version 3.5 BodyBuilder for Biomechanics
If $Static ==1
{*Save Hallux scale as parameter*}
$RHalluxScale = DIST(RHLX,RD2MT)/150
PARAM($RHalluxScale)
EndIf
{*Reposition Hallux, maintaining attitude*}
%RDHLX = {-5*$RHalluxScale,0,0}
RDHLX = %RDHLX*RHallux
RHallux = RDHLX+Attitude(RHallux)
{*Draw Hallux, using 8 scaled vertices*}
RHLX2 = $RHalluxScale*{-20,70,40}*RHallux
RHLX1 = $RHalluxScale*{-15,-20,0}*RHallux
RHLX4 = $RHalluxScale*{-15,10,80}*RHallux
RHLX3 = $RHalluxScale*{-20,70,80}*RHallux
RHLX6 = $RHalluxScale*{-30,70,40}*RHallux
RHLX5 = $RHalluxScale*{-20,-20,-20}*RHallux
RHLX8 = $RHalluxScale*{-40,-10,80}*RHallux
RHLX7 = $RHalluxScale*{-40,70,80}*RHallux
OUTPUT(RDHLX,RHLX1,RHLX2,RHLX3,RHLX4,RHLX5,
RHLX6,RHLX7,RHLX8)
The use of the segment RTibia2 in the definition of RANKA means that
the two segments in the angle definition have a common axis, the
intermalleolar axis, so the relative rotation of the two segments is forced
to be around this axis. Only one component of RANKA should have a
significantly non-zero value, as a result.
The order of points in the second defining line being the reverse of that
in the corresponding right foot definition.
VCM interpolates between data points, which this model does not. Also,
VCM uses a static trial to determine certain parameters, while this model
is only able to process walking data. This model will not, therefore,
replicate the results of VCM precisely.
In addition, it should be noted that while the models used in gait analysis
software products such as VCM are fixed, the model described here is
open to editing. Also, while the model in VCM has been verified by
widespread testing and use, any reproduction of similar methods in
BodyLanguage will not be so well verified. The intention of this model is
to illustrate modelling methods, and to provide a starting point for further
developments. It should not be used for clinical gait analysis.
Force Vectors
{*VICON BodyLanguage (tm)*}
{*For use only with BodyBuilder Version 4.0, or
higher*}
{* Show the force plates *}
if EXIST( ForcePlate1 )
Force1 = ForcePlate1(1)
Moment1 = ForcePlate1(2)
Centre1 = ForcePlate1(3)
Segment Definitions
{*Pelvis*}
{*======*}
PEL0=(LASI+RASI)/2
Pelvis=[PEL0,LASI-RASI,PEL0-SACR,yzx]
The Pelvis segment is defined using the markers LASI , RASI and
SACR if all three are present. The right-to-left direction between the
ASIS markers is the second axis of the segment. The plane of all three
markers is the plane containing the first and second axes, the first axis
pointing in an anterior direction.
{*Hip Joint Centres are positioned within the
Pelvis segment by user-set offsets, scaled
by inter-ASIS distance*}
InterASISDist=DIST(LASI,RASI)
Version 3.5 BodyBuilder for Biomechanics
LHJC=(InterASISDist*$%LHipOffsetFactor)*Pelvis
RHJC=(InterASISDist*$%RHipOffsetFactor)*Pelvis
{*Femora*}
{*======*}
KneeOffset=($MarkerDiameter+$KneeWidth)/2
LKJC=CHORD(KneeOffset,LKNE,LHJC,LTHI)
RKJC=CHORD(KneeOffset,RKNE,RHJC,RTHI)
LFemur=[LKJC,LHJC-LKJC,LTHI-LKJC,zxy]
RFemur=[RKJC,RHJC-RKJC,RKJC-RTHI,zxy]
The femur segment definition uses the CHORD function to locate the
knee centre. This virtual point is then used as the origin in the femur
segment definition.
{*Femoral Rotation can be adjusted*}
LFemur=ROT(LFemur,3(LFemur),$LFemurRotation)
RFemur=ROT(RFemur,3(RFemur),$RFemurRotation)
The attitude of the femur segment can be adjusted using a thigh rotation
parameter, allowing the user to compensate for mis-positioning of the
thigh marker.
LFemurLength=DIST(LKJC,LHJC)
RFemurLength=DIST(RKJC,RHJC)
184 Example Model - Kinetic Leg Model
The foot segments are defined using the line between the knee and ankle
joint centres, with the result that the foot segment does not have three
rotational degrees of freedom relative to the tibia.
{*Apply Static Trial Offsets*}
LFoot=ROT(LFoot,2(LFoot),$LStaticPlantarFlexion)
RFoot=ROT(RFoot,2(RFoot),$RStaticPlantarFlexion)
{* Add the hierarchical and inertial
characteristics *}
LFoot=[LFoot, LTibia, LAJC, 0.0145*BodyMass,
DIST(LTOE,LAJC)*{0.5,0,0},
DIST(LTOE,LAJC)*DIST(LTOE,LAJC)*{0,0.226,0.226}*
0.0145*BodyMass]
RFoot=[RFoot, RTibia, RAJC, 0.0145*BodyMass,
DIST(RTOE,RAJC)*{0.5,0,0},
DIST(RTOE,RAJC)*DIST(RTOE,RAJC)*{0,0.226,0.226}*
0.0145*BodyMass]
RHPA=<1(RHPA),-2(RHPA),-3(RHPA)>
LKNA=<LFemur,LTibia,yxz>
LKNA=<-1(LKNA),2(LKNA),3(LKNA)>
RKNA=<RFemur,RTibia,yxz>
RKNA=<-1(RKNA),-2(RKNA),-3(RKNA)>
LANA=<LTibia,LFoot,yxz>
LANA=<1(LANA),-2(LANA),3(LANA)>
RANA=<RTibia,RFoot,yxz>
RANA=<1(RANA),-2(RANA),-3(RANA)>
OUTPUT(PELA,LHPA,RHPA,LKNA,RKNA,LANA,RANA)
{*Segment Axes*}
{*============*}
PEL1=PEL0+50*1(Pelvis)
PEL2=PEL0+50*2(Pelvis)
PEL3=PEL0+100*3(Pelvis)
LFE0=0(LFemur)
LFE1=LFE0+50*1(LFemur)
LFE2=LFE0+50*2(LFemur)
LFE3=LFE0+LFemurLength*3(LFemur)
RFE0=0(RFemur)
RFE1=RFE0+50*1(RFemur)
RFE2=RFE0+50*2(RFemur)
RFE3=RFE0+RFemurLength*3(RFemur)
LTI0=0(LTibia)
LTI1=LTI0+50*1(LTibia)
LTI2=LTI0+50*2(LTibia)
LTI3=LTI0+LTibiaLength*3(LTibia)
RTI0=0(RTibia)
RTI1=RTI0+50*1(RTibia)
RTI2=RTI0+50*2(RTibia)
RTI3=RTI0+RTibiaLength*3(RTibia)
LFO0=0(LFoot)
LFO1=LFO0+50*1(LFoot)
LFO2=LFO0+50*2(LFoot)
LFO3=LFO0+100*3(LFoot)
RFO0=0(RFoot)
Version 3.5 BodyBuilder for Biomechanics
RFO1=RFO0+50*1(RFoot)
RFO2=RFO0+50*2(RFoot)
RFO3=RFO0+100*3(RFoot)
{*Virtual Points Output*}
{*=====================*}
OUTPUT(PEL0,PEL1,PEL2,PEL3,LHJC,RHJC)
OUTPUT(LFE0,LFE1,LFE2,LFE3,RFE0,RFE1,RFE2,RFE3,L
KJC,RKJC)
OUTPUT(LTI0,LTI1,LTI2,LTI3,RTI0,RTI1,RTI2,RTI3,L
AJC,RAJC)
OUTPUT(LFO0,LFO1,LFO2,LFO3,RFO0,RFO1,RFO2,RFO3)
These virtual points are defined to make the segments visible in the
Workspace window, when a suitable MKR file is selected.
r3 = REACTION( LFemur )
FP1 = | ForcePlate1(1), ForcePlate1(2),
ForcePlate1(3) |
CONNECT( LFoot, FP1, 1 )
{* ABS( ForcePlate1(1) ) > 5 ) *}
%r2 = REACTION( LFoot )
r2 = %r2 * LFoot
Force = r2(1)
Moment = r2(2)
Centre = (r2(3) - { Moment(2)/Force(3), Moment(1)/Force(3), 0 })
Force = Force + Centre
M2 = %r2(2)/(BodyMass)
output( Force, Centre, M2 )
P2 = { POWER( Pelvis, LFemur )/BodyMass, POWER(
LFemur, LTibia )/BodyMass,POWER( LTibia, LFoot
)/BodyMass }
output( p2 )
Glossary of Terms
Acclaim
File formats .AST, .ASF and .AMC were devised by Acclaim Corp. for
the description of kinematic models and motion data.
BodyLanguage
The language in which kinematic models for BodyBuilder are written.
Browse box
Also called a Browser. A small window which allows rapid search of
directory trees to find particular files.
Current field
The field displayed in the Workspace window. The number of the
current field is shown under the replay slide bar. May be referred to as
Current Frame or Current Sample.
Dongle
A hardware key which must be plugged into a computer before
BodyBuilder can be run. Supplied to licensed users by Oxford Metrics
Ltd.
Field
A time-sample of kinematic data. In standard video terminology, a
"frame" is composed of one even- and one odd-numbered field. In
kinematic modelling, as in cine film, the distinction between even and
odd fields is lost, and the word "frame" is often used interchangeably
with "field".
Gait analysis
The study of human movement for medical purposes.
Global point
A point which is defined in terms of the VICON reference axes, which
are constant throughout a trial.
Interpolation
Filling a gap in a trajectory by inventing new points. Small gaps in
smooth trajectories may be interpolated reliably. Large gaps and
trajectories which are not smooth are more difficult to interpolate, and
the results may be unrealistic. Interpolation should be used with caution.
Inverse Kinematics
Deducing the movements of segments from the desired overall result
rather than measured motion. For example, deducing the movements of
leg segments from the requirement that the feet do not move relative to
the floor. This is an inverse problem without a unique solution.
Kinematic angles
Numerical description of the angular relationship between connected
body segments of a kinematic model. Stored as three numbers.
Kinematic model
A numerical description of a moving object, composed of segments and
links.
Label
A name by which a point or trajectory is identified. Limited to 16
characters.
Local point
A point defined in terms of the axes of a particular segment, which is
itself able to move during the trial.
Marker
A reflective ball fixed to the performer. Also called a real marker, or
physical marker, to distinguish between trajectories which result from
actual measurements, and virtual ones created by modelling.
192 Glossary of Terms
Operating system
Software which controls the operation of a computer. BodyBuilder
requires a 32-bit operating system, which may be either Windows NT
(preferred) or Windows 95.
Passband
The range of frequencies allowed through a filter. Motion at a nearly
constant speed has low frequency components; motion involving high
accelerations has high frequency components which may fall outside the
passband of a filter.
Point
A location in space, specified by 3D co-ordinates. A trajectory (or
segment of a trajectory) consists of a time-series of points. A point is
stored in a .C3D file as three spatial co-ordinates and a residual,
identified by a label. Points may represent the measured positions of real
markers, or may be virtual (created by modelling). Point and marker
are often used interchangeably.
Pointer
Screen symbol (by default, an arrow) which is controlled by moving the
mouse.
Reconstruction
The calculation of the position of a marker by a VICON 370 system.
Script
A set of BodyLanguage definitions and functions which can be run by
BodyBuilder. Scripts are contained in .MOD files.
Segment
In a kinematic model, body parts are represented by segments, which are
assumed to be rigid elements linked by joints. Segments have both
position and orientation. (The term "trajectory segment" is sometimes
used to describe a short or interrupted marker trajectory.)
Spike
A point which lies to one side of an otherwise smooth trajectory. Spikes
can occur as a result of a mis-resconstruction in a single field, perhaps
caused by video noise or marker obscuring.
Static trial
A short capture during which the performer stands still. Used for creating
Acclaim skeleton files and for deriving subject-specific parameters.
Stick
A line connecting two points as displayed in the Workspace window.
Defined in the current .MKR file, sticks are a useful graphic aid, but
have no significance above that of the points they link.
System memory
The working memory (RAM) of a computer. Data and programs in
current use are held in system memory, and will be lost if the computer is
shut down before they are written to disk.
Toggle
A command, button or key which causes a particular display, function or
feature to change between its two possible states.
Trajectory
The path through space followed by a marker, whether real or virtual.
Stored in a .C3D file as a time-series of points with the same label. May
consist of several trajectory segments separated by gaps, or a single,
uninterrrupted trajectory, depending on marker visibility. Displayed in a
Workspace window as a line through the position of the marker in the
current field.
Trial
A single data capture. The word also refers to the .C3D file resulting
from a data capture.
Virtual point
A point produced by kinematic modelling, in a position where no real
marker existed during motion capture. Virtual points may represent
internal features such as joint centres, where it is impossible to place a
real marker.