FSL

### vecreg - Registration of vector images

After running dtifit or bedpostx, it is often useful to register vector data to another space. For example, one might want to represent V1 for different subjects in standard space. vecreg is a command line tool that allows to perform such registration.
Vector images cannot be registered by simply applying a transformation (as calculated by, say, FLIRT) to every voxel's coordinates. The corresponding vectors have to be reoriented accordingly (see D. Alexander 2001, IEEE-TMI 20:1131-39). vecreg performs this operation for you. The image on the right shows the effect of applying vecreg (right) to the V1 image on the left, compared to simply applying voxelwise transformation (e.g. using applyxfm4D) to the vectors (centre).
Important: vecreg does not calculate a transformation, but simply applies a given transformation to the input vector field. vecreg can apply a linear transformation calculated with FLIRT, or a non-linear transformation calculated by IRTK, using a warpfield calculated using dof2warp.

types of vectors that may be used for vecreg
from dtifit: V1,V2,V3
from bedpostx: dyads1, dyads2, etc.

### Command-line utility

using a flirt matrix
vecreg -i input_vector -o output_vector -r reference_image -t flirt_transform.mat
using a warpfield
vecreg -i input_vector -o output_vector -r reference_image -w warp_field
more options

    vecreg -i <input4Dvector> -o <output4D> -t <transformation>

    Compulsory arguments (You MUST set one or more of):
            -i,--input      filename of input vector
            -o,--output     filename of output registered vector
            -r,--ref        filename of reference (target) volume

    Optional arguments (You may optionally specify one or more of):
            -v,--verbose    switch on diagnostic messages
            -h,--help       display this message
            -t,--affine     filename of affine transformation matrix
            -w,--warpfield  filename of 4D warp field for nonlinear registration
            --interp        interpolation method : nearestneighbour (default) or trilinear or sinc
            -m,--mask       brain mask in input space