How Can We Help?

CLI Overview

You are here:

Metriks Command Line Interface

Most tools and functions available in the graphical user (GUI) are mapped to arguments available on the Metriks command line interface (CLI).

Installation

It is recommended to add Metriks to the system PATH variable during the installation process. By adding Metriks to your system PATH variable, the commands “metriks” or “metriks.exe” can be run in the CLI from any working directory on your machine. This installation setting is turned on by default. Metriks will automatically be removed from the system path upon uninstalling the software.

Image

The CLI allows users to define a set of functions to perform. The arguments/options can be thought of like a series of button-presses in the GUI version of Metriks. The CLI arguments/options can either be run with or without the accompanying GUI. By default, the GUI will be opened following any user command unless the “––nographics” option is added to the command line input. The “––nographics” option is recommended when the user issues a specific “output” option.

If the user runs “metriks” without any options from the command line, the command window will automatically exit and the GUI will open as if the program was launched from a desktop shortcut or a Windows executable. If the user provides optional arguments, such as the calculation of a specific metric, the GUI will open to the user specified tab.

Command Options

For Metriks CLI help and a list of available arguments use the “–h” option. The abridged output:

C:\Users\User>metriks –h

usage: metriks [–h] [––nographics] [–l] [–a] [––clearlicense] [–b  | –m ] [–c]
              [––hbm] [–v] [––hbm_settings] [––hbm_restore_default]
              …

optional arguments:
  –h, ––help            show this help message and exit
  ––nographics          Hide Graphics
  –l , ––license        Change License Key
  –a , ––activationtoken
                        Change Activation Token
  ––clearlicense        Deactivate Machine and Clear License Info
  –b                    Binout File
  –m                    Message File
  …

Detailed Option Descriptions and Examples

(argument: Argument Help Description):

Load File

Two LS-Dyna output file types can be loaded into Metriks: binout files and message files. Both options can use relative paths. The following examples use relative paths where the files are in the current working directory.

–b : Binout File

Requires any file or full file path string as argument. A recommended (but not required) best practice is to load the first binout file. The following example command opens binout file example.binout0000 in the GUI, but does not perform any  calculations or change any settings:

 C:\Users\User\m50v511_kroell>metriks -b binout0000 –M 

–m : Message File

Requires any file or full file path string as argument. A recommended (but not required) best practice is to the load the first message file. The following example command opens message file example.mes0000 in the GUI, and automatically performs the Message File Summary function:

 C:\Users\User>metriks –m example.mes0000 

Settings

The following arguments correspond to HBM instrumentation settings. If any of these options are invoked, the setting will save into the program’s cache and settings will remain for subsequent commands unless modified again.

––hbm : Human Body Model Selection

Only accepts “M50-O” as a valid argument. Future use will be to select which HBM is used for defining instrumentation outputs and calculation settings.

–v , ––version_hbm : HBM Version, currently M50-O v5.1.1 or 5.0

Only accepts “5.1.1” and “5.0” as valid arguments for the M50-O model. Future use will be to select the corresponding model version for the selected HBM.

––hbm_settings : Load HBM Settings Config File for Outputs

Requires any file or full file path string as argument. Corresponds to opening a pre-existing model instrumentation file in the HBM instrumentation settings window (see figure below) before performing any injury metric calculations using command line argument flags.

The following example would open binout file binout0000 in Metriks from the current working directory (C:\Users\User\m50v511_base-units_offset) and changes the HBM instrumentation settings to the saved file (C:\Users\User\M50-O_5.1.1_offset_20mil.hbm) where M50-O v5.1.1 instrumentation is offset by 20 million as shown in the figure below.

 C:\Users\User\m50v511_base-units_offset>metriks –binout0000 ––hbm_settings ../M50-O_5.1.1_offset_20mil.hbm 

Image

––hbm_restore_default : Restore Default Numbering for HBM

Does not require argument. Corresponds to clicking the “Restore Model Defaults” button in the HBM instrumentation settings window before performing any injury metric calculations using command line argument flags.

Image

––offset : Apply an Offset to All Default Output Channel

Requires any integer as argument. Corresponds to changing all the “offset” values in the HBM instrumentation settings window before performing any injury metric calculations using command line flags. This option is equivalent to adding all of the five options below with the same offset value.

The following example offsets the default instrumentation settings by 20,000,000 for the current (cached) HBM.

 C:\Users\User\m50v511_base-units_offset>metriks -b binout0000 ––offset 20000000

Image

––offset_nodes : Apply an Offset to the Default Node Numbering

Requires any integer as argument. Changes the default node instrumentation values for active HBM by an offset value. Equivalent to performing the offset in in
the figure above.

––offset_xsections : Apply an Offset to the Default Cross Section Numbering

Requires any integer as argument. Changes the default cross-section instrumentation values for active HBM by an offset value. Equivalent to performing the offset in in
the figure above.

––offset_parts : Apply an Offset to the Default Part Numbering

Requires any integer as argument. Changes the default part instrumentation values for active HBM by an offset value. Equivalent to performing the offset in in the figure above.

––offset_elements : Apply an Offset to the Default Element Numbering

Requires any integer as argument. Changes the default element (ELOUT) instrumentation values for active HBM by an offset value. Equivalent to performing the offset in in the figure above.

––offset_rcforc : Apply an Offset to the Default RCFORC Channels

Requires any integer as argument. Changes the default reaction contact force (RCFORC) instrumentation values for active HBM by an offset value. Equivalent to performing the offset in in the figure above.

The following option can be used to load a calculation setting configuration file to be applied to the injury metric calculation arguments.

–c , ––calc_settings : Load Calculation Settings Config File for Outputs

Requires and file or full file path string as argument. Changes calculation settings according to the data in an existing calculation settings file

Injury Metrics

Once a set of binout files is loaded, options can be added to calculate groups of injury metrics or individual injury metrics. Capital single letter options (e.g. –M, –H) can be used to calculate all available injury metrics or all available injury metrics within a body region as outlined:

–M, ––metrics : Calculate All Metrics Available

This option does not accept an argument. The following example opens binout file binout0000 and calculates all injury metrics that have the corresponding instrumentation enabled and corresponding to the active numbering scheme in HBM settings. This option corresponds to the “All Active Metrics” button in the top right of the GUI next to the file path bar.

 C:\Users\User\m50v511_kroell>metriks -b binout0000 -M 

–H, ––head : Calculate Available Head Metrics

This option does not accept an argument. The following example opens binout file binout0000 and calculates all head injury metrics that have the corresponding instrumentation enabled and corresponding to the active numbering scheme in HBM settings. This option does not currently have a corresponding action in the GUI. The corresponding neck, thorax, abdomen, and plex options function in the same fashion.

 C:\Users\User\m50v511_kroell>metriks -b binout0000 -H 

–N, ––neck : Calculate Available Neck Metrics

–T, ––thorax : Calculate Available Thorax Metrics

–A, ––abdomen : Calculate Available Abdomen Metrics

–P, ––plex : Calculate Available PLEX Metrics

Multiple injury metric body region options can be invoked in the same command. The following example command would open binout file binout0000 and calculate all active head and neck metrics.

 C:\Users\User\m50v511_kroell>metriks -b binout0000 -H -N 

–E, ––energy : Energy Summary

This option does not accept an argument. This argument is equivalent to the “Energy and Mass Properties” button and can be invoked with any injury metric body region option or any individual injury metric options (next section).

The following command opens binout file binout0000 and calculates all active head injury metrics and reports a summary of simulation energy balances and added mass.

 C:\Users\User\m50v511_kroell>metriks -b binout0000 -H -E 

The following injury metric option flags can be added to commands with a loaded binout file. Each injury metric option flag corresponds to clicking the corresponding injury metric button in the GUI. These option flags take no arguments
and depend on the overriding calculation settings file that has been loaded or is currently active in the cache. These options can be called in a mixed fashion with the injury metric body region options. The following example would
load binout file binout0000 and calculate all active head injury metrics and femur forces:

 C:\Users\User\m50v511_kroell>metriks -b binout0000 -H –femur_force

––hic

––head_accel

––bric

––csdm

––nij

––neck_kinetics

––chest_comp

––lat_rib_defl

––tspine_kinetics

––ribfx_det

––ribfx_prob

––sternum_accel

––lspine_kinetics

––lat_abd_force

––liver

––spleen

––kidneys

––pelvis_accel

––pelvis_force

––femur_force

––rti

––tibia_kinetics

Validation Simulations

The following option flags correspond to the “Validation” load cases. These option flags do not take any arguments. They can be called either using the “descriptor” flag name (e.g. “––lateral_shoulder”) or the “literature” flag name (e.g. “––koh”).

––lateral_shoulder, ––koh

-––thorax_hub, ––kroell

The following example generates the outputs for the chest hub impact validation simulation:

 C:\Users\User\m50v511_kroell>metriks -b binout0000 ––thorax_hub 

––oblique_abdomen, ––viano

––abdomen_bar, ––hardy

––lateral_pelvis, ––bouquet

Outputs

The following output command options allow the user to export data that is calculated from the injury metric options.

–r , ––report : Generate Report

Requires any file or full file path that ends in “.docx” extension as argument. This option is equivalent to the Export->Word Document Report action in the GUI. The only difference is that the user will directly pass an argument to the option to determine the location of the generated report, rather than interact with a GUI dialog window.

The following example loads binout file binout0000, calculates all active head injury metrics, and then generates the Word document report generated_report.docx in the working directory.

 C:\Users\User\m50v511_kroell>metriks –b binout0000 –H –r generated_report.docx 

–f , ––figures : Save Only Plotted Figures

Requires a path-like string as argument. The required argument can be passed as a relative or absolute path (see examples). This option is equivalent to the Export->Figures to Images action in the GUI. The only difference is that the user must pass an argument to the option to determine the location of the generated figures. A “Metrics” and a “Risks” subfolder will be created and images will be saved into their respective folder.

The following two example commands would output all active head injury metric figures in the equivalent working directories, but the first example uses a relative path while the second uses the absolute path.

 C:\Users\User\m50v511_kroell>metriks –b binout0000 –H –f . 

 C:\Users\User\m50v511_kroell>metriks –b binout0000 -H –f C:\Users\User\m50v511_kroell 

–t , ––tables : Directory to Save Injury Metric/Risk Tables to CSV Files

Requires a path-like string as argument. The required argument can be passed as a relative or absolute path (see examples). This option is equivalent to the Export->Tables to Comma Separated Values action in the GUI. The only difference is that the user must pass an argument to the option to determine the location of the generated figures. The .csv files will be created directly in the folder specified by the argument.

The following two example commands would output all active head injury metric tables in the equivalent working directories, but the first example uses a relative path while the second uses the absolute path.

 C:\Users\User\m50v511_kroell>metriks –b binout0000 –H –t . 

 C:\Users\User\m50v511_kroell>metriks –b binout0000 –H –t C:\Users\User\m50v511_kroell 

Graphics

Use of the CLI can make it unnecessary to see the accompanying GUI outputs. To hide the GUI, pass the ––nographics option flag to your input command.

––nographics : Hide Graphics

This option does not accept any arguments. The following example opens binout0000, calculates all active head injury metrics, and saves the data to “generated_report.docx”, but does not display the GUI.

 C:\Users\User\m50v511_kroell>metriks –b binout0000 –H –r generated_report.docx ––nographics 

License

Modifying or loading license keys and activation tokens are actions best suited for the GUI. These commands are best suited for providing troubleshooting info to Elemance.

–l , ––license : Change License Key

Requires any string as argument. Paste the license key supplied by Elemance as the argument.

–a , ––activationtoken : Change Activation Token

Requires any string as argument. Paste the activation token supplied by Elemance as the argument.

––clearlicense : Deactivate Machine and Clear License Info

A new license and activation token can be validated according to the following example:

 C:\Users\User>metriks –l ZYXLicense –a ABCToken 

Other

–V , ––version_metriks : Print Version of Metriks Software