Workbench Command is a set of command-line tools that can be used to perform simple and complex operations within Connectome Workbench.
SURFACE GRADIENT OF A METRIC FILE wb_command -metric-gradient <surface> - the surface to compute the gradient on <metric-in> - the metric to compute the gradient of <metric-out> - output - the magnitude of the gradient [-presmooth] - smooth the metric before computing the gradient <kernel> - the size of the gaussian smoothing kernel in mm, as sigma by default [-fwhm] - kernel size is FWHM, not sigma [-roi] - select a region of interest to take the gradient of <roi-metric> - the area to take the gradient within, as a metric [-match-columns] - for each input column, use the corresponding column from the roi [-vectors] - output gradient vectors <vector-metric-out> - output - the vectors as a metric file [-column] - select a single column to compute the gradient of <column> - the column number or name [-corrected-areas] - vertex areas to use instead of computing them from the surface <area-metric> - the corrected vertex areas, as a metric [-average-normals] - average the normals of each vertex with its neighbors before using them to compute the gradient At each vertex, the immediate neighbors are unfolded onto a plane tangent to the surface at the vertex (specifically, perpendicular to the normal). The gradient is computed using a regression between the unfolded positions of the vertices and their values. The gradient is then given by the slopes of the regression, and reconstructed as a 3D gradient vector. By default, takes the gradient of all columns, with no presmoothing, across the whole surface, without averaging the normals of the surface among neighbors. When using -corrected-areas, note that it is an approximate correction. Doing smoothing on individual surfaces before averaging/gradient is preferred, when possible, in order to make use of the original surface structure. Specifying an ROI will restrict the gradient to only use data from where the ROI metric is positive, and output zeros anywhere the ROI metric is not positive. By default, the first column of the roi metric is used for all input columns. When -match-columns is specified to the -roi option, the input and roi metrics must have the same number of columns, and for each input column's index, the same column index is used in the roi metric. If the -match-columns option to -roi is used while the -column option is also used, the number of columns of the roi metric must match the input metric, and it will use the roi column with the index of the selected input column. The vector output metric is organized such that the X, Y, and Z components from a single input column are consecutive columns.