Last modified: December 2022

Jump to: Description · Example · Parameters · Bugs · See Also

AHELP for CIAO 4.16


Context: Tools::Image


shift, rotate, scale images


dmregrid2  infile outfile [resolution] [method] [theta] [rotxcenter]
[rotycenter] [xoffset] [yoffset] [xscale] [yscale] [coord_sys]
[lookupTab] [clobber] [verbose]


`dmregrid2' will take an input image (or stack of images) and will apply a user supplied shift, rotation, and/or scaling of the pixels. This uses a similar kind of algorithm as the original dmregrid but uses a much more efficient (both memory and speed) algorithm. Unlike the reproject_image* tools; this tool does NOT modify the WCS.

If multiple images are supplied the output image will contain the shifted and co-added images.

First the pixel is "shifted" to the center of rotation. Then the image is rotated about that point by the specified amount and scaled. Finally, the image is shifted by the use offset.



name type ftype def reqd
infile file input   yes
outfile file output   yes
resolution real   1 no
method string   sum no
theta real     no
rotxcenter real     no
rotycenter real     no
xoffset real     no
yoffset real     no
xscale real     no
yscale real     no
coord_sys string   logical no
lookupTab string     no
clobber boolean   no no
verbose integer   0 no

Detailed Parameter Descriptions

Parameter=infile (file required filetype=input)

Parameter=outfile (file required filetype=output)

Parameter=resolution (real not required default=1)

Number of points along each side of pixel to use

The algorithm works by mapping the points along the edge of the input image pixel to the output image; computing the area of the polgon that gets clipped by the output pixel; and adding (or averaging) the pixel values. For purely linear translations a value greater than 1 does not help. A value of 0 can also be used which will only use the center pixel value; this provides a fast method to get an approximate answer.

Parameter=method (string not required default=sum)

sum or average pixel values

The output pixels can represent the sum of the input pixels or the average of the input pixels. The former is often used for 'counts' images; the later for exposure.

Parameter=theta (real not required)

Rotation angle

Angle about which to rotate image.

Parameter=rotxcenter (real not required default=)

X-center of rotation

Parameter=rotycenter (real not required default=)

Y-center of rotation

Parameter=xoffset (real not required default=)

Shift in X-direction

Parameter=yoffset (real not required default=)

Shift in Y-direction

Parameter=xscale (real not required default=)

Scaling in the X-direction

Parameter=yscale (real not required default=)

Scaling in the Y-direction

Parameter=coord_sys (string not required default=logical)

Coordinate system of user parameters

The shifts, scales, and rotation center are specified in this coordinate system. Currently only "logical" is supported.

Parameter=lookupTab (string not required default=)

Header merging rules

How to combine headers from multiple files. If blank, then the header of the first file is used. The WCS from the 1st file is always used.

Parameter=clobber (boolean not required default=no)

clobber output?

remove output file if it already exists?

Parameter=verbose (integer not required default=0)

chatter level


There are no known bugs for this tool.

See Also

reproject_image, reproject_image_grid
centroid_map, dmfilth, dmimg2jpg, dmimgadapt, dmimgblob, dmimgcalc, dmimgdist, dmimgfilt, dmimghist, dmimgpick, dmimgpm, dmimgproject, dmimgreproject, dmimgthresh, dmmaskbin, dmmaskfill, dmnautilus, dmradar, dmregrid, energy_hue_map, evalpos, hexgrid, map2reg, merge_too_small, mkregmap, pathfinder, vtbin
dmcontour, dmellipse, dmimghull, dmimglasso
addresp, mean_energy_map, pileup_map
dmstat, imgmoment, statmap