alignlinear


Purpose:

This is a general linear intramodality registration tool (within or across subjects, 2D or 3D). The user can specify any of a variety of models, including rigid-body, affine, or perspective.

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


Usage:

alignlinear standard-file reslice-file air-out -m 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)
reslice-file
the name of the file you want to reslice (.img or .hdr suffix optional)
air-out
the exact name of the output file (cannot contain '.img' or '.hdr' and will not be modified by the program).
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 in the forward direction. 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 in the reverse direction. The value should always be an integer less than the maximum possible voxel value.
partitions-in-standard-file
defines the number of partitions used for segmenting the standard file when computing the standard deviation of the ratio image in the forward direction. If this value is less than 1, no forward direction computation is performed. A value of 256 is typically used for intermodality registration if the standard file is an MRI study. A value of zero is typically used for intermodality registration if the standard file is a PET study. For intramodality registration, the default value of 1 is appropriate.
partitions-in-reslice-file
defines the number of partitions used for segmenting the standard file when computing the standard deviation of the ratio image in the reverse direction. If this value is less than 1, no reverse direction computation is performed. A value of 256 is typically used for intermodality registration if the reslice file is an MRI study. A value of zero is typically used for intermodality registration if the reslice file is a PET study. For intramodality registration, the default value of 1 is appropriate.
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.
initialization-file
the name of an ASCII file containing initialization parameters. These parameters can be used to control the starting position for automated registration, a feature that is useful if the initial misregistration is extreme (e.g., >45°ree; of rotational misregistration) or if the default registration leads to an obviously incorrect result. The format for the rigid-body initialization file is discussed under file types. Rigid-body initialization files are created most easily using the program manualreslice. Different spatial models require different numbers and types of parameters in the initialization file.
termination-file
the name of an ASCII file to be created containing termination parameters. These parameters can then be used as initialization parameters to restart the algorithm at the same location in parameter space where it left off (using the same spatial model). This allows you to switch cost functions or to vary smoothing, among other things. Different spatial models create incompatible files.
overwrite?(y/n)
'y' if you want any preexisting file with the same name as your termination file to be overwritten.
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. In such cases, you may want to choose a final_sampling that is greater than one. 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 preceeding 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.
pre-alignment interpolation
in contrast to AIR 1.0, this new algorithm in AIR 2.0 does not apply prealignment interpolation of the files to cubic voxels by default. If you want prealignment interpolation, it can be enabled using this flag. Using prealignment interpolation will slow down the algorithm if you have thick slices, but may result in a more robust algorithm. If your voxels are already cubic, prealignment interpolation has no effect.
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.
cost-function
determines which cost function is used for aligning the images. This should be a number from the corresponding menu:

1. standard deviation of ratio images
This cost function has the advantage of being independent of image intensity, so image intensities can be poorly matched and the registration will not be adversely effected.
2. least squares
This cost function assumes that the image intensities are scaled identically. Least squares is computationally simpler and therefore faster than the standard deviation of ratio images, but may be inaccurate if the image intensities are poorly matched.
menu-model
specifies the spatial model to be used to align the images. This should be a number from the corresponding menu:

6. rigid body 6 parameter model
Used for intra-subject registration when all voxel sizes are known accurately
7. global rescale 7 parameter model
Not too useful for biological data
9. traditional 9 parameter model (std must be on AC-PC line)
This is the typical (as opposed to literal) Talairach model, provided that the standard file has been properly oriented using the Talairach rules.
12. affine 12 parameter model
This is the preferred model for intersubject registration
15. perspective 15 parameter model
The perspective distortions are probably not worth the extra computational cost in most cases.
23. 2-D rigid body 3 parameter model
Analogous to the 6 parameter 3D model
24. 2-D global rescale 4 parameter model
Analogous to the 7 parameter 3D model. Might be useful for aligning photos of distant objects taken from various distances.
25. 2-D affine/fixed determinant 5 parameter model
This model allows for nonrigid distortion so long as total area is preserved. This may be a useful model for realigning data from serial tissue sections.
26. 2-D affine 6 parameter model
Analogous to the 12 parameter 3D model.

Examples:

alignlinear pet1 pet2 pet2.airpet1 -m 6 -t1 55 -t2 55 -x 1 -r 8 -c 0.0 -h 8 -a 8

Comments:


Error messages: (alphabetical by case)

See also: Generic error messages
A positive decimal number must follow -c
A positive integer must follow -a
A positive integer must follow -h
A positive integer must follow -r
A termination file name must follow -g
A valid cost function number from the menu must follow -x
A valid model number from the menu must follow -m
An initialization parameter file name must follow -f
An integer must follow -t1 or -t2
Argument after -a cannot start with - ; it must be a positive integer
Argument after -c cannot start with - ; it must be a positive decimal number
Argument after -f cannot start with - ; it must be an initialization parameter file name
Argument after -g cannot start with -; it must be a termination file name
Argument after -h cannot start with - ; it must be a positive integer
Argument after -m cannot start with - ; it must be a valid model number from the menu
Argument after -r cannot start with - ; it must be a positive integer
Argument after -x cannot start with -; it must be a valid cost function number from the menu
Attempt to save .air file ____ failed.
Failure in smoothing routine
File '____' exists, no permission to overwrite
First three arguments cannot begin with a -
Name of output .air file cannot contain ____ or ____
Name of termination file cannot contain ____ or ____
Sorry, flag -____ is not defined for this program
Sorry, model ____ is not defined
Sorry, you have selected an unimplemented model for this cost function, please try again
Sorry, you have selected an unimplemented model, please try again
Standard (____) and reslice (____) files both have only a single plane of data. You must use a 2D model in this situation
Standard file (____) has ____ planes and reslice file (____) has ____ planes
The initialization file only provided ____ parameters, 12 parameters are required for the affine model (up to 16 parameters can be specified, but parameters 13-16 must be 0 0 0 1
The initialization file only provided ____ parameters, 15 parameters are required for the perspective model (up to 16 parameters can be specified
The initialization file only provided ____ parameters, ____ are required for this model
The initialization file only provided ____ parameters, ____ are required for this model
The number of planes in the standard and reslice files must be identical for 2D alignment models
The sixteenth parameter for the perspective model must be non-zero
Three arguments that follow -s cannot start with - ; they must be positive integers
Three integers must follow -s
Three positive numbers must follow -b1 or -b2
WARNING: File '____' will be overwritten by the output of this program
WARNING: The initialization file contained more parameters (____) than required (____)
WARNING: the voxel z_size differs for the two files that you are aligning using a 2D in-plane model
When the initialization file specifies >12 parameters for the affine model, parameters 13-16 must be 0 0 0 1
You have requested an unimplemented cost function
You must use a 2D model in this situation
final_sampling (2nd argument after -s) cannot be > initial_sampling (1st argument after -s)
sampling_decrement_ratio (3rd argument after -s) must be > 1
threshold ____ is not in range of possible pixel values
unable to create termination file '____'
unable to open initialization file '____'
unable to parse arguments,argument ____ was expected to begin with a -

See also:


Modified: January 6, 1996
© 1995-96 Roger P. Woods, M.D.(rwoods@ucla.edu)