Table of Contents

Command Pipeline

Objectives

The main objective of this tutorial is to demonstrate Visual3D's Command Processing Pipeline. You will learn how to:

Overview

The Command Processing Pipeline allows users to access the core of Visual3D’s functionality by providing a command line interface into all of Visual3D's functions. The Pipeline is typically used to automate processing steps, which is useful for multiple, repeated tasks. With the Pipeline, users can manage files, define events, execute signal processing computations, create and edit models, and, create and modify reports. The Pipeline is a set of Visual3D commands that are processed in sequence. It is not a scripting language nor a programming language, so no special scripting or programming experience is required to use the Pipeline. It is simply a series of commands that are run sequentially.

The pipeline processor can be launched from the Pipeline menu option or from the Visual3D toolbar. Any pipeline command that can be run interactively through the pipeline processor may be saved to a text file. This file may be reloaded later, or combined with other command files to build a more complex pipeline. The Pipeline dialog (or any text processor) can be used to create the pipeline.

Prerequisites

This tutorial assumes that Visual3D has been installed and that a model has been created and movement data has been applied to the model. It is suggested that you first complete the previous Tutorial: Visualizing Data; the file Tutorial2.cmo contains the results from that previous tutorial and can be used as the starting material here.

Preparation

  1. In the File menu, select Open and select Tutorial2.cmo. This is the file produced in Tutorial #2, which you either created while working through Tutorial #2 or you downloaded from the link in the Prerequisites section.
  2. Click on Signal and Event Processing to visualize the animation of the model based on the movement data and the model that was applied to it. If the animation does not appear in the 3D Animation viewer, check the active file combo box on the toolbar. It should read 'Walking Trial 1.c3d' rather than ALL_FILES
  3. If the animation is not playing, click on the PLAY button of the VCR controls at the bottom of the screen.
  4. There are many viewing options for the Animation viewer available under the View Menu item or by clicking with the Right Mouse Button in the Animation Viewer itself. You should play around with these options to see the effects they have; most of the effects are intuitive.

Overview of Command Menu

To open the command menu, click on the “Pipeline” button on the toolbar or select “Workshop” from the Pipeline Menu.

The pipeline workshop will open. To orient you, commands are located in the left column. The commands are organized into folders for:

Commands can be moved over into the main pipeline (middle column) by using the ADD» (double arrow) buttons and can be reordered in any sequence. The right most column will show a preview of the command when the command is highlighted. Any command editing can be done here. Open, Save and other execution buttons are on the top. The tutorial will walk you through the operation of the Pipeline Workshop.

tutorial4_1.jpg

Editing a Command

The pipeline commands can be edited to customize processing. A quick overview for the command syntax follows.

Pipeline Command Syntax:

Command_Name
/PARAMETER1= something
;
Command_Name
/PARAMETER1= something
!/PARAMETER2=
;

pipeline_tutorial_1.jpg

Executing the Pipeline

The following examples are a brief demonstration of constructing and executing a simple pipeline. Clicking the Execute Pipeline button will cause all of the commands in the middle list box of the Pipeline window to be executed in sequence. When the pipeline has finished a status screen will pop-up listing the commands that were processed, and any warnings or errors that were generated.

Note: The pipeline will continue to process even if there were errors in any of the commands, so it is important that you check the status screen at the end of the processing for any errors.

If you would like the Pipeline processing to halt after the first error. Select the Halt on First Error checkbox located below the Execute Pipeline button. If you would like to execute the pipeline commands one command at a time, then click the Step button. This is useful when debugging. If you would like to execute a series of commands, select the group of commands, then click the Step button. pipeline_tutorial_2.jpg

Example 1 - Execute File_Open Command

File_Open
!/FILE_NAME=
!/FILE_PATH=
!/SEARCH_SUBFOLDERS=FALSE 
!/SUFFIX=
!/SET_PROMPT=File_Open
!/ON_FILE_NOT_FOUND=PROMPT
!/FILE_TYPES_ON_PROMPT= 
;

pipeline_tutorial_3.jpg

tutorial4_2.jpg

Example 2 - Execute File_New and File_Open Commands

tutorial4_4.jpg

Pipeline Commands and the Active_Files

File selection is important in Visual3D because many files can be open simultaneously. As mentioned in earlier tutorials there is a file selection combo box at the top of the Visual3D user interface (upper right corner). Pipeline commands usually process the “Active Files”; e.g. those files selected in the combo box on the Visual3D toolbar or designated in a command parameter.

tutorial4_5.jpg

Selecting Active Files in the Combo Box

Selecting Active Files as a Command Parameter

File_Open
/FILE_NAME= C:\MyData\walk 1.c3d
;

Example 3 - Select_Active_File Command

tutorial4_6.jpg

tutorial4_7.jpg

Challenges with identifying files

This is a potentially frustrating issue related to the Select_Active_File command (and many other commands), which is worth discussing before moving on because it confuses many users. Filenames must be the complete filename as seen in the Visual3D Workspace. In Visual3D the complete filename includes the entire path to the file on disk. Visual3D uses the path to the file to determine the uniqueness of a file that is loaded in the Workspace. This allows users to use the same filenames for every data collection session (e.g. static, trial1, trial2, etc), distinguishing the files by the folder in which the files are stored on disk.

Ensure that you add the entire path (show in italics) before the file name as shown below:

Select_Active_File
/FILE_NAME= //C:\demo files tutorials\//Walking Trial 1.c3d
;

Many commands, however, allow the use of a wildcard that can circumvent the problem with the complete specification of the path. For example, the following change to the previous command will find all files whose name ends with Trial 1.c3d

Select_Active_File
/FILE_NAME= *Trial 1.c3d
;

Workspace Tags

A tag is simply a user defined file attribute. Tags are provided as a method of classifying (or categorizing) files.

In the illustration below all files associated with trials in which the subjects walked barefoot have a tag labeled 'Barefoot' assigned to them. And those that wore 'shoes' have a tag labeled Shoes.

tutorial4_3.jpg

You can also have more than one type of attribute. For example, all files associated with trials in which the subjects walked barefoot can have a tag labeled Barefoot assigned to them. And those trials that are are only women subjects could have another tag labeled Female. So you could select only the subjects that are women and who did not wear shoes.

As was mentioned before, if you make only these files active then they will be affected by the Pipeline. This greatly increases the processing power of Visual3D as you are allowed to selectively eliminate and choose various trials to process based on various attributes.

Assign a tag to a file via Workspace:

Example 4 - Assign_Tags_To_Files Command

Add the Assign_Tags_To_Files command to the previous pipeline.

Assign Tags To File
/MOTION_FILE_NAMES=C:\demo files\tutorials\Walking Trial 1.c3d
! /QUERY=
/TAGS=Walk
;

Deleting Tags

The mechanism for deleting file tags is not always intuitive: if no files are checked in a tag’s column, the tag will be deleted as soon as you switch to a different page. If you accidentally delete a tag in this way, you can just create it again using the Add New File Tag button on the Workspace Status page.

Pipeline Parameters

An important feature of the pipeline is the ability to create and use global parameters. A global parameter is a way to store a text string for use in Pipeline commands. In one sense it is similar to specifying a global variable in a scripting language, such as body weight, that could be used in computations. The Visual3D pipeline is even more flexible and permits multiple entries on a single line. Since the entire line can be represented as a string, a single global parameter can represent multiple entries.

Example 5 - Set_Pipeline_Parameter_to_Folder_Path Command

The following commands will create a global parameter that will contain the Folder, and the Open_File command will use this parameter.

tutorial4_8.jpg

This example will produce similar results to previous pipelines but now multiple files will be opened and Visual3D should switch to the Signal and Event Processing tab.

Syntax for using a Pipeline Parameter in a another Pipeline Command:

The ampersand (&) indicates that the strings ::FOLDER and *.c3d should be concatenated to produce

C:\Documents and Settings\HAS-Motion\My Documents\Tutorials\*.c3d

Note: The command in the above example uses a wildcard to load all of the c3d files in a folder. Executing this pipeline will cause Visual3D to open the two c3d files that we used in Tutorial 1 and Tutorial 2, provided that the path name makes sense on your disk. To make the pipeline more general it is convenient to separate the FOLDER containing your data files from the command because in many cases it is only the name of the FOLDER that changes from subject to subject.

A folder is really a special case of a global parameter because it is used so often. If the PARAMETER_VALUE is left blank, on execution a browse dialog will appear to allow you to browse and select the folder. This eliminates the need to type in the FOLDER parameter for every subject. Through judicious use of parameter and wildcards very general pipelines can be developed that can be used as batch processing scripts for every day processing of data.

Pipeline Signal Processing

Signal and event processing will be covered in much greater detail in the next tutorial but we begin looking at it now because much Signal and Event Processing in Visual3D is done using the pipeline. For example a very common process in preparing motion capture data for analysis is to interpolate any missing frames of data, then smooth the resulting signal. The next example demonstrates how to accomplish these steps using the Pipeline.

Example 6 - Interpolate and Low Pass Filter Commands

For this exercise, you will need to graph the original X signal component of LAS before and after the example so that you can compare the original data to the revised data.

graphxhighlight.jpg

tutorial4_52.jpg

—-

Proceed to next Tutorial: Signal Processing