The defining of variables is one of the key tasks in ProCalc, and there are a large number of options available:
Note that you define time-dependent variables that span the frame range of the input trial being processed. In other words, if your trial spans the frame range 56-652 (assuming the first 55 frames have been cropped), each variable defined in this interface will be evaluated for each frame between 56 and 652.
To define a variable:
- On the Variables tab, select an existing variable to edit, or click the Add button to add a new one.
- Enter a suitable name for the variable you want to define.
- Select a function for the variable. The functions are grouped, so there are two drop-downs – the first contains the function groups, and the second the functions found within these groups. For a full description of all functions, see Functions for defining variables.
Depending on what function you chose, the Type, Input Variable, XYZ, Factor, Timing and Event controls are populated accordingly.
- Choose the type of input variable by selecting from the first column. There may be one or more options, depending on the function.
Depending on the chosen type, the Input Variable drop-down list is populated with the available options. These may be variables from the currently loaded trial, or other variables that you have defined.
- Select the components from the input variable that you wish to work with. The default is always all available components, for example XYZ for types Point and Vector. For example, if you choose only the X component from a point, then the Y and Z components are set to zero. This is equivalent to projecting the point onto the X-axis. Similarly, if you choose the YZ component, this sets X to zero, and is equivalent to projecting the point into the YZ plane.
- Select the factor. The default is 1.0, which leaves the input variable unchanged. The factor is applied to all the components. In other words, if you have as input variable a point that has the value X = 100, Y = 200, Z = 300 for a specific frame, choose the XY components and use a factor of 0.5, the input variable fed to the function will be X = 50, Y = 100, Z = 0.
- Selecting the Timing. The default is Continuous, which means that ProCalc evaluates the input variable at the same frame number as the output variable. However, sometimes you may wish to use input variables that evaluate at a different time from the one you’re defining. For example, if you are calculating a vector that points in the direction a subject is moving throughout the trial, you could calculate this from a marker position at the beginning of the trial to a marker position at the end. You would then change the timing from Continuous to one of the following alternatives:
- FirstValidFrame. This returns the value of the input variable at the first frame in the trial where the variable is valid. For a trajectory, this would be the first frame at which the marker is not occluded. This means that the input variable evaluates to the same value for each and every calculation frame of the trial and effectively becomes a constant input to the function.
- LastValidFrame. As above, except that the last frame that has a valid value is returned.
- Maximum. Returns the variable’s maximum value.
- Minimum. Returns the variable’s minimum value.
- Previous. Returns the input variable at the previous event of a given type relative to the current calculation frame. For example, if ProCalc is currently evaluating frame 354 and you have specified the Left Foot Strike, ProCalc looks backwards in time until such an event is found. Say this event is found at frame 325, then instead of being evaluated at frame 354, the input variable is instead evaluated at frame 325. This means that the input variable remains constant between each event of the specified type.
- Following. As above, except that the specified event will be the next one in time. For the example above, if the next Left Foot Strike occurs at frame 416, then the input variable returns its value at this frame rather than the current calculation frame 354.
- First. As above, except that the input variable is evaluated for the first event of the specified type in the trial.
- Last. Again as above, except that the input variable is evaluated for the last event of the specified type in the trial.
- MaxBetween. Returns the variable’s maximum value between the two nearest events of the specified type.
- MinBetween. Returns the variable’s minimum value between the two nearest events of the specified type.
- Repeat the procedure until all the input variables required for the function have been defined.
- Optionally choose whether to negate one or more components of the variable. This can be useful if you’re defining Euler angles and for example, the biomechanical convention requires knee flexion to be positive, but the mathematics makes knee flexion negative.
- When you have defined all your variables, save the scheme.