alignpettopet

Note: This program is no longer part of the AIR distribution (last distributed in AIR 3.03).
 
 
This program uses the minimization algorithm distributed with AIR 1.0 with only minor modifications to allow it to coexist with AIR 3.0. This program still requires pixel sizes to be isotropic. The program alignlinear implements a better minimization procedure and greater flexibility and should be used preferentially.


Purpose:

PET to PET registration using a rigid body model

Generates a .air file that can be used to reslice the specified reslice data set to match the specified standard data set.

Also suitable for other types of intrasubject, intramodality registration(e.g. MRI to MRI registration)


Usage:

alignpettopet standard-file reslice-file air-out [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
if non-negative:
defines a minimum voxel value for the standard file. Voxels in the standard file below this value are excluded from analysis when the direction of the bi-directional fit calls for the standard file to to be in the denominator of the ratios used for computing the normalized standard deviation. The value should always be an integer less than the maximum possible voxel value.
if negative:
a unidirectional fit is forced with the standard file in the numerator.
threshold-reslice-file
if non-negative:
defines a minimum voxel value for the reslice file. Voxels in the reslice file below this value are excluded from analysis when the direction of the bi-directional fit calls for the reslice file to to be in the denominator of the ratios used for computing the normalized standard deviation. The value should always be an integer less than the maximum possible voxel value.
if negative:
a unidirectional fit is forced with the reslice file in the numerator.
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 initialization file is discussed under file types. Initialization files are created most easily using the program manualreslice.
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 absolute values of all the first derivatives 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 will lead to a failure to converge.
repeated-iterations
controls the maximum number of iterations permitted in each cycle. This feature is incorporated to avoid infinite loops, a situation that arises most commonly when the data is being sampled very superficially. 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 information that could have been derived more quickly at the prematurely aborted more superficial sampling. Values less than 100 should generally be avoided for 6 parameter fits. Failure to converge within the specified number of iterations at the densest sampling will result in a failed registration--no registration parameters will be saved if this occurs.
blur_x_and_y_smoothing
controls the amount of smoothing that is applied to the files before they are aligned. Note that this smoothing does not have any effect on the resolution of the images that will be produced when the reslice parameters generated by this program are used to reslice the reslice_file. If your images are not noisy, either by virtue of excellent counting statistics by virtue of smoothing during reconstruction, you may not need to smooth at all. If your images are noisy, smoothing may improve both the speed and the accuracy of the registration. Smoothing is done using a simple box smoothing kernel applied uniformly in the x- and y- dimensions. A value of zero corresponds to a 1x1 smooth (output is unchanged). A value of N results in a 2N+1 by 2N+1 pixel smoothing kernel. For practical purposes, you will probably not want to use a value greater than 5 (among other things, the smoothing process itself becomes quite slow when values get this large).
pre-alignment interpolation
is applied by default to convert the files to cubic voxels to be used in the denominator when calculating the normalized standard deviation. If you are really desperate for RAM, use of the -z flag can save a considerable amount of RAM but probably does not give as accurate results if your interplane distance is large. For small interplane distances (e.g. 3 mm or less), disabling pre-alignment interpolation will probably not be detrimental.


Error messages: (alphabetical)

See also: Generic error messages

alignment will be constrained to inplane because of z dimension degeneracy
  • File standard_file apparently has only one plane of data (according to header)
  • Use scanheader to verify that this is the case
  • If header is incorrect, you will need to generate a new header for standard_pet with the correct z_dim using makeaheader.
All second derivatives were negative, cannot minimize Will try next sample density
  • Negative second derivatives lead to maxima, not minima
  • If registration resumes at next sample density and the results look fine, don't worry about it
  • If the results are bad, check your image orientation. Consider using an initialization file.
  • If sampling density cannot be increased, the algorithm will fail; no .air file will be generated.
Attempt to save .air file air_out failed
  • Check to see if disk is full
  • Check that you have write permission in the directory
error reading initialization file initialization_file
memory inadequate...
  • The program was unable to allocate enough RAM to perform the alignment.
  • Try again when the machine isn't busy with other RAM intensive tasks
  • Get access to more RAM
Pixel anisotropy exceeds ... in ... file: ...
  • The program being used requires the voxel x and y sizes to be identical.
  • See programs reorient and zoomer for possible ways to circumvent this problem (an appropriate initialization file may also need to be created to perform automated registration).
Sample density is already maximal, giving up
  • See "All second derivatives were negative..." above.
threshold ____ is not in range of possible pixel values
  • Choose a value less than 255 if you are using 8 bits/pixel on a SPARCstation
unable to allocate memory ...
  • see "memory inadequate..." above
unable to open initialization file filename
  • See if file filename exists in directory
  • See if you have read permission for file filename
WARNING: File air_out will be overwritten by the output of this program
  • Type control-C immediately to abort program if you don't want to overwrite this file


See also:


Footnotes:

Other types of intrasubject, intramodality registration
This program is not limited to PET to PET registration and can be used for any intrasubject, intramodality registration problem. The term intramodality implies that the images have similar properties. The fact that the same generic imaging technique was used does not necessarily imply that the registration is intramodality. For example, different PET tracers will generate images that have very different characteristics. Likewise, different MRI pulse sequences can generate images that cannot be registered using this program. In these situations, the programs alignmritopet or alignpettomri are more likely to be successful.
unidirectional fits
In general, unidirectional fits should be avoided. You may need to perform a unidirectional fit if there is some focal area of extreme change (e.g., part of the brain has been removed either functionally or anatomically) between the two studies being registered that is interfering with bi-directional registration. If this occurs, you should manually edit the area of focal extreme change out of one of the images and make the threshold for the other image negative to force a unidirectional fit.


Modified: October 26, 1997

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