magnify
Purpose:
This program will magnify images independently along the three
major axes using Fourier interpolation. Magnification factors are
restricted to values that can be expressed as the ratio of two
integers, and the integer in the denominator must be a factor of the
corresponding image dimension.
Usage:
magnify input
output
overwrite?(y/n)
magnify-x
magnify-y
magnify-z
[shrink-x
shrink-y
shrink-z]
- where the following definitions apply:
- input
- The name of the input file.
- output
- The name of the output file
- overwrite?(y/n)
- The letter 'y' if you want to overwrite any preexisting
file with the same name as you specified for the output.
- magnify-x
- The x magnification factor. This must be an integer greater
than or equal to 1.
- magnify-y
- The y magnification factor. This must be an integer greater
than or equal to 1.
- magnify-z
- The z magnification factor. This must be an integer greater
than or equal to 1.
- shrink-x
- The optional x minification factor. This must be a positive
integer and must be smaller than the x magnification factor
(i.e., the net effect of the two factors cannot result in net
minification). This value must also be a factor of the x
dimension of the file.
- shrink-y
- The optional y minification factor. This must be a positive
integer and must be smaller than the y magnification factor
(i.e., the net effect of the two factors cannot result in net
minification). This value must also be a factor of the y
dimension of the file.
- shrink-z
- The optional z minification factor. This must be a positive
integer and must be smaller than the z magnification factor
(i.e., the net effect of the two factors cannot result in net
minification). This value must also be a factor of the z
dimension of the file.
Examples:
magnify mri bigmri y 2 2 1
- The file "mri" will be transformed into a file "bigmri" which
has the same number of planes as the input file, but has twice the
x and y dimensions with voxels that are half as large. If the
input x and y dimensions were 256, the corresponding output
dimensions will be 512.
magnify mri bigmri y 3 3 1 2 2 1
- The file "mri" will be transformed into a file "bigmri" which
has the same number of planes as the input file, but has 1.5 times
the x and y dimensions with voxels that are 2/3 as large. If the
input x and y dimensions were 256, the corresponding output
dimensions will be 384.
Comments:
- The use of Fourier interpolation results in near optimal
resampling of the data at the larger size. Images can be expanded
to several times their input size with acceptable looking results.
Note that the interpolation assumes that the data wraps around in
all dimensions. This is especially likely to cause problems along
the z-axis where the newly generated slices at the bottom of the
brain will start to take on characteristics of the top of the
brain. You can use the program resize to
clip off the extra planes created at the bottom if this is a
problem.
Error messages: (alphabetical by
case)
See also: Generic error messages
- Magnifications must be integers greater than or equal to
1
- Magnifications must be larger than shrinkages
- You cannot have net minification.
- Shrinkages must be integers greater than or equal to
1
- x shrinkage should be a factor of the x dimension
(____)
- Respecify using a factor of the dimension (1 is also
considered a factor).
- y shrinkage should be a factor of the y dimension
(____)
- Respecify using a factor of the dimension (1 is also
considered a factor).
- z shrinkage should be a factor of the z dimension
(____)
- Respecify using a factor of the dimension (1 is also
considered a factor).
See also:
Modified: December 11, 1996
© 1995-6 Roger P. Woods,
M.D.(rwoods@ucla.edu)