Table of Contents
Build CMZ Files Command Line
Through the OpenBiomechanics Project, Driveline Baseball has made elite-level motion capture data publicly available. The data can be downloaded from Driveline's GitHub repository.
Having access to large datasets is a great asset, but processing these large datasets can take time (and patience). Sift is designed to streamline this process. The steps in this tutorial describe how to create CMZ files from the raw C3D files from pitching and batting data sets through Sift's Console Application, then inspect and group the data in Sift.
Downloads and Relevant Links
Begin with downloading the following two zip files.
- OpenBiomechanics Project: Driveline Baseball data (download the entire openbiomechanics folder and it's contents)
Please note, these downloads contain a large amount of data. Building CMZs is a slow process, so if you want to speed it up to follow along with this tutorial cut the number of datasets under openbiomechanics-main down to 3-5 subjects.
For more technical information on the Build CMZ feature, see: Build CMZs Documentation
Build CMZs for Hitting Data
Step 1: Generate Metadata Settings
First open a new Sift workspace.
On the Load Page, select “Load Data”.
Change the Library Path to “C:…/openbiomechanics-main/baseball_hitting/data/c3d/“ from the downloaded data files.
Check Build CMZ and then check Metadata.
Select Browse in the Metadata module and select “C:…/openbiomechanics-main/baseball_hitting/data/metadata.csv”
A metadata dialog box will appear.
- Change Height Units to “in” and Weight Units to “Lb”
- Ensure the “Subject_Specific” next to “highest_playing_level”, “hitter_side”, “bat_weight_oz”, and “bat_length_in” is checked.
- Change the “Description” column to “Dynamic Trial Identifier” for “session_swing”
- Change the “Description” column to “Static Trial Identifier” for “user”
The meta dialog should look like the image on the right.
At the top right of the meta dialog, select the save button. Save the dialog settings file to your local drive in a convenient location, such as:
“C:…/openbiomechanics-main/baseball_hitting/data/metaSettings.xml”
Step 2: Run Build CMZ Module Functions
Close Sift's GUI application and launch Sift's Console Application from the command line.
NOTE: All sample commands should be modified with file paths that match your computer
Make Hybrid Model
This command will apply given model template(s) to the appropriate static c3d files as it loops through each folder during the build. This function will parse through the files to identify any static files within the subfolders.
-MakeHybridModel parameters:
- modelTemplateFile - path to the .mdh file that should be applied to the data. This parameter looks specifically for file type of .mdh.
- staticFileID - file name identifier for static trial to apply the model template. If passed as “ALL”, Sift will automatically find static files and apply to all.
- dynamicFileID - file name identifier for dynamic trials to apply the hybrid model. If passed as “ALL”, Sift will automatically apply to all.
- currentFileDirectory - the library directory where the build will point to.
NOTE: multiple model templates can be applied to each CMZ workspace by passing multiple parameters for: modelTemplateFile, staticFileIDr, and dynamicFileID
The following command can be run for the hybrid model module of this tutorial:
-MakeHybridModel modelTemplateFile "C:...\openbiomechanics-main\baseball_hitting\code\v3d\model\hitting_v1_model_hybrid.mdh" staticFileID "ALL" dynamicFileID "ALL" currentFileDirectory “C:...\openbiomechanics-main\baseball_hitting\data\c3d\"
Add Metadata
This command allows metadata files to be read and used to set metrics, text data, and tags. If no settingsFile is passed, Sift will guess which metadata items should be applied in the CMZ workspaces.
-AddMetaData parameters:
- metaFile: a file path entry indicating the location of the .csv file containing the meta data. This parameter is looking for a .csv file specifically.
- settingsFile: an optional file path entry indicating the location of the .xml file containing the settings of the metadata selections made previously on the LoadData Dialog in the GUI. To use this parameter, the metafile can be loaded into Sift's GUI in the LoadData dialog, and custom selections can be saved from the dialog. In this example, we will use the settings file created in step 1 of this tutorial.
The following command can be run for the metadata module of this tutorial:
-AddMetaData metaFile "C:...\openbiomechanics-main\baseball_hitting\data\metadata.csv" settingsFile "C:...\openbiomechanics-main\baseball_hitting\data\metasettings.xml"
Add Visual3D Scripts
This command allows any custom Visual3D script to be appended to the build. The scriptFile parameter can be entered multiple times to append multiple scripts for the build to run against each CMZ workspace.
-AddV3DScript parameters:
- scriptFile: a file path entry indicating the location of the .v3s file containing the pipeline script. This parameter is looking for a .v3s file specifically.
In this example, we will run three pipeline scripts against each CMZ workspace: “Filter.v3s”, “Events.v3s”, and “CMO.v3s” which are included in the HAS-Motion Specific Files downloaded at the beginning of this tutorial.
The following command can be run for the add scripts module of this tutorial:
-AddV3DScript scriptFile "C:...\Downloads\Driveline_CMotionFiles\Filter.v3s" scriptFile "C:...\Downloads\Driveline_CMotionFiles\Events.v3s" scriptFile "C:...\Downloads\Driveline_CMotionFiles\CMO.v3s"
Tag By File
This command allows the user to set file tags manually without the need for a separate metadata file. The MaskAndTag parameter can be entered multiple times to set multiple tags.
-TagByFile parameters:
- MaskAndTag: a string entry that pairs a file mask with a tag name, separated by the character ”:”. For example, a parameter entry could be “*run.c3d:run*. Sift will read this entry and know to apply the tag named “run” to any file with “*run.c3d” in the name.
In this example, we will apply a tag for R or L hitters.
The following command can be run for the tag by file module of this tutorial:
-TagByFile MaskAndTag "*_R_*.c3d:Right_Hitter" MaskAndTag "*_L_*.c3d:Left_Hitter"
Step 3: Build CMZs
Once each build CMZ module command line function is executed, the -buildCMZ command can be run and will compile all modules that were run immediately prior.
Note - Once you run -buildCMZ, the modules reset and will need to be re-executed if you wish to repeat the build
The following command can be run to build the CMZ files for this tutorial:
-buildCMZ directory "C:...\openbiomechanics-main\baseball_hitting\data\c3d\"
Query and Inspect Hitting Data
This build will take some time, but should be much faster through the Sift's Console Application compared to the GUI.
After building CMZs, launch sift through the GUI and load the library: “C:…\openbiomechanics-main\baseball_hitting\data\c3d\”
You will need to query your data before you can inspect it. Start by opening the Query Builder dialog on the Explore Page and navigating to the Auto-Populate Query menu. Browse for an Auto Build Settings File and populate this field with the AutoBuilderSettings_Hit.xml file found under the HAS-Motion specific files zip folder you downloaded earlier. The dialog should auto-populate with the query refinements.
Click Create, select the groups you want to query, and hit “Calculate Selected Queries”.
You should now be able to inspect the data you loaded through Sift's Explore Page . An example from this data set is shown below.
Further Reading
To recap: this tutorial has demonstrated how Sift's Console Application can be used to streamline the processing of large data sets. It can:
- automatically combine static, dynamic, and MDH files into CMZs
- automatically apply metadata and tags to datasets
- automatically run pipeline scripts against all files in a dataset
- visualize and display the refined data


