Fit Map in Map Fit Map in Map icon

Fit Map in Map optimizes the overlap of one density map with another. Density maps are a type of volume data. Local optima are found, not generally the global optimum. See also: Fit Model in Map

There are several ways to start Fit Map in Map, a tool in the Volume Data category (including from the Volume Viewer Tools menu).

After the maps have been opened (from Volume Viewer or otherwise), one should be designated as the map to fit (Fit map) and the other designated as the reference (within map). The fit map should be placed in a trial position relative to the reference, approximately the position thought to be correct or one that might be correct. Clicking Fit adjusts the position of the fit map to maximize (locally) its overlap with the reference map.

The overlap is the sum over fit map grid points of the product of the fit map value and the reference map value at that point (determined by trilinear interpolation). Use only data above contour level from first map indicates that the sum should include only fit map grid points with values above the map's lowest contour level in Volume Viewer. Otherwise, all nonzero-valued grid points will be included. The overlap can be expressed as the inner product of vectors u and v containing the fit map values and the corresponding interpolated reference map values:

overlap = <u,v>
The correlation between the two maps is
<uuave,vvave>

|uuave||vvave|
where uave is a vector with all components equal to the average of the components of u and vave is defined analogously. The correlation differs from the overlap in that an average value is first subtracted from each component, and further, the inner product of the resulting vectors is normalized by the lengths of those vectors. The correlation equals the cosine of the angle between the vectors (after subtraction of averages) and can range from –1 to 1, whereas the range of overlap values depends on the scaling of the maps. Optimizing the overlap with Fit Map in Map will not necessarily optimize the correlation.

Both rotation and translational shift displacements may occur unless disallowed by unchecking the corresponding checkbutton. The calculation will stop and the map model will be repositioned after the earliest of the following: convergence, 100 steepest-ascent steps, or when Halt is clicked. The resulting correlation, overlap, number of steps taken, and total displacement (translational shift, angle of rotation) are reported in the Fit Map in Map interface and written to the Reply Log. The transformation matrix of the fitted map is also reported in the Reply Log.

Clicking Fit again may further improve the fit, especially if convergence was not reached. Clicking Correlation reports the current correlation and overlap between the maps without performing any fitting.

Undo Move (Tools... Movement... Undo Move) can be used to return the map to its previous position.

Close closes the Fit Map in Map interface. Help opens this manual page in a browser window.

NOTES

Transformation matrices. After a fit is performed, the transformation that fits the map to the reference map is reported in the the Reply Log. The first three columns of the matrix describe a rotation and the fourth describes a translation (performed after the rotation).

Comparing fits. Because local optima rather than a global optimum are found, it is often beneficial to explore and compare different fits. This can be done by opening multiple copies of a map and fitting them from different starting positions. Fits can be compared by their overlap and correlation values. The Model Panel can be used to hide and show individual copies.

Clipping and hiding are ignored. The calculation uses the full sets of density data, even if partly hidden by clipping planes, zoning (with Surface Zone or zoning in Volume Viewer), or subregion selection in Volume Viewer.

Optimization algorithm. Optimization is by steepest ascent to maximize the overlap between the two maps. If rotation and translation are both allowed, every even step is a translation and every odd step is a rotation. The center of rotation is the geometric center of the fit map grid points used for fitting. The initial step size is chosen so that the largest displacement of a fit map point is 0.5 grid units, where a grid unit is the spacing between reference grid points. If after four steps the maximum cumulative displacement is less than half the displacement achievable if all steps were in the same direction (e.g., half of 2.0 grid units = 1 grid unit), the step size is halved. Successive rounds of four steps with fixed step size and halving the step size based on the maximum displacement criterion are repeated until step size falls below 0.01 grid unit (convergence) or 100 steps have been taken. Density gradients at fit map points are calculated using trilinear interpolation of the gradients at reference map points. Gradients at grid points are calculated by the center difference method. Fit map points outside the reference grid or within one voxel of its edge at a given step do not contribute to the optimal direction at that step.

Speed. The time taken is proportional to the number of fit map grid points. The optimization calculation is written partly in C++ for speed and partly in Python.

Self-correlation not equal to 1. The correlation of a map with itself in the same position should equal 1. However, in such cases, Fit Map in Map can report values much less than 1 because of floating-point rounding errors in grid point positions. Grid points at the boundary of a map can be found to lie outside of the map, yielding interpolated values of 0.


UCSF Computer Graphics Laboratory / December 2006