Calls from Fortran take the identical arguments, except as noted (string lengths are omitted from Fortran calls). Sections are numbered from 1 instead of zero when calling from Fortran.
Header to include: warpfiles.h
3 nx ny nz binning pixelSize flagsHere
nx
and ny
are the sizes of the images on which
a warping or distortion field was measured,
binning
is relevant only for distortion fields, and is the
absolute binning of the images, including any binning on the camera
pixelSize
is the pixel size in Angstroms of the images,
corresponding to the pixel spacing reported by the standard header output.
flags
is an OR of a set of bit flags:
xStart xInterval nxGrid yStart yInterval nyGrid a11 a12 a21 a22 dx dy deltaX deltaY deltaX deltaY ... ...Here,
xStart, yStart
are coordinates of the lower left point of the grid
xInterval, yInterval
are the spacing between grid points in X
and Y
nxGrid, nyGrid
are the number of grid points in X and Y
a11, a12, a21, a22, dx, dy
specify a forward linear transform in the
usual way, i.e.
x' = a11 * (x - xci) + a12 * (y - yci) + xco y' = a21 * (x - xci) + a22 * (y - yci) + ycowhere
(x, y)
and (x', y')
are positions in the input and
output images, and (xci, yci)
and (xco, yco)
are the
centers of the input and output images. Finally,
deltaX, deltaY
are the displacement vectors at the grid points,
in order by increasing X for one Y, then by increasing Y.
There may be variable numbers of entries per line (up to 50), but vectors at a new Y
value should start a new line.
The vectors and positions describe an inverse transform: a point at a grid position in a transformed image corresponds to that position plus its displacement vector in the original image.
For a warping file with control points, each transformation has the following lines after the header:
nControl a11 a12 a21 a22 dx dy xControl yControl deltaX deltaY xControl yControl deltaX deltaY ...where
nControl
is the number of control points, which can be zero,
a11, a12, a21, a22, dx, dy
specify a forward linear transform as
above,
xControl, yControl
are the coordinates of one control point in
the warped image
deltaX, deltaY
is the displacement vector at that point, which
is added to the control point position to get the corresponding position in
the original image.
Version 2 files could contain multiple grids of displacements, which are assumed to be inverse transforms, and no linear transforms. Its form was:
2 nx ny nz binning pixelSize xStart xInterval nxGrid yStart yInterval nyGrid deltaX deltaY deltaX deltaY ... ... xStart xInterval nxGrid yStart yInterval nyGrid deltaX deltaY deltaX deltaY ... ...Here one grid follows another, starting with a line specifying the parameters for that grid
Version 1 files contained only a single grid of displacements, again assumed to be an inverse transform, and no linear transformations. Its form was:
1 nx ny binning pixelSize xStart xInterval nxGrid yStart yInterval nyGrid deltaX deltaY deltaX deltaY ...