A brief tour through ANZ, TELIO, and SHOW3D

The full distribution of ANZ software package includes a DATA subdirectory
that contains sample data for human locomotion. This includes Oxford Metrics
AMASS combined motion and analog data (.C3D) files and Motion Analysis
Corporation marker path (.P3D) and analog (.ANA) files. Both sets of data
are normal human locomotion measured using the Helen Hayes marker set.

This tour will use the AMASS data file to show you some of the features of
ANZ, TELIO and SHOW3D. In the following text, commands you should type are
given in capital letters while comments about what is being done are in both
upper and lower case letters. After the commands, comments may be included 
after an exclamation mark (!) Don't type these in.

All three programs are command line driven meaning that you must type in 
commands to make them do anything. All commands consist of three letters.
You can type more letters if you want but they will be ignored. Commands
are separated by one or more spaces. Many commands have options that
modify their effect on the programs. A command may be as simple as

HIS

or a complex as

EMG FIL/TCV/HIG=250/LOW=30/BUT/ORD=8

Start the tour by first moving to the distribution directory for the
software, setting some environment variables, and running ANZ.

CD \DISTRIB
ENV
ANZ

If everything went well, after a bit the ANZ welcome screen should appear.
The amount of time to startup ANZ will vary with the computer. On a 66MHz
486 PC it takes about 20 seconds. Note that you must have at least a 386
PC with a math coprocessor and 16Megabytes of available disk space to run
ANZ. The program was built with the WATCOM 32bit compilers and requires
quite a bit of memory. The large memory requirements are a result of how
the program was written a few years back when I started out using FORTRAN 
on a VAX with the VMS operating system. Decreasing these requirements
will require a lot of rewriting of the code. It works well as is on my 
machine so it is going stay this way for the forseeable future.

Read in the motion and analog data

REA/OSU DATA\NANCY006.C3D

The /OSU switch indicates that the Ohio State marker set is in the file. This
is the same as the Helen Hayes marker set except that the thigh wand points 
anterior rather than lateral as in the Helen Hayes set. Note that all commands
in ANZ, TELIO and SHOW3D use a hierarchy of becoming more specific as you 
continue typing.

Now check the marker trajectories for any breaks and fill them in using
polynomial interpolation.

MRK INT

This command stands for Marker Interpolation.

Now adjust the ankle and knee markers by moving them medially and create
some hip markers from the pelvis and knee markers. (See the program code
for references on how this is done)

MRK ADJ     ! this is MaRKer ADJust

Smooth the markers using Herman Woltring's GCVSPL routine (Generalized
Cross Validation using Splines). Use an option to override the automatic 
selection of the smoothing frequency and set it to 10 Hz. Also, calculate
the marker trajectory velocities and accelerations.

MRK SMO/FRE=10/VAA   ! MaRKer SMOoth/FREquency=10hz/VelocityAndAcceleration

There many options to this command. In general, you can find out what the 
options for a command are by typing in some junk for the option- /QQQ 
will always do. ANZ will print out an error message which will be somewhat
descriptive (hopefully). Try this out.

MRK SMO/QQQ

Now calculate the segment position and orientation. This is the 3D position
and rotation matrix of the segment relative to a global coordinate as defined
by the marker trajectory data.

SEG POS   ! SEGment POSe

Calculate the segment euler angles relative to the global coordinate system.

SEG ANG   ! SEGment ANGle

Calculate segment velocity and acceleration with GCVSPL

SEG VAA/FRE=10  ! SEGment VelocityAndAcceleration/FREquency=10hz

Now look at what has been done so far with the history command.

HIS    ! HIStory

ANZ stores a copy of the command history which can be looked at any time.
This history will be stored in the same file as all other analysis results
so that you can always know how your results were calculated.

Look at what segment quantities have been calculated so far.

STA SEG   ! STAtus SEGment

Now set the subject specific data: Name, sex, age, weight, height, and a 
comment describing the data set.

SUB NAM jane q. public
SUB AGE 38
SUB SEX f
SUB WEI 130 lbs
SUB HEI 66 in
SUB COM this is a normal gait cycle for an adult woman

Note that the weight and height can be specified in metric units. Just give
the command KG (kilograms) after the weight rather than LBS (pounds) and 
M (meters) or CM (centimeters) after the height rather than IN (inches).

Review what was put in for a subject description

STA SUB  ! STAtus SUBject

Note that the abbreviation PAT for patient can be used in place of SUB if
you want.

Now calculate body segment parameters. These are the masses and inertias of
the segments as well as the segment dimensions including estimation of 
joint location relative to the segment local coordinate systems.

SEG PRM   ! SEGment PaRaMeters

You will notice that the estimated weight does not equal the actual weight.
This is because the estimated weight is the sum of the individual segment
weights calculated from regression equations that are based primarily on
the segment dimensions of an average person. Separate equations are used for 
men, women, and children, but they are all just estimates. See the source 
for references regarding these equations have been adapted from.

Calculate the joint angles, velocities and accelerations.

JNT JAN   ! JoiNT Jcs ANgle
JNT JVA   ! JoiNT Jcs Velocity and Acceleration

Joint angles in ANZ are calculated relative to the Joint Coordinate System
which corresponds to the axis system commonly used in gait analysis and 
other areas of biomechanics. This is sometimes refered to as the floating
axis coordinate system or Grood-Suntay system, after a paper in the early
1980's

Now filter the force plate data to remove most noise that may have been
present. Use a two pass butterworth time convolution filter set to allow 
all signals below 50 Hz to pass through. The raw electrical signals have 
already been converted from volts to Newtons and Newton-meters. This
occured when the force plate signals were read in from the file.

FRC FIL/TCV/HIG=50  ! FoRCe FILter/TimeConVolution/HIGhfrequency=50

Convert the force plate loads from their individual plate coordinate systems
to the same global or lab coordinate system used by the markers. The location
of the plates has been coded into ANZ, so if you use a different force plate
set up than that in ANZ you will have to change the program code and recompile 
ANZ. Note that in the sample data set from Ohio State there are three AMTI 
force plates in a single row. Some sample data from Mayo Clinic is also in 
the DATA directory (the .ana files from the Motion Analysis ADS program) 
which have a Bertec force plate and a Kistler force plate.

FRC CON  ! FoRCe CONdition

Calculate the centers of pressure of the resultant ground reaction forces
on the plates.

FRC CPR  ! FoRCe CenterofPRessure

These centers of pressure are relative to the global coordinate system.

Look at the status of the force information.

STA FRC   ! STAtus FoRCe

Now filter the EMG signals present in the data file. Use the same time
convolution filter as used with the force plates but set the lower cutoff
frequency to 30 Hz and the upper cutoff to 250 Hz. This makes the filter
act as a bandpass filter.

EMG FIL/TCV/LOW=30/HIG=250

Check the EMG status to see that it has been filtered.

STA EMG

We're done with processing the data for now. Save the results thus far.

SAV N6.ANZ

This will save all the quantities calculated so far into a single file.
This file is a binary file. It cannot be looked at with a conventional
file editor. This format is compact and fast for reading and saving. 
All the results in this file can be viewed graphically with TELIO and
visualized in 3D by SHOW3D. Data can be exported from ANZ into text files
so that analysis results can be used by other programs. For example, the
joint angles of the right ankle can be exported using

EXP JNT JAN RTAK N6_RTAK.JAN

This will place the joint angles in a text file named N6_RTAK.JAN. Another
example is that all segment angles can be placed in files with the command

EXP SEG ANG ALL N6_*.SAN

The * will be replaced by the segment name and individual files will
be saved for each segment. In this case, 13 files will be created for the 
segment euler angles with file names like N6_RHP.SAN  Use of the * is an
easy way to dump large amounts of information into text files.

Now that all we have done so far has been saved, we can exit ANZ.

EXIT
Y

Now you will be back at the DOS prompt. The next step in doing the analysis of
the gait cycle is to identify the gait cycle events such as heel strike and
toe off. To do this, we will use TELIO to look at the trajectories of the
heel and toe markers of both feet. We will also look at the force plate
information to see which feet hit which plate.

Start TELIO.

TELIO

After the program has loaded, which may take some time as it does with ANZ,
you will be asked to supply the graphics display device, printing device, and 
print file names. As distributed, the VOGLE graphics library has been 
configured in TELIO and SHOW3D to use the following graphics devices:

Name     Resolution
EGA      640x350
VGA      640x480
SVGA     800x600
SVGA2    1024x768

Note that the program does not confirm that you actually have the 
device that you type in. Thus, if you tell TELIO that you have an SVGA 
graphics card and you only have an EGA graphics card and monitor you will 
probably crash the program and lock up the computer.

Type in the appropriate graphics device at the prompt. These days VGA is
usually a safe choice. The device name MUST be in lower case letters.

The print devices supported by TELIO and SHOW3D are:

Name            Description
postscript      Postscript
ppostscript     Portrait Postscript
cps             Color Postscript
pcps            Portrait Color Postscript
hpgla1          Hewlett Packard plotting language on A1 paper
hpgla2          Hewlett Packard plotting language on A2 paper
hpgla3          Hewlett Packard plotting language on A3 paper
hpgla4          Hewlett Packard plotting language on A4 paper 

Type in the device that you want to use. Postscript is usually a good choice.
Note that TELIO and SHOW3D have only been tested with the postscript print
device. The others should work but be aware that problems may occur. The 
device name MUST be in lower case letters.

Now give the print file to which the plots will be written. TELIO and SHOW3D
can create graphics on either the screen or a print file or do both. When a 
plot goes to print it is directed to this file which can be printed after the 
you finish using TELIO or SHOW3D.

For now give the name TEST.PS for the print file.

Following this initialization stage the welcome screen for TELIO should 
appear. If it does not then the program did not initialize properly.

Read in the anz file just created in ANZ.

REA N6.ANZ

Check the status of the various quantities in the file.

STA MRK
STA JNT
STA PAT
STA SEG
STA FRC
STA EMG

Make a simple graph of right toe marker z component versus the x component.
In this case, this will be approximately the sagittal plane since x is 
forward and z is vertical in the OSU coordinate system. To make the graph
with default settings type:

GRA MPN RTTO X MPN RTTO Z

When you are done viewing the graph press any key and it will be erased.

MPN is the abbreviation for Marker PositioN. There are many abbreviations for
the quantities produced by ANZ and displayable in TELIO. The marker names are
the same as those assigned in ANZ (the names are contained within the ANZ
file as are the names of the segments and joints amongst other things). You 
can check the names of the markers once again with the STA MRK command.

Try a slightly more complex graph

GRA FRA MPN RTTO Z MPN RTHE Z MPN LFTO Z MPN LFHE Z

This graphs all four foot markers as a function of the frame number. TELIO 
can produce complex graphs but they can require a lot of typing. To avoid
this, lets try a macro.

Read in a set of macros to make displaying the foot markers easier. TELIO 
has a facility to read in sequences of predefined commands and have them 
easily accessible. These sequences are referred to as macros. They are not 
as sophisticated as those in a spreadsheet but they speed up the use of 
TELIO a great deal.

MAC REA MACROS\GAITMRK.MAC

You will see that a number macros have been read in. To look at the contents
of a macro use the command

MAC SHO 0 

Substitute other macro numbers for 0 in the above command to see the others.
If you type MAC SHO without a number, the single line descriptions of the 
macros will be displayed.

Now execute a macro.

MAC 0

You should see a graph similar the second one you produced above, but it now
has titles and other niceties. This is how I normally use TELIO. I find
a specific combination of commands that produce a nice graph and then type
these into a text file which I load whenever I want that graph. Note that
if you use a macro which is not applicable to the current data the macro will
terminate with an error message. This is easy to have happen with all the 
different quantities in ANZ and options in TELIO.

Now use the remaining macros to figure out what frame numbers correspond to 
the right heel strike, left toe off, left heel strike, right toe off and 
second right heel strike. This is the gait cycle in this data set. The event
frame numbers are approximately:

RHS:  7
LTO: 12
LHS: 32
RTO: 38
RHS: 56

These will be needed in the second phase of using ANZ. Identification of
gait events is somewhat of an art form and I do not want to digress into how
to find them here except to say that in this normal gait cycle they are
relatively easy to identify. Some software can find these automatically.
I have not tried to incorporate these algorithms because I always managed
to come up with cases that would make them fail. They work for normal gait,
but since this software was originally developed to analyze abnormal gait 
this is not adequate. Anyway, if someone wants to add automatic identification
go ahead.

Look at the joint angles to see a more complex macro. Read in the joint 
angle macros.

MAC REA MACROS\ANGLES.MAC

Look at macro 2. It is a more complex than the macros seen so far. 

MAC SHO 2

Macro commands are limited to 50 lines each. I have created graphs before that
require several of these to get everything set up the way I wanted it to
look. There are many options in TELIO that affect graph appearance. You
should experiment with them to find out what they do. These options are the
OPT commands in the macros. You can see what option commands are available
by typing 

OPT GRA QQQ QQQ

This will cause an error message to be displayed with the abbreviations of
all available options. See the TELIO command summary for brief explainations
of these commands.

Go ahead an execute macro 2

MAC 2

You should six graphs showing all the joint angles of the legs with each
graph showing the three component angles of each joint. Now try macro 3.

MAC 3

This shows the same data, though only the flexion angles, presented in a 
different manner. Hopefully these few examples have shown that TELIO is 
flexible and easy to use (if you use macros that is). 

To print out a graph you must activate the print file with the command

OPT GRA PRI ON

Now do MAC 2 again. After you press a key to make the graph erase, there
will be a pause while the program writes the equivalent of the graph to
to the postscript file. You should turn off this option after you have
used it since the program continues to write the screen display to disk 
each time you create a display until you tell it otherwise.

OPT GRA PRI OFF

You can look at the options active for a given graph with the status command.

STA GRA OPT
STA GRA/2 OPT

This will display the options for graphs 1 and 2.

STA GRA DAT
STA GRA/2 DAT

This will display what data is being plotted in graphs 1 and 2.

You can play around with TELIO at this point. Try changing options and see
what happens. Make the changes with the option command and then type

OPT GRA TIT this is a title for graph 1
OPT GRA/2 SUB this is a subtitle for graph 2
GRA PRE

This will graph the previously specified data commands (the GRA ... commands)
so you do not have to retype them. You might try some of the other macros in
the MACROS directory at this point also. Remember some won't work because
you don't have the right data calculated by ANZ yet.

Try one last macro before returning. Read the ground reaction load macros.

MAC REA MACROS\GRLS.MAC

Reset the graph options to their defaults and execute macro 9.

OPT GRA/ALL RES
MAC 9

This will show the ground reaction loads of all three plates. Executing
macro 1 will show the centers of pressure of the force plates.

MAC 1

When you are done with TELIO, exit with the command

EXIT
Y

Reset the graphics mode to color text with 80 columns. At the moment, the
graphics programs do not properly reset the graphics to the correct display
mode when they exit, so you must do it manually.

MODE CO80

Now lets finish analyzing the gait cycle in ANZ.

ANZ
REA N6.ANZ

Input the gait cycle information with the following commands:

CYC EVE/REL
RHS 7
LTO 12
LHS 32
RTO 38
RHS 56
DONE

The first command indicates that the gait events will be relative to the first
frame of data in the file and not the first frame of data in the data set. This
is needed because the commerical packages I have used (AMASS and EV3D) allow
you to include only sections of the marker data frames in a file. 
Unfortunately, this can confuse things if the analog data (force plates and
EMG's) is not clipped to the same range of frames. This is the case with EV3D
though not with AMASS files. Thus, the relative command allows you to get the
frame numbers right since the absolute frame number of the first frame in the
data set read into ANZ is known to the program. The frame numbers you derived
from TELIO were relative to the first frame of the data set section not the 
absolute first frame of the data.

Now that the gait events are known we can calculate the gait cycle statistics

CYC STA

With the gait events known we can assign the force plates to the proper feet.
ANZ attempts to do this automatically by calculating the centers of pressure 
on the plates and comparing these to foot position. Unfortunately, it fails
at times (for instance if the force plate signals are noisy or a subject places
both feet on a plate), so there are commands to manually force this assignment.

FRC ALI/SEC/RFT=2/LFT=13

This assigns the signals of plate #2 to the right foot and those of plates 1 
and 3 to the left foot. The SEC option is a special case for OSU's force plate
layout. They typically sort a gait cycle starting with the second heel strike 
on a force plate. This allows a full gait cycle of kinetics to be calculated 
for both sides of the body because the initially trailing leg of the cycle 
will already be on a force plate. This is one of the luxuries of having 
three plates.

There are a number of options at this stage. In the original OSU system the
video and analog systems were not synchronized and this phase of the program
compensated for this. This is no longer the case, but the remnants of 
this process are still in ANZ though not used. Now that the force plate data
has been assigned to the feet, compute the centers of pressure of the feet 
in the global coordinate system.

FRC CPR

Save a copy of the results so far.

SAV N6F.ANZ

I often do this because the next step in the process destroys some data. The
force plate data will clipped to the gait cycle and as will the kinematic data.
In addition, the force plate data will be desampled to the same sample
frequency as the marker data. In the case of the sample this will drop the
frequency from 1000 Hz to 50 Hz. This process is needed so that all the 
kinematic and force plate data are in the same time frame for the kinetic
analysis.

FRC CLI

Now calculate the centers of pressure of the ground reaction force in the
foot local coordinate system.

FRC LCP

Now that everything is set, calculate the joint loads and powers.

JNT LOA
JNT POW

You may have noticed that the joint load calculation messages said something 
about using the limited calculation scheme. There are a number of joint load
calculation schemes built into ANZ and this is one of them. Look over the 
source code or the calculation notes for how these different methods work.

Now that we are done with analyzing the gait cycle, save the results and go
back to TELIO.

SAV N6J.ANZ
EXIT
Y
TELIO
vga
posctscript
jload.ps

Read in the final analysis results and a macro file to display the joint loads.

REA N6J.ANZ
MAC REA MACROS\JLOADS.MAC

Graph the 3D moments of all the joints of the legs.

MAC 0

These moments are in the joint coordinate system of each individual joint.
Note that the right and left sides appear to be aligned with one another. 
They are actually half a cycle out of phase but the left side data has been
wrapped around to make it align with the right side. This is purely for
convenience in comparing sides. The gait events are indicated in the plots 
by the vertical lines and the labels at the bottoms of the graphs indicating
the event name. The text is small (maybe unlegible) for these type of displays 
(presuming you have standard vga monitor) where so much is plotted on a 
small screen. Text is readable on large displays and in postscript printouts.

Note that if this display does not look right, it is possible that a mistake 
was made at sometime earlier in this tutorial. There is a completed analysis
file for this data set in the DATA directory named NANCY6J.ANZ You can read
this in place of the one created in the tutorial if necessary. Note the read
command will be REA/1 DATA\NANCY6J.ANZ The /1 option is needed so that TELIO
will overwrite the first data file position with the new data. By default,
TELIO reads in new files and adds them to the list of files available for 
graphing. In the release configuration, up to 3 files can be used at a time. 
By changing the parameters in the source files and recompiling different 
numbers of files can easily be read in at the expense of more disk space  
for the program. By having several files loaded at a time, comparison plots 
between data sets can be viewed.

Now look at the 3D forces transmitted across the joints of the leg.

MAC 1

There other macros in this file that allow you to look at the joint loads in
the other coordinate systems used by ANZ. You can experiment with these.

Read in the joint powers macros and display the 3D joint powers.

MAC REA MACROS\POWER.MAC
MAC 0

Now look at an interesting center of pressure display.

MAC REA MACROS\GRLS.MAC
OPT GRA RES
MAC 5

This should show the centers of pressure of the individual feet, the outlines
of the force plates and outlines of the feet at approximately the average of
their positions when they are on the ground. It is a good display to see if 
your data has come together properly. The text next to some of the centers of
pressure correspond to gait events which occured at the same time that the
point existed. There may be centers of pressure at the lab coordinate system
center. This can happen when the center of pressure is calculated for a small
vertical force. ANZ contains algorithms to prevent this but these bad centers
of pressure sneak through occaisionally.

Macro 6 shows the foot centers of pressure in the local coordinate systems 
of the feet.

MAC 6

This shows the outlines of the right and left feet as well as the centers of
pressure. The plot is a bit messy since both feet are displayed on top of one
another.

Lets do one last plot. This will be a stripchart which has not been used so
far in this tour. Load the preclipped ANZ file and macro file to plot
emg and force plate information

REA/1 N6F.ANZ
MAC REA MACROS\EMG.MAC

Now generate a stripchart of the emg and force plate data with the gait
events superimposed.

MAC 0
MAC 1

The chart is turned sideways so that more graphs can fit on the screen. This
display makes a nice print out for gait evaluations.

Now lets use SHOW3D to make some 3D views of the analysis results. Exit 
TELIO and start SHOW3D

EXIT 
Y
SHOW3D
vga
postscript
test.ps

Read in the analysis results and display all the segments in a hidden line
3D view a from diagonal position in the front.

REA N6J.ANZ   (or read in the preanalyzed file DATA\NANCY6J.ANZ)
3DS IS1 SEG ALL

Pressing the space bar will erase the figure and step to the next frame. Press
the letter q and then any other key when you want to stop looking at the 
figures. The plot you looked at is a 3DSingle view. Only a single viewport 
is shown. The IS1 command indicates that you wanted to look from ISometric 
position 1 at the data. There are five presets positions and you can manually 
specify a position.

Now look at the multiple display mode.

3DM SID SEG ALL FGR BOT

This will show a number of viewports each with a single figure. The view is
from the side and in addition to the body segment the ground reaction force
vectors of both feet will be displayed (shown in green). Notice that the 
figure progresses across the viewport since the person is progressing forward. 
To create an artificial treadmill affect, give the command

OPT SCN PELV

Then repeat the above command.

3DM SID SEG ALL FGR BOT

This should show the person centered in the viewport. The forward movement 
relative to the pelvis has been removed. The pelvis still rotates in 3D and 
translates in the medial-lateral and vertical directions. Now try some 
animation.

OPT STE OFF
3DS IS2 SEG ALL MRK RTTO LFHP RTEL LFSH

This shows an animation of the person for one gait cycle along with several
markers (in yellow). It may be slow because of the hidden line removal. 
Turn this off and turn on only hidden face removal.

OPT HLN OFF
OPT HFC ON
3DS FRO SEG ALL FGR BOT

This should be faster. Faster yet is only wire frame. Do this along with
setting the display mode to be continous rather than stopping after a single
cycle.

OPT HFC OFF
OPT HLN OFF
OPT CON ON
3DS SID SEG ALL

Press any key to stop the display. On a 486 66Mhz PC compatible machine with
accelerated video, the video frame rate of the animation is approximately 
30 frames/second. Now turn on the local coordinate systems of the segments 
and animate the data again.

OPT LCS ON
3DS IS2 SEG ALL

Once again press a key to stop the animation. Now make a butterfly diagram 
of the force plate data and produce a print file.

OPT ERA OFF
OPT CON OFF
OPT PRI ON
OPT SCN OFF
3DS SID FGR BOT

Now display the individual force plate forces along with the moment of the 
ground reaction load normal to the ground (shown in red).

3DS IS1 FPL 1 2 3

Turn off the print file otherwise you can produce very large files.

OPT PRI OFF

You can check the settings of the options with the command:

STA OPT

For a last exercise, try setting a manual viewpoint. You need to set the
point where you are standing, the point you are looking at, and the upward 
direction of your head.

OPT VPT 0 0 -3
OPT VCN 0 0 0
OPT VUP 1 0 0
OPT ERA ON
OPT STE ON
OPT HLN ON
OPT LCS OFF
3DS MAN SEG ALL

This should produce a view of the person from under the floor. Step through
the display by pressing the spacebar. Remember you can quite by pressing q 
and then the spacebar.

Feel free to experiment with the settings of SHOW3D at this point. When you
are ready to quite, type

EXIT
Y

Then reset the graphics mode with

MODE CO80

That is your tour of ANZ, TELIO, and SHOW3D. Hopefully, this has provided you
with an idea of what they can do. 