====== Zeni MetaCommand ====== The script below is an example of a [[Visual3D:Documentation:Pipeline:Meta_Commands:Meta_Commands_Overview|Meta-Command]]. The script below would be saved as a v3m file and placed in the Meta-Command folder. This Meta-Command creates kinematic gait events using [[Visual3D:Documentation:Pipeline:Event_Commands:Example_-_Gait_Events_using_Kinematic_Data#Method_1:_Zeni_Paper|the method described here]]. This Meta-Command can be [[https://has-motion.com/download/examples/Events/Kinematic_Gait_Events.zip|downloaded here]]. ==== Calling the Meta-Command ==== Once the Meta-Command (v3m file) has been placed in the Meta-Command folder, it can be called from any other pipeline file: Kinematic_Events_Foot_Position ! /HEELSTRIKE_LABEL=HS ! /TOEOFF_LABEL=TO ; ==== Meta-Command ==== ! BEGIN_META ! META_CMD_NAME=Kinematic_Gait_Events ! META_PARAM= HEELSTRIKE_LABEL  : string :HS:yes ! META_PARAM= TOEOFF_LABEL  : string :TO:yes ! END_META ! ============================================================================ ! Kinematic Gait Events ! ============================================================================ ! This step is not necessary, but important to make sure that ! any events that were previously created are deleted Event_Delete /EVENT_NAME=R&::HEELSTRIKE_LABEL&+R&::TOEOFF_LABEL&+L&::HEELSTRIKE_LABEL&+L&::TOEOFF_LABEL& ! /EVENT_SEQUENCE= ! /EXCLUDE_EVENTS= ! /EVENT_INSTANCE= ! /TIME= ; ! ---------------------------------------------------------------------------- ! Transform the position of the foot into the Pelvis Coordinate System ! ---------------------------------------------------------------------------- ! Right Foot Compute_Model_Based_Data /RESULT_NAME=RToe_Wrt_Pelvis /FUNCTION=SEG_DISTAL_JOINT /SEGMENT=RFT /REFERENCE_SEGMENT=RPV /RESOLUTION_COORDINATE_SYSTEM=RPV ! /USE_CARDAN_SEQUENCE=FALSE ! /NORMALIZATION=FALSE ! /NORMALIZATION_METHOD= ! /NORMALIZATION_METRIC= ! /NEGATEX=FALSE ! /NEGATEY=FALSE ! /NEGATEZ=FALSE ! /AXIS1=X ! /AXIS2=Y ! /AXIS3=Z ! /TREADMILL_DATA=FALSE ! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0) ! /TREADMILL_SPEED=0.0 ; Compute_Model_Based_Data /RESULT_NAME=RHeel_Wrt_Pelvis /FUNCTION=SEG_PROXIMAL_JOINT /SEGMENT=RFT /REFERENCE_SEGMENT=RPV /RESOLUTION_COORDINATE_SYSTEM=RPV ! /USE_CARDAN_SEQUENCE=FALSE ! /NORMALIZATION=FALSE ! /NORMALIZATION_METHOD= ! /NORMALIZATION_METRIC= ! /NEGATEX=FALSE ! /NEGATEY=FALSE ! /NEGATEZ=FALSE ! /AXIS1=X ! /AXIS2=Y ! /AXIS3=Z ! /TREADMILL_DATA=FALSE ! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0) ! /TREADMILL_SPEED=0.0 ; ! Left Foot Compute_Model_Based_Data /RESULT_NAME=LToe_Wrt_Pelvis /FUNCTION=SEG_DISTAL_JOINT /SEGMENT=LFT /REFERENCE_SEGMENT=RPV /RESOLUTION_COORDINATE_SYSTEM=RPV ! /USE_CARDAN_SEQUENCE=FALSE ! /NORMALIZATION=FALSE ! /NORMALIZATION_METHOD= ! /NORMALIZATION_METRIC= ! /NEGATEX=FALSE ! /NEGATEY=FALSE ! /NEGATEZ=FALSE ! /AXIS1=X ! /AXIS2=Y ! /AXIS3=Z ! /TREADMILL_DATA=FALSE ! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0) ! /TREADMILL_SPEED=0.0 ; Compute_Model_Based_Data /RESULT_NAME=LHeel_Wrt_Pelvis /FUNCTION=SEG_PROXIMAL_JOINT /SEGMENT=LFT /REFERENCE_SEGMENT=RPV /RESOLUTION_COORDINATE_SYSTEM=RPV ! /USE_CARDAN_SEQUENCE=FALSE ! /NORMALIZATION=FALSE ! /NORMALIZATION_METHOD= ! /NORMALIZATION_METRIC= ! /NEGATEX=FALSE ! /NEGATEY=FALSE ! /NEGATEZ=FALSE ! /AXIS1=X ! /AXIS2=Y ! /AXIS3=Z ! /TREADMILL_DATA=FALSE ! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0) ! /TREADMILL_SPEED=0.0 ; ! ---------------------------------------------------------------------------- ! Create Events ! - Heel Strike: When the foot is furthest in front of the pelvis ! - Toe Off: When the foot is furthest behind the pelvis ! ---------------------------------------------------------------------------- Event_Maximum /SIGNAL_TYPES=LINK_MODEL_BASED /SIGNAL_NAMES=RHEEL_WRT_PELVIS ! /SIGNAL_FOLDER=ORIGINAL /EVENT_NAME=R&::HEELSTRIKE_LABEL& ! /SELECT_X=FALSE /SELECT_Y=TRUE ! /SELECT_Z=FALSE ! /FRAME_WINDOW=8 ! /START_AT_EVENT= ! /END_AT_EVENT= ! /EVENT_INSTANCE= ; Event_Minimum /SIGNAL_TYPES=LINK_MODEL_BASED /SIGNAL_NAMES=RTOE_WRT_PELVIS ! /SIGNAL_FOLDER=ORIGINAL /EVENT_NAME=R&::TOEOFF_LABEL& ! /SELECT_X=FALSE /SELECT_Y=TRUE ! /SELECT_Z=FALSE ! /FRAME_WINDOW=8 ! /START_AT_EVENT= ! /END_AT_EVENT= ! /EVENT_INSTANCE= ; Event_Maximum /SIGNAL_TYPES=LINK_MODEL_BASED /SIGNAL_NAMES=LHEEL_WRT_PELVIS ! /SIGNAL_FOLDER=ORIGINAL /EVENT_NAME=L&::HEELSTRIKE_LABEL& ! /SELECT_X=FALSE /SELECT_Y=TRUE ! /SELECT_Z=FALSE ! /FRAME_WINDOW=8 ! /START_AT_EVENT= ! /END_AT_EVENT= ! /EVENT_INSTANCE= ; Event_Minimum /SIGNAL_TYPES=LINK_MODEL_BASED /SIGNAL_NAMES=LTOE_WRT_PELVIS ! /SIGNAL_FOLDER=ORIGINAL /EVENT_NAME=L&::TOEOFF_LABEL& ! /SELECT_X=FALSE /SELECT_Y=TRUE ! /SELECT_Z=FALSE ! /FRAME_WINDOW=8 ! /START_AT_EVENT= ! /END_AT_EVENT= ! /EVENT_INSTANCE= ;