

NAME · USAGE · PARAMETERS · DESCRIPTION · TIMINGS · EXAMPLES
BUGS · SEE_ALSO
gregister -- transform a list of images from one coordinate system to another
gregister input output database transforms
- input
- List of images to be transformed.
- output
- List of output images.
- database
- The name of the text file database produced by GEOMAP containing the coordinate
transformation(s).
- transforms
- The list of the database record(s) containing the transformations.
The number of transforms must be 1 or the same as the number of input
images. Transforms is usually the name of the
text file input to GEOMAP which lists the reference and input
coordinates of the control points.
- geometry = "geometric"
- The type of geometry to be applied: The choices are:
- linear
- The linear part, shifts, scales and rotations are computed.
- geometric
- The full transformation is computed.
- xmin = INDEF, xmax = INDEF, ymin = INDEF, ymax = INDEF
- The minimum and maximum x and y reference values of the output image.
Xmin, xmax, ymin and ymax default to minimum and maximum values set in GEOMAP,
and may not extend beyond the bounds of those parameters.
- xscale = 1.0, yscale = 1.0
- The output x and y scales in units of reference x and y
units per pixel, e.g "/ pixel or Angstroms / pixel if the reference
coordinates
are arc-seconds or Angstroms. If the reference coordinates are in pixels
then xscale and yscale should be 1.0 to preserve the scale of the reference
image. The default is set for pixel coordinates.
If xscale and yscale are undefined (INDEF), xscale and yscale default to the
range of the reference coordinates over the range in pixels.
Xscale and yscale overide the values of ncols and nlines.
- ncols = INDEF, nlines = INDEF
- The number of columns and lines in the output image. Ncols and nlines default
to the size of the input image. If xscale or yscale are defined ncols or nlines
are overidden.
- xsample = 1.0, ysample = 1.0
- The coordinate surface subsampling factor. The coordinate surfaces are
evaluated at every xsample-th pixel in x and every ysample-th pixel in y.
Transformed coordinates at intermediate pixel values are determined by
bilinear interpolation in the coordinate surfaces.
- interpolant = "linear"
- The choices are the following.
- nearest
- Nearest neighbour.
- linear
- Bilinear interpolation in x and y.
- poly3
- Third order polynomial in x and y.
- poly5
- Fifth order polynomial in x and y.
- spline3
- Bicubic spline.
- sinc
- 2D sinc interpolation. Users can specify the sinc interpolant width by
appending a width value to the interpolant string, e.g. sinc51 specifies
a 51 by 51 pixel wide sinc interpolant. The sinc width will be rounded up to
the nearest odd number. The default sinc width is 31 by 31.
- lsinc
- Look-up table sinc interpolation. Users can specify the look-up table sinc
interpolant width by appending a width value to the interpolant string, e.g.
lsinc51 specifies a 51 by 51 pixel wide look-up table sinc interpolant. The user
supplied sinc width will be rounded up to the nearest odd number. The default
sinc width is 31 by 31 pixels. Users can specify the resolution of the lookup
table sinc by appending the look-up table size in square brackets to the
interpolant string, e.g. lsinc51[20] specifies a 20 by 20 element sinc
look-up table interpolant with a pixel resolution of 0.05 pixels in x and y.
The default look-up table size and resolution are 20 by 20 and 0.05 pixels
in x and y respectively.
- drizzle
- 2D drizzle resampling. Users can specify the drizzle pixel fraction in x and y
by appending a value between 0.0 and 1.0 in square brackets to the
interpolant string, e.g. drizzle[0.5]. The default value is 1.0.
The value 0.0 is increased internally to 0.001. Drizzle resampling
with a pixel fraction of 1.0 in x and y is equivalent to fractional pixel
rotated block summing (fluxconserve = yes) or averaging (flux_conserve = no) if
xmag and ymag are > 1.0.
- boundary = "nearest"
- The boundary extension choices are:
- nearest
- Use the value of the nearest boundary pixel.
- constant
- Use a constant value.
- reflect
- Generate value by reflecting about the boundary.
- wrap
- Generate a value by wrapping around to the opposite side of the image.
- constant = 0.
- The value of the constant for boundary extension.
- fluxconserve = yes
- Preserve the total image flux. The output pixel values are multiplied by
the Jacobian of the coordinate transformation.
- nxblock = 512, nyblock = 512
- If the dimensions of the output image are less than nxblock and nyblock
then the entire image is transformed at once. Otherwise blocks of size
nxblock by nyblock are transformed one at a time.
- verbose = yes
- Print messages about the progress of the task ?
GREGISTER corrects an image for geometric distortion using the coordinate
transformation computed by GEOMAP. The transformation is stored as the
coefficients of a polynomial surface in record transforms
,
in the text file database
.
The coordinate surface is sampled at every xsample
and ysample
pixel in x and y.
The transformed coordinates at intermediate pixel values are
determined by bilinear interpolation in the coordinate surface. If
xsample
and ysample
= 1, the coordinate
surface is evaluted at every pixel. Use of xsample
and ysample
are strongly recommended for large images and high order coordinate
surfaces in order to reduce the execution time.
Xmin
, xmax
, ymin
and ymax
define the range of
reference coordinates represented in the output picture. These numbers
default to the minimum and maximum x and y reference values used by GEOMAP,
and may not exceed these values.
The scale and size of the output picture is determined as follows.
ncols = ncols(input)
if (xscale == INDEF)
xscale = (xmax - xmin ) / (ncols - 1)
else
ncols = (xmax - xmin) / xscale + 1
nlines = nlines(input)
if (yscale == INDEF)
yscale = (ymax - ymin ) / (nlines - 1)
else
nlines = (ymax - ymin) / yscale + 1
The output image gray levels are determined by interpolating in the input
image at the positions of the transformed output pixels. If the
fluxconserve
switch is set the output pixel values are multiplied by
the Jacobian of the transformation. GREGISTER uses the routines in the
2-D interpolation package.
The output image is computed in nxblock
by nyblock
pixel sections.
If possible users should set these number to values larger than the dimensions
of the output image, in order to minimize the number of disk reads and writes
required to compute the output image. If this is not feasible and the image
rotation is small users should set nxblock to be greater than the number of
columns in the output image, and nyblock to be as large as machine memory
will permit.
If the environment variable nomwcs
is "no" then the world coordinate
system of the input image is modified in the output image to reflect the
effects of the linear
portion of the registration operation.
Support does not yet exist in the IRAF world coordinate system interface
for the higher order distortion corrections that GREGISTER is capable
of performing.
It requires approximately 70 and 290 cpu seconds to correct a 512 by 512
square image for geometric distortion using a low order coordinate surface
and bilinear and biquintic interpolation respectively (Vax 11/750 far).
- 1.
- Transform an image to the reference coordinate system of a 512 by 512 pixel
square image. The output image will have the same scale and size as the
reference image if the reference coordinates are in pixels.
cl> geomap coords database 1.0 512.0 1.0 512.0
cl> gregister input output database coords
- 2.
- Repeat the previous example but rescale the output image. The scale of the
output image will be 2.5 reference units per pixel and its size will be
determined by the xmin, xmax, ymin, ymax parameters (1.0, 512.0, 1.0, 512.0).
cl> geomap coords database 1.0 512.0 1.0 512.0
cl> gregister input output database coords xscale=2.5 yscale=2.5
- 3.
- Correct an image for 3rd order geometric distortion using an output scale of 2
reference units per pixel unit and bicubic spline interpolation with no flux
correction.
cl> geomap coords database 1.0 512.0 1.0 512.0 xxorder=4 xyorder=4 \
xxterms=yes yxorder=4 yyorder=4 yxterms=yes
cl> gregister input output database coords xscale=2. yscale=2. \
>>> inter=spline3 flux-
- 4.
- Transform three images using 3 different transformation records stored
in the database file.
cl> geomap coord1,coord2,coord3 database 1. 512. 1. 512.
cl> gregister im1,im2,im3 imout1,imout2,imout3 database \
>>> coord1,coord2,coords3
- 5.
- Repeat the above example using the textfiles inlist, outlist, reclist which
contain the list of input images, list of output images and list of coordinate
files respectively.
cl> geomap @reclist database 1. 512. 1. 512.
cl> gregister @inlist @outlist database @reclist
Support does yet exist in the IRAF world coordinate system interface
for the higher order distortion corrections that GREGISTER is capable
of performing.
imshift, magnify, rotate, imlintran, geomap, geotran, geoxytran
Source Code · Search Form · STSDAS
Maintained by the Science Software Group at STScI
This file last updated on 22 Apr 1999