AFMSim Module
Table of Contents
- Introduction
- Image Formation Model
- Tip Model
- Simulator Settings
- Surface Visualization
- Processing Simulated Scans
- Publications Resulting from AFMSim
Introduction
The AFMSim module provides a method to compute simulated scans from an atomic force microscope (AFM). Using this module, you can see how a set of model objects will appear in an AFM scan with a given tip model. This section of the manual describes the features and capabilities of the AFMSim module.
Image Formation Model
Images from atomic force microscopes include an artifact caused by the fact that scanning tips are not infinitesimal. This effect, known as dilation, tends to broaden the appearance of scanned objects and in some cases completely obscures small-scale features near the bases of objects.
The physical dilation in AFMs is well modeled by the mathematical concept of grayscale dilation. Given a function f describing a mapping from a grid to real numbers (i.e., an image) and a structuring function b of the same form, the dilation operation ⊕ is defined as:
(f ⊕ b)(x) = max[f(y) + b(x - y)]
where y ranges over valid coordinates in the structuring function and max returns the maximum value of all candidate elements.
In the context of AFM simulation, values in both the functions f and b represent heights in z. In particular, f represents the heights of all the model objects in the simulation, and b represents the tip shape flipped 180 degrees. This structuring function represents the dilation of an infinitesimally narrow feature with height equal to the highest point on the collecton of model objects in the simulation. To be precise, this tip shape is then translated so that the top of the shape is at height zero and parts of the shape below the top have negative height.
A core operation in computing the dilation is finding the maximum value in a series of values. Graphics processing units (GPUs) have specialized hardware for computing maxima of series of values that is usually used to resolve which objects in a 3D scene are visible. As the GPU renders 3D objects into 2D images, it generates fragments that are essentially pixels with depth information regarding the distance of the fragment from the viewer. Typically, the z-buffer hardware allows the current value of the pixel to be overwritten by another value only if the incoming fragment is closer to the viewer than the current pixel. AFMSim makes use of this hardware during grayscale dilation, allowing fast generation of simulated images.
Tip Model
Currently, two idealized tip models are available in AFMSim. Loading images of tip shapes created in external programs is not currently supported, but will be available in a future version.
Sphere Tip Model

Sphere tip model.
The first tip model is that of a simple hemispherical cap at the end
of a cylindrical shaft. The image to the right shows an example of the
sphere tip model.
Cone-Sphere Tip Model

Cone-Sphere tip model.
The second tip model is of a spherical cap at the end of a conical
base that is more representative of an actual AFM tip. An example of
the cone-sphere tip model is shown to the right.
Tip Model Controls

Tip control panel.
There are three settings controlling the tip shape. The radius
controls the radius of the spherical end cap on both the sphere and
the cone-sphere tip models. The checkbox labeled Use Cone-Sphere
Model controls whether the Cone-Sphere model is used; by default
this is the tip model that is enabled. The Cone Angle
controls the half-angle of the cone in the Cone-Sphere tip model.
Simulator Settings

Simulator settings.
Simulator settings control aspects of simulated image
creation. Currently, the only user-controllable setting is the pixel
resolution of the height image the rendered model objects. Higher
resolutions produce more accurate simulations at the cost of increased
computation and memory to store the results.
Surface Visualization

Simulated AFM surface visualization settings.
The surface visualization controls modify the way the simulated AFM
surface scan is displayed in the Model Object View Panel. The first
option controls whether the ground plane, which represents the
substrate on which specimens are mounted, is displayed. If this
checkbox is not selected, then only parts of the AFM scan rising above
the ground plane will be displayed.
The Wireframe checkbox controls whether the surface is displayed as a wireframe representation or solid surface. The Opacity control determines how opaque the scan surface should be when displayed as a solid surface: 1.0 causes the surface to be complete opaque while 0.0 causes it to be completely transparent.
The popup menu labeled Compare scan to: lists model objects in the scene to which the scanned surface could potentially be compared. This experimental feature is meant for situations where it is desirable to visually compare an imported experimental scan to a simulated scan. It uses a visualization technique for comparing nested surfaces, but a substantial amount of time is required to initialize the visualization. The comparison works best when the resolution of the simulated scan is very low, which unfortunately produces low-quality scans.
Processing Simulated Scans

Buttons for processing simulated scans.
There are a couple of options for processing a simulated AFM scan. The
Save Scan button allows you to save the scan as either a UNCA
or OBJ file. The Scan Statistics button opens a window
containing some information about the scan, including volume under the
scan surface, area of the simulated region, and the area represented
by a single pixel.
Publications Resulting from AFMSim
Gokul Varadhan, Warren Robinett, Dorothy Erie, and Russell M. Taylor II. Fast simulation of atomic-force-microscope imaging of atomic and polygonal surfaces using graphics hardware. Proc. SPIE, Vol. 4665, 116 (2002).