Using Workbench Command

Workbench Command is a set of command-line tools that can be used to perform simple and complex operations within Connectome Workbench.

Full Documentation:

Documentation Home
   To get the help information on a subcommand, run it without any additional
   arguments.  Options can occur in any order, however suboptions and arguments
   to options must occur next to their parent option.  The easiest way to get
   this right is to specify options and arguments in the order they are listed.
   As an example, consider this abbreviated version of the -volume-math help
   information:

$ wb_command -volume-math
EVALUATE EXPRESSION ON VOLUME FILES
   wb_command -volume-math
      <expression> - the expression to evaluate, in quotes
      <volume-out> - output - the output volume

      [-fixnan] - replace NaN results with a value
         <replace> - value to replace NaN with

      [-var] - repeatable - a volume file to use as a variable
         <name> - the name of the variable, as used in the expression
         <volume> - the volume file to use as this variable

         [-subvolume] - select a single subvolume
            <subvol> - the subvolume number or name

         [-repeat] - reuse a single subvolume for each subvolume of calculation
...
      The following functions are supported:
...
         abs: 1 argument, the absolute value of the argument
...

   '<expression>' represents a required input parameter (required parameters
   are marked with the < and > symbols), and '<volume-out> - output' represents
   a required output filename (marked by the presence of the word 'output').
   '[-fixnan]' represents an option (marked with the [ and ] symbols), taking
   one required parameter '<replace>' (the indentation level indicates what
   parameters and suboptions are associated with a given option), and '[-var] -
   repeatable' denotes a repeatable option (marked by the presence of the word
   'repeatable') with required parameters '<name>' and '<volume>', and two
   suboptions: '[-subvolume]', which has a required parameter '<subvol>', and
   '[-repeat]', which takes no parameters.

   Each option starts a new scope, and all options and arguments end any scope
   that they are not valid in.  This means that for any option, you must
   specify all of its arguments and any desired suboptions before specifying
   any other option or argument on the same or a previous level.  For example,
   this annotated command is valid:

$ wb_command -volume-math 'abs(x)'  abs_x.nii.gz -fixnan 0  -var x    x.nii.gz
annotation:            <expression> <volume-out>     <replace> <name> <volume>

   Here is another annotated command that results in the same output, but
   uses a different order of the options:

$ wb_command -volume-math -fixnan 0     'abs(x)' -var x   x.nii.gz abs_x.nii.gz
annotation:                 <replace> <expression> <name> <volume> <volume-out>

   This next command is invalid, because the -fixnan option ends the scope of
   the -var option before all of its required arguments are given:

wrong: wb_command -volume-math 'abs(x)' abs_x.nii.gz -var x -fixnan 0 x.nii.gz

   This command is invalid because the -subvolume option occurs after the
   scope of the -var option has ended due to the -fixnan option:

wrong: wb_command -volume-math 'abs(x)' abs_x.nii.gz -var x x.nii.gz -fixnan 0 -subvolume 1

   This command is similarly invalid because the -subvolume option occurs
   after the scope of the -var option has ended due to the volume-out argument:

wrong: wb_command -volume-math 'abs(x)' -var x x.nii.gz abs_x.nii.gz -subvolume 1 -fixnan 0