Table of Contents

Create Target

In Visual3D Version 5.02.07 we introduced a command to add a new ORIGINAL TARGET to the workspace.

Create_Target /SIGNAL_NAMES= ! /SIGNAL_DESCRIPTION= /EXPRESSION= ; The Expression can be any expression that produces a signal that has at least 3 components. The first 3 components will be used for the TARGET.

If the signal has one frame of data, all MoCap frames will be populated with this value.

Create_Target /SIGNAL_NAMES=TEST1 ! /SIGNAL_DESCRIPTION= /EXPRESSION=0.2*METRIC::NORMAL::PEDAL ; If the signal has multiple frames, all frames will be populated up to the number of MoCap frames.

If there are fewer frames than MoCap frames, the target will be buffered with unreliable data.

Create_Target /SIGNAL_NAMES=TEST2 ! /SIGNAL_DESCRIPTION= /EXPRESSION=0.5*(TARGET::ORIGINAL::RFT1+TARGET::ORIGINAL::RFT2) ;

Example: Virtual Lab

Background

The following example creates a virtual lab that can have 4 principal directions depending on the walking direction in the movement trial. Unlike the method for two directions, this method will only work for one direct per movement trial (e.g. the subject cannot walk back and forth in the same trial). It will, however, allow a virtual lab to have different orientations for each movement trial.

For the Dynamic Virtual Lab, the subject may walk in the positive/negative direction of one of the principal axes of the lab (example: Y). This example, allows the user to walk along the positive/negative direction of two of the principal axes of the lab (example: X or Y)

To complete this tutorial, a static trial with the typical Dynamic Lab should be created. You can download an example of this here. You will notice that the virtual lab rotates in the dynamic trial and is created correctly when the subject is facing along the +Y/-Y axis, but is created incorrectly when the subject is facing the +X/-X. If the following script is run, the virtual lab will be created correctly regardless of the subject's direction. A completed CMO file can be downloaded here.

Script

This pipeline should be run immediately after the model_template has been applied (at least in this example).

The script below can also be downloaded as a v3s file here.

A virtual lab was created with a LANDMARK named LAB_LATERAL

! A unit vector is defined between the right and left hip landmarks, 
!   then rounded to yield 4 possible solutions ( +/- X-axis and +/- y-axis)

! A target is created that contains that unit_vector at every frame of data.

!!The virtual_lab will be tracked by the new TARGET.


 ! Create a unit vector between left and right hips

Evaluate_Expression
/EXPRESSION=UNIT_VECTOR(
(LANDMARK::ORIGINAL::RIGHT_HIP::X-LANDMARK::ORIGINAL::LEFT_HIP::X),
(LANDMARK::ORIGINAL::RIGHT_HIP::Y-LANDMARK::ORIGINAL::LEFT_HIP::Y),
(LANDMARK::ORIGINAL::RIGHT_HIP::Z-LANDMARK::ORIGINAL::LEFT_HIP::Z))
! /SIGNAL_TYPES=
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_NAMES=
! /RESULT_TYPES=DERIVED
/RESULT_FOLDERS=VIRTUAL_LAB
/RESULT_NAME=HIP_VECTOR
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
;

! compute the median value of the unit vector

Metric_Median
! /RESULT_METRIC_FOLDER=PROCESSED
/RESULT_METRIC_NAME=_MED
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
/SIGNAL_TYPES=DERIVED
/SIGNAL_FOLDER=VIRTUAL_LAB
/SIGNAL_NAMES=HIP_VECTOR
/COMPONENT_SEQUENCE=ALL
/EVENT_SEQUENCE=
/EXCLUDE_EVENTS=
/SEQUENCE_PERCENT_START=
/SEQUENCE_PERCENT_END=
/GENERATE_MEAN_AND_STDDEV=FALSE
! /APPEND_TO_EXISTING_VALUES=FALSE
;

! round the floats to an integer

Evaluate_Expression
/EXPRESSION=ROUND(METRIC::VIRTUAL_LAB::HIP_VECTOR_MED)
! /SIGNAL_TYPES=
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_NAMES=
/RESULT_TYPES=METRIC
/RESULT_FOLDERS=VIRTUAL_LAB
/RESULT_NAME=LAB_LATERAL
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
;

! create a new TARGET that has the rounded unit vector at every frame. 

Create_Target
/SIGNAL_NAMES=LAB_LATERAL
! /SIGNAL_DESCRIPTION=
/EXPRESSION=METRIC::VIRTUAL_LAB::LAB_LATERAL
;

 ! if you are testing, you will need to recalc to update the virtual lab.

Recalc
;