align_warp


Purpose:

This is a nonlinear registration tool that can be used within or across subjects and includes implementation of 2D and 3D nonlinear spatial transformation models.

The program will generate a .warp file that can be used to reslice the specified reslice data set to match the specified standard data set.


Usage:

align_warp standard-file reslice-file .warp-out -m model-menu-number [final-model-menu-number] [options]

options:

where the following definitions apply:
standard-file
the name of the file that you want the other file resliced to match (.img or .hdr suffix optional). The standard file will often be an atlas, but can also be images from a single subject.
reslice-file
the name of the file you want to reslice (.img or .hdr suffix optional)
.warp-out
the exact name of the .warp transformation parameter output file (cannot contain '.img' or '.hdr' and will not be modified by the program).
model-menu-number
The order (a number from 1 through 5 ) of the polynomial transformation used as a spatial transformation model. If the optional final-model-menu-number (see next item) is provided, the model selected here will be the model used initially, and models will increment by one until the final model is reached. If the optional final-model-menu-number is not provided, the algorithm will start with a first order transformation and increment to the order specified by this argument.
final-model-menu-number
See the description of the model-menu-number above.
threshold-standard-file
defines a minimum voxel value for the standard file. Voxels in the standard file below this value are excluded from analysis when computing the cost function and its derivatives. The value should always be an integer less than the maximum possible voxel value.
threshold-reslice-file
defines a minimum voxel value for the reslice file. Voxels in the reslice file below this value are excluded from analysis when computing the cost function and its derivatives. The value should always be an integer less than the maximum possible voxel value.
FWHM-x FWHM-y FWHM-z (standard-file)
if this option is used, smoothing filters are applied along the x, y and z axes of the standard file before performing registration. The FWHM value specifies the full width at half maximum of the Gaussian smoothing filter to be applied along each dimension. The filters have units of millimeters (or whatever units you use to specify voxel sizes in your .hdr files). All three dimensions must be specified. If you give a value of zero, no smoothing will be applied along the corresponding dimension.
FWHM-x FWHM-y FWHM-z (reslice-file)
if this option is used, smoothing filters are applied along the x, y and z axes of the reslice file before performing registration. The FWHM value specifies the full width at half maximum of the Gaussian smoothing filter to be applied along each dimension. The filters have units of millimeters (or whatever units you use to specify voxel sizes in your .hdr files). All three dimensions must be specified. If you give a value of zero, no smoothing will be applied along the corresponding dimension.
standard-file-mask
this file is applied to the standard file as a mask. The file must match the standard file's dimensions, and voxels that are zero in this file will be treated as if they were zero in the standard file when computing the cost function. Mask files can be binary or regular files.
reslice_file_mask
this file is applied to the reslice file as a mask. The file must match the reslice file's dimensions, and voxels that are zero in this file will be treated as if they were zero in the reslice file when computing the cost function. Mask files can be binary or regular files.
initialization-file
the name of an ASCII file containing spatial transformation initialization parameters. If you override the default procedure of starting with a first order model, it is very important to use an initialization file (presumably derived from some prior successful registration). Poor initialization of high order transformations can lead to poor results. Each spatial model requires different numbers of parameters in the initialization file. Note that voxel intensity initialization is performed separately in an intensity parameter initialization file.
termination-file
the name of an ASCII file to be created containing spatial transformation termination parameters. These parameters can then be used as initialization parameters to restart the algorithm at the same location in parameter space. Unlike the program alignlinear, in align_warp the termination file automatically writes out an initialization file for the next higher order of spatial transformation by adding an appropriate number of zeros at the appropriate locations. If you don't actually want to increment the model, use the -x argument as well. Note that voxel intensity termination parameters must be requested separately by identifying an intensity parameter termination file.
overwrite?(y/n)
'y' if you want any preexisting file with the same name as your termination file to be overwritten.
scaling_initialization file
the name of an ASCII file containing the parameter that initializes intensity scaling.
scaling_termination_file
the name of an ASCII file to be created containing the intensity scaling parameter identified as optimal by the algorithm. This parameter can be used to restart the algorithm at the same location in parameter space where it left off. In addition, the scaling parameter could be used as an intensity normalization factor for subsequent statistical analysis of the registered data.
initial-sampling
controls how densely data is sampled during the first iterative cycle of the algorithm. Large values generally speed up the registration process because gross misregistration can be detected with fairly superficial sampling of the data. However, choosing an excessively large value can be counterproductive if the algorithm falls into an infinite loop or is led far from the true value by nonrepresentative sampling. Avoid multiples of two when choosing sampling parameters. If any of your matrix dimensions are divisible by two, the sampling will become spatially biased until the sampling density reaches one, at which point the algorithm will have to iteratively overcome the earlier bias at the maximal sampling density. If your matrix dimensions are divisible by three, you will have a similar problem with sampling densities that are multiples of three.
final-sampling
controls how densely data is sampled during the final iterative cycle of the algorithm. If your data is oversampled, the time spent sampling very densely may not provide any significant improvement in accuracy. Unlike alignlinear, the default here is to end with sparse sampling at every ninth voxel. Iterations will cease if the new sampling density is less than the final_sampling density specified here.
sampling-decrement-ratio
determines the number of intermediate iterative cycles of the algorithm. The current sampling is divided by this ratio with each cycle to determine the new sampling.
convergence-threshold
controls how small the predicted change in the cost function must be in order to meet the convergence criteria. Setting this value too large will result in convergence while the images are still misregistered; setting it too small may lead to a failure to converge.
repeated-iterations
controls the maximum number of iterations permitted at each sampling density. If this number is made too low, it will lead to inaccurate results and/or slow down the overall performance of the algorithm by preventing you from making use of information that could have been derived more quickly at the prematurely aborted, more superficial sampling.
halt-after-(N)-iterations-without-improvement
controls the maximum number of iterations without any observed improvement in the cost function. If greater than or equal to the "repeated_iterations" variable above, this value has no effect. At lower values, it can help you escape from situations where you are bouncing back and forth between two or three locations in parameter space without making any real progress. This sort of thing usually only happens at superficial sampling densities.
alternate-strategy-after-(M)-iterations-without-improvement
similar to the preceding option except that it does not force termination of the current sampling density, but rather tries to split the difference between the locations in parameter space at the current sampling. If greater than or equal to the "halt-after-(N)-iterations-without-improvement" or the "repeated-interations" variables above, this value has no effect.
don't write extra zeros (for higher order model) in termination file
this will prevent the program from appending zeros to a termination file. This will allow the termination file to be reused with the same spatial transformation model rather than with the next higher order model.
assume noninteraction of spatial parameter derivatives
ignoring the second derivatives of the interpolated voxel values with respect to spatial location by selecting this option can significantly improve the speed of the algorithm with little cost in terms of accuracy.
verbose mode
information about every iteration will be printed to the screen if you use the -v option. If you run a lot of registrations and leave screen scrolling enabled with this option, you will eventually fill up the disk and the system will grind to a halt.


Examples:

align_warp subject1 subject2 subject2.warpsubject1 -m 2 -t1 10 -t2 10 -g s2.init -gs s2.inits

align_warp subject1 subject2 subject2.warpsubject1 -m 3 3 -t1 10 -t2 10 -f s2.init -fs s2.inits -g s3.init y -gs s3.inits y

align_warp subject1 subject2 subject2.warpsubject1 -m 3 5 -t1 10 -t2 10 -f s3.init -fs s3.inits


Comments:


Error messages: (alphabetical by case)

See also: Generic error messages

An image file name must follow -e1 or -e2
  • These are flags that indicate that the next argument is a mask file.
A positive decimal number must follow -c
  • self-explanatory
A positive integer must follow -a
  • self-explanatory
A positive integer must follow -h
  • self-explanatory
A positive integer must follow -r
  • self-explanatory
A termination file name must follow -g
  • -g is a flag indicating that the name of an ASCII file to be created will follow
A valid model number from the menu must follow -m
  • valid models are: 1, 2, 3, 4, 5, 21, 22, 23, 24, and 25
An initialization parameter file name must follow -f
  • -f is a flag indicating that the name of an existing ASCII file will follow
An integer must follow -t1 or -t2
  • self-explanatory
Argument after -a cannot start with - ; it must be a positive integer
  • self-explanatory
Argument after -c cannot start with - ; it must be a positive decimal number
  • -c is followed by the convergence threshold, it must be nonnegative
Argument after -f cannot start with - ; it must be an initialization parameter file name
  • -f is a flag indicating that the name of an existing ASCII file will follow
Argument after -g cannot start with -; it must be a termination file name
  • -g is a flag indicating that the name of an ASCII file to be created will follow
Argument after -h cannot start with - ; it must be a positive integer
  • self-explanatory
Argument after -m cannot start with - ; it must be a valid model number from the menu
  • valid models are: 1, 2, 3, 4, 5, 21, 22, 23, 24, and 25
Argument after -r cannot start with - ; it must be a positive integer
  • -r is a flag that should be followed by the maximum number of iterations at each sampling density
Attempt to save .warp file ____ failed.
  • Do you have write permission for the specified directory?
  • Is the disk full?
Dimension mismatch: ____: ____ ____ ____, ____: ____ ____ ____
  • Mask files must have the same dimension as the corresponding data files.
Failure in smoothing routine
  • Inadequate RAM memory is the most likely cause
File '____' exists, no permission to overwrite
  • Termination files will not overwrite existing files of the same name unless the termination file name is followed by a 'y'
First three arguments cannot begin with a -
  • the first three arguments are reserved for the names of the standard file, reslice file and output file.
Initial and final models must have the same dimension (2D or 3D)
  • You can't start with a 2D model and end with a 3D model or vice versa. Check the two arguments after -m
Name of output .air file cannot contain .hdr or .img
  • self-explanatory--this is to prevent overwriting of your original data.
Name of termination file cannot contain .hdr or .img
  • self-explanatory--this is to prevent overwriting of your original data.
Sorry, flag -____ is not defined for this program
  • The specified flag does not have meaning to this program.
Sorry, model ____ is not defined
  • The specified model is not implemented in this program.
Standard (____) and reslice (____) files both have only a single plane of data ...
  • A 2D model is required in this case
The final model cannot be lower than the initial model
  • The first argument after -m must be lower than the second argument after -m
The initialization file provided ____ parameters, ____ are required for this model
  • The number of parameters in the initialization file must exactly match the number required by the selected model. Use your text editor to revise the initialization file.
Three arguments that follow -s cannot start with - ; they must be positive integers
  • self-explanatory
Three integers must follow -s
  • self-explanatory
Three positive numbers must follow -b1 or -b2
  • These are the FWHM smoothing values for the x, y, and z dimensions of the files.
WARNING: File '____' will be overwritten by the output of this program
  • The .warp file that you have specified will overwrite an existing file with the same name. Hit Control-C to terminate the program if overwriting is undesirable.
WARNING: It is recommended that you use initialization files with nonlinear transformations
  • You have requested that the algorithm start with a higher order (i.e.,nonlinear model) and have not provided an initialization file. You risk seeing the evil "Hessian matrix is not positive definite" warning and/or getting a bad result.
WARNING: Hessian matrix is not positive definite...
  • The minimization algorithm has identified a potential problem with the cost function tending towards a maximum or being at a saddle point. Depending on whether you were close to or far from convergence at the time, the results may be acceptable or they may be bad. Either inspect the results closely, or consider using the -q option which is less likely to give rise to a non-positive definite Hessian matrix.
You cannot use the -e1 flag twice on the same command line
  • You have requested two different masks be applied to the same data set.
You cannot use the -e2 flag twice on the same command line
  • You have requested two different masks be applied to the same data set.
You must specify a spatial transformation model using the -m argument
  • The -m argument, followed by a model number, is mandatory.
Your final model ____ is not defined on the menu
  • self-explanatory
final_sampling (2nd argument after -s) cannot be > initial_sampling (1st argument after -s)
  • self-explanatory
sampling_decrement_ratio (3rd argument after -s) must be > 1
  • self-explanatory
threshold ____ is not in range of possible pixel values
  • The threshold must be in the possible range for the data type of the corresponding file. If the threshold seems right, review the data in the header of the data file.
unable to create termination file '____'
  • Do you have the necessary write permissions?
  • Is the disk full?
unable to open initialization file '____'
  • Does the file exist?
  • Do you have read permission?
unable to parse arguments,argument ____ was expected to begin with a -
  • You have a number or letter where a new argument flag was expected.


See also:


Modified: October 25, 1997

© 1995-97 Roger P. Woods, M.D.(rwoods@ucla.edu)