$!
$!  VAX/VMS command file to automate the processing of clinical gait data
$!  This file was created for the Mayo clinic Orthopaedic Biomechanics
$!  Motion Analysis Corporation system with the Helen Hayes marker set and
$!  up to 3 force plates. This command file is set up to use the old
$!  versions of ANZ,TELIO and SHOW3D which were exclusively for the VAX
$!  and whose graphics depended on DI3000. This file is not usable on
$!  a pc under DOS, but the process followed here should be useful to those
$!  who want to develop their own automated methods for processing data.
$! 
$!  Written by Dwight Meglan, Feb. 1993
$!
$!
$!  This command file processes a pair of .P3D and .ANA files for a gait
$!  cycle to produce check plots of the validity of the data and to identify
$!  the frame numbers of the gait events. Once the gait events are found,
$!  the second command file, GAIT2.COM, is modified and run to produce a full
$!  clinical gait report of the joint kinematics and kinetics.
$!
$!  NOTE:
$!  A minimum of 2 entries below must be changed for an individual gait run
$!  with a maximum of 8 entries needing modification
$!
$!  Set up the locations of the various programs and files used 
$!
$   PREFIX   :== cln$user3:[chao_eys.meglan
$   define ANZ_PATH 'PREFIX'.anz.source]
$   define TEL_PATH 'PREFIX'.telio.source]
$   define SHW_PATH 'PREFIX'.show3d]
$   define TELMAC   'PREFIX'.telio]
$   define DATA_PATH " "
$!
$!  Setup DI3000 device drivers
$!  Default drivers are a tektronix 4105 and a postscript printer
$!
$   DI3_TERMINAL :== 405
$   DI3_PRINTER  :== PST
$!
$!  Change information below for specific gait run
$!
$   FILENAME :== jfm117
$   PAT_NAME :== jette 17
$   AGE      :== "31" 
$   WEIGHT   :== "135 lbs"
$   HEIGHT   :== "68 in"
$   SEX      :== f
$   COMMENT  :== run # 17
$!
$!  Change the following depending upon the specific force plate data to be
$!  read in from the ANA file. Uncomment the proper line depending upon
$!  what force combination is used.
$!
$!  old kistler plate alone or with emg  and with auto zero using the original
$!  force plate arrangement (2 plates before Feb. 21, 1993)
$!  FP :== /azk/kol=1/ofp
$!
$!  bertec alone or with emg using the original
$!  force plate arrangement (2 plates before Feb. 21, 1993)
$!  FP :== /ber=1/ofp
$!
$!  both bertec and kistler and remaining channels are assumed to be emg  
$!  using the original force plate arrangement (2 plates before Feb. 21, 1993)
$   FP :== /ber=1/kol=2/azk/ofp
$!
$!  New Kistler alone with new force arrangement (3 plates after 2/21/93)
$!  FP :== /kne=1
$!          
$!  Old Kistler alone with new force arrangement (3 plates after 2/21/93)
$!  FP :== /kol=1
$!          
$!  Bertec alone with new force arrangement (3 plates after 2/21/93)
$!  FP :== /ber=1
$!
$!  New Kistler and Bertec with new force arrangement (3 plates after 2/21/93)
$!  FP :== /ber=1/kne=2
$!          
$!  Old Kistler and Bertec with new force arrangement (3 plates after 2/21/93)
$!  FP :== /ber=1/kol=2
$!          
$!  New Kistler, Old Kistler, and Bertec with new force arrangement
$!  (3 plates after 2/21/93)
$!  FP :== /ber=1/kne=2/kol=3
$!          
$!
$!  Change the number of frames to increment between for each SHOW3D scene
$!  that is displayed depending upon whether the subject is moving slow or fast
$!
$   SHW_FRM_INC :== "7"
$!
$!
$!  End of things that should be changed for each gait trial. DO NOT modify
$!  any of the remaining lines in this command file unless you know exactly
$!  why you are doing it!
$!
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!                                                                           
$!  Write out a command file
$!                                
$ open/write file 'FILENAME'1.com
$!
$ write file "$ set def DATA_PATH"
$ write file "$ run/nodebug ANZ_PATH:anz"
$ write file " opt gen nup" 
$ write file " rea/hh  ''FILENAME'.p3d"
$ write file " mrk int"
$ write file " mrk adj"
$ write file " mrk smo/fre=8/vaa"
$ write file " seg pos"
$ write file " seg ang"
$ write file " seg vaa/fre=8"
$ write file " pat nam ''PAT_NAME'"
$ write file " pat age ''AGE'"          
$ write file " pat hei ''HEIGHT'"
$ write file " pat wei ''WEIGHT'"
$ write file " pat sex ''SEX'"
$ write file " pat com ''COMMENT'"
$ write file " seg prm/sta=20/num=10"
$ write file " jnt jan"
$ write file " jnt jva"
$ write file " rea''FP' ''FILENAME'.ana"
$ write file " frc fil/tcv/hig=50"
$ write file " frc con"
$ write file " emg fil/tcv/low=30"           
$ write file " save ''FILENAME'.anz"
$!
$! Dump out VIS files
$!
$ write file " exp seg prm/vis ''FILENAME'.byu"
$ write file " exp seg pos/vis ''FILENAME'.ani"
$ write file " exit"
$ write file "y"
$!
$! Generate plots of the heel and toe markers in the vertical direction
$! as a function of frame number. These will be used to find the gait events.
$!
$ write file "$ setdrv ''DI3_TERMINAL' ''DI3_PRINTER'"
$ write file "$ run/nodebug TEL_PATH:telio"
$ write file " mac rea TELMAC:gaitmrk.mac"
$ write file " opt gra pst on"
$ write file " opt gra scr off"
$ write file " opt mac ech off"
$ write file " rea ''FILENAME'.anz"
$ write file " mac 0"
$ write file " mac 1"
$ write file " mac 2"
$ write file " mac 3"
$ write file " exit"
$ write file "y"
$ write file "$ print/que=brutus$print posts.dat"
$!
$! Generate block figures of gait to check data integrity
$!
$ write file "$ run/nodebug SHW_PATH:show3d"
$ write file " rea ''FILENAME'.anz"
$ write file " opt pst on"
$ write file " opt scr off"
$ write file " opt inc ''SHW_FRM_INC'"
$ write file " 3dm sid seg all"
$ write file " 3dm fro seg all"
$ write file " 3dm is1 seg all"
$ write file " exit"
$ write file "y"
$ write file "$ print/que=brutus$print posts.dat"
$ close file
$!            
$! Now execute the command file                               
$!
$ @'FILENAME'1
