-

1994

nature.berkeley.edu/~gvrdolja/thesis.html

Last accessed: 2005/09/10


[13]

Wikipedia
-

Convolution

en.wikipedia.org/wiki/Convolution

Last accessed: 2005/09/10


[14]

Simulation of atom
ic force and microscope tip
-
sample/sample
-
tip reconstruction.

Peter Markiewicz and M.Cynthia Goh (2005)


[15]
MIDAS Deconvolution Software

Software used to perform convolution and confidence
-
based deconvolution of
surfaces. Similar to this application, bu
t lacks analysis tools or 3D display.

www.weizmann.ac.il/Chemical_Research_Support/surflab/peter/wheres98/index.html

Last a
ccessed
: 2005/Aug/30


[16]
Deconvo


Deconvolution program.

Attempts deconvolution and generates certainty maps of surface and tip in
teraction.

Extensible Visualizer For Atomic Force Microscopy


47

www.siliconmdt.com/freeware/deconvo.htm

Last a
ccessed
: 2005/Aug/30


[17]
Scanning Probe Image Processor, SPIP

Modular Nano
-
scale image processing tool

www.imagemet.com/index.php?main=products

Last a
ccessed
: 2005/Aug/30


[18]

Statscan

Height cali
bration program for SPM. Features 2D visualisation.

www.siliconmdt.com/freeware/statscan.htm

Last a
ccessed
: 2005/Aug/30


[19]
WSxM Scanning Probe Microscopy Software

Free software for dataset visualisation. Also includes microscope control.

www.nanotec.es/
genprog.htm

Last a
ccessed
: 2005/Aug/30


[20]
3D Surface View Software

3D visualisation and analysis tool

www.msmacrosystem.nl/

Last a
ccessed
: 2005/Aug/30


[21]

OpenGL Home Page

Cross platform 3D Graphics API

www.opengl.org/

Last a
ccessed
: 2005/Aug/30


[22]

DirectX SDK

High performance hardware interface API.

msdn.microsoft.com/directx/sdk/

Last a
ccessed
: 2005/Aug/30


[23]

NVidia
-

Pixel Shaders

Extensible Visualizer For Atomic Force Microscopy


48

www.nvidia.com/object/feature_pixelshader.html

Last a
ccessed
: 2005/Aug/30


[
24
]

Java3D
-

Libraries root page

Start
ed by Sin Microsystems, a community developed native 3D API for Java.

j3d
-
core.dev.java.net/

Last a
ccessed
: 2005/Aug/30


[25]

Mathworks


Makers of MATLAB

www.mathworks.com/

Last a
ccessed
: 2005/May/05


[26]

VRML 97 Specification

tecfa.unige.ch/guides/vrml/
vrml97/spec/

Last a
ccessed
: 2005/Aug/30


[27]

C# Language Specification

msdn.microsoft.com/vcsharp/programming/language/default.aspx

Last a
ccessed
: 2005/Aug/30


[28]

The Mono Project


Home Page

Sponsored by Novell. An open
-
source project to allow .NET app
lications to run on a
variety of non
-
Windows systems.

www.mono
-
project.com/FAQ:_General

Last a
ccessed
: 2005/Aug/30


[29]

Java

java.sun.com/

Last a
ccessed
: 2005/May/06


[30]

Borland Delphi

www.borland.com/us/products/delphi/index.html

Last a
ccessed
: 2005/A
ug/30


Extensible Visualizer For Atomic Force Microscopy


49

[31]

Wikipedia


Radiosity

en.wikipedia.org/wiki/Radiosity

Last a
ccessed
: 2005/Sept/10


[32]
NCSA HDF home page

hdf.ncsa.uiuc.edu

Last a
ccessed
: 2005/Sept/10


[33]

Colin Fahey’s OpenGL Wrapper for C#

Public Domain OpenGL Wrapper for C#

www.colinfahe
y.com/opengl/csharp.htm

Last a
ccessed
: 2005/Sept/10


[34]

Everything2



GL4Java

Java wrapper for OpenGL by
Jausoft
.

www.everything2.com/index.pl?node_id=1293404

Last a
ccessed
: 2005/Sept/10


[35]

Lennard
-
Jones Potential

polymer.bu.edu/Wasser/robert/work/nod
e8.html

Last a
ccessed
: 2005/Sept/10


Bibliography


Papers

The Equivalence of Perpendicular Magnetic Recording and Magnetic Force
Microscopy

C. D. Wright, E. W. Hill and R. Vlutters (1997)


Reciprocity in magnetic force microscopy.

C.D. Wright and E. W. Hil
l (1995)


Extensible Visualizer For Atomic Force Microscopy


50

AFM tip calibration using nanometer
-
sized structures induced by ion bean sputtering

Frank Frost, Dietmar Hirsch, Axel Shcindler and Bernd Rauschenback (2001)


Determination of the AFM tip
-
shape with well
-
known sharp
-
edged calibration
structures:
actual state and measuring results.

U. Hübner, W. Morgenroth, H.G Meyer, Th.
Sulzback, B.Brendel, W. Mirandé


Polystyrene spheres on mica substrates: AFM calibration, tip parameters and scan
artefacts.

M. Van Cleef, S. A. Holt, G.S. Watson and S. Myhra (19
95)


Scanning Probe Microscopy

Description of STM and AFM and tip quality at the atomic level.

www.chem.qmw.ac.uk/surfaces/scc/scat7_6.htm

Last a
ccessed
: 2005/July/15


Scanning Probe Microscopy

SPM imagery and surface visualisation.

www.eng.yale.edu/reedla
b/research/spm/spm.html

Last a
ccessed
: 2005/Aug/30


CNRS
-

IRC, Theory/Scanning Probe Microscopies (STM/AFM) Service:

Mostly about STM, but shows SPM tool structure and an image resembling the
envisaged form of the 3D output window of this program.

catalys
e.univ
-
lyon1.fr/websmcp/english/0theoriechamproche.html

Last a
ccessed
: 2005/April/27


Scanning Probe Microscopy (SPM)

“Imaging Surfaces on a Fine Scale”.
Extensive site on applications, sample types,
techniques and calibration.

www.mobot.org/jwcross/spm/

L
ast a
ccessed
: 2005/Aug/30



Extensible Visualizer For Atomic Force Microscopy


51

Deconvolution

A large selection of references on surface reconstruction and tip
-
reconstruction
methods in AFM. Includes an interesting opinion on removing tip effects.

www.mobot.org/jwcross/spm/Deconvolution.htm

Last a
ccessed
:
2005/July/05


Veeco NanoTheatre
-

Polymer

Gallery of images produced from AFM

www.veeco.com/nanotheatre/nano_view.asp?nano=8&Submit=GO

Last a
ccessed
: 2005/May/05


Extensible Visualizer For Atomic Force Microscopy


52

Licensing and
C
opyright

All third party libraries used in this program are authorised. Their

licences are shown
below:



NCSA HDF Software Library

[1, 32]

Portions of the code in the SDS extractor, HDF2SDS are based on code from the
NCSA Hierarchical Data Format (HDF) Software Library.

Use of the source code is unrestricted as long as this copyri
ght message remains intact.

NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities

Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the Board of

Trustees of the University of Illinois. All rights reserved.

[
NCSA HDF
]


Fahey’s C#
OpenGL wrapper

[33]

“I am the sole creator of the six C# OpenGL wrapper files featured in the ZIP file. As
the creator of these files, I declare their contents to be entirely in the public domain.
Being in the public domain means that there is no restricti
on on the use of the
information. It is as if the information appeared spontaneously, without an author. I
put my name in the text of the files only as a casual promotion of my work; you are
free to remove my name.”
Colin P. Fahey

Extensible Visualizer For Atomic Force Microscopy


53

Appendix

User
G
uide
s

Use
r Guide 1
-

Applying
A

Filter And U
sing
Tools To Analyse T
he
O
utput.


This guide will form a generic walkthrough explaining how to apply filter to a surface,
and then how to use tools to gain information from the output dataset. For this
example the DCT

fi
lter will be used to show the

process, but by selecting a different
filter, the same steps can be followed to analyse the output from other filters.

The initial form of the application looks like this:



Figure
10
. Initial applica
tion window.


The application is divided into input and output areas, so the original and modified
surface can be compared.

First, click the input image to load your perfect surface to be filtered. This data will be
a vertical displacement map.

Extensible Visualizer For Atomic Force Microscopy


54

This surfac
e may be stored in a form directly output from a microscope such as HDF
(Hierarchical Data Format) or an SDS table, or it may be in one of eight different
kinds of standard image format (including Windows Bitmap, JPEG and GIF), images
where the highest int
ensity colours are mapped to the highest features of the surface.

Once a surface has been selected, one must choose a filter to apply to it. In this case
we shall choose the DCT filter, an approximation of the per
-
atom LJ
-
Potential, but
any of the installe
d filters could be chosen.

Clicking the run filter at this point would prompt the user to select a tip, as this is
required to calculate the distortion on the original surface. Clicking on the
"Properties" button, we may bring up the properties window for
the current filter.
Here is the properties window for the DCT filter:



Figure
11
. DCT tip selection window.


This DCT properties window allows the user to select the tip they wish to use. The tip
is a displacement map, just as th
e surface, so a user may select from HDF, SDS tables
or the image formats mentioned before to choose a tip shape. On
c
e a tip has been
chosen, this can be applied and the filter can be run. The progress bar indicates the
filter's progress.


Extensible Visualizer For Atomic Force Microscopy


55


Figure
12
. DCT filter processing in progress.


Once the filter has finished processing, the distorted image is shown as below.



Figure
13
. DCT filtered image output.

Extensible Visualizer For Atomic Force Microscopy


56


Clicking a checkbox next to a tool makes it visible
. Users can select which tools they
desire and apply them to the output surface. Users can add more tools to this box,
including ones

they have developed themselves.

S
ee the user guide below on how to
create a custom tool.

This window shows an output surfa
ce with five tools applied to it. Tools create a
visual effect on the output surface, and can be used to return information from the
dataset. The currently selected tool is the "Probe" tool, and the information it has
gathered is shown in the info pane to
the right of the output surface.



Figure
14
. Selection of tools being used on convoluted image.


Two of these tools are text tools, which do not return data, but allow a user to
annotate their output with useful comments. Each te
xt tool has a properties window,
accessible through the "tool properties" button which allows a user to change the font,
size and colour of that label. This properties window is shown below.


Extensible Visualizer For Atomic Force Microscopy


57


Figure
15
. ToolText's
text properties

window.


At any point after the filter has been used, the researcher may choose to see a 3D
representation of the surface by opening the 3D window. The surface within the
window can be rotated with the mouse or be rotated at a slow speed automatically

by
clicking a menu option
.


Although the usual object displayed with this window is a false colour representation
of the convoluted surface, any 3D object can be rendered here. The filter is
responsible for generating the 3D structure to be displayed, but the
re is a common
function to generate a 3D false colour topology if needed.


Extensible Visualizer For Atomic Force Microscopy


58



Figure
16
. 3D surface without tools.


Extensible Visualizer For Atomic Force Microscopy


59

The use of tools is reflected within the 3D window also, shown here in
F
igure 1
7
, is
the 3D output of the “Probe”
and “Rectangle” tools.



Figure
17
. 3D surface
with tools.



Extensible Visualizer For Atomic Force Microscopy


60

User Guide 2
-

Using the Lennard
-
Jones Potential Filter


Atoms weakly attract each other at high distances, But as the distance between the
atoms is made smaller, the a
toms will eventually repel each other.

The Lennard
-
Jones equation takes two parameters
:
Epsilon
, the well

depth en
ergy and
S
igma, the hard sphere radius

of the surface atoms
.

The well depth energy of a
material is the highest attractive force that can exis
t between two atoms when they are
brought closer together. This point is shown by
the
“well”
in
Figure

1
8
,
where
the
highest attractive force

can be seen
.



Figure
18
. Graph of Lennard
-
Jones Potential

function


When using the per
-
atom LJ Potential filter, one may view the properties window by
clicking the “properties” button when this filter is selected. Within this window, one
may choose appropriate values of epsilon and sigma,
as well as real world sample
measurements, which are
used to calculate atom density.


Extensible Visualizer For Atomic Force Microscopy


61


Figure
19
. Properties box of Lennard Jones Potential

filter.


These values are used within the
Lennard
-
Jones potential convolution to give an
accurate simulation of the output from an AFM with the

tip and surface you have
chosen.

Extensible Visualizer For Atomic Force Microscopy


62

User Guide 3
-

Creating a
User
-
D
efined
F
ilter.


This user guide will walk you through the process of creating a simple blurring filter.
There are a variety of filters already available in the application, so one may use t
hese
as a base when implementing a new filter.

Filters need only implement the mandatory functions, getName() and apply(Surface
input). getName() returns a string containing the name of the filter, and apply(Surface
input) takes a surface and returns the d
istorted surface.

The optional functions canRun(), getWhyCannotRun() and showProperties() may be
overridden a
s

a
filter may require extra data to complete its operation. For example,
the per
-
atom L
ennard
-
J
ones

Potential convolution filter requires a tip sh
ape as well as
the values of epsilon (well energy) and sigma

(inter
-
atomic distance). If these values
are not present, the filter cannot run.


canRun()

Allows filter to inform the application whether it has all the data required to run the
filter. Returnin
g false will stop the filter from being run.


getWhyCannotRun()

Returns a string explaining to the user why a filter cannot run. Such an example might
be "You must choose a tip to be used on this surface."


showProperties()

Generates a properties window

wh
ere users may specify extra data that is needed by
the filter to perform its operation, such as a tip shape or values used in the L
ennard
-
J
ones

Potential calculation. A filter object is responsible

for generating its own
properties

window.



The apply func
tion may be implemented in any way the user sees fit, the only
requirement is that it must return a Surface, but this need not be the same size or even
related to the input surface.

Extensible Visualizer For Atomic Force Microscopy


63

Two helper
functions have been provided for common operations needed when
generating an output surface for the filter:

Surface.recalculateBitmapFromSurfaceArray()

The surface object stores
a

bitmap
image of the surface. This function generates a
refreshed image from the
data table
. This disconnection allows false colour surfaces

without changing the underlying data.


Surface.generate3DDataFromSurfaceArray()

The surface object can store a 3D model, this is usually a 3D representation of the
surface data, but doesn't have to be. It is rendered in the 3D window.
A filter may
specify

any kind of 3D data to be output, and does need to use this function. The 3D
data is stored as standard OpenGL vertex arrays (face, vertex, normal, material), so
any model can be generated from them. This function is just for convenience when a
3D terrain
-
like model is wanted in the 3D window.


The completed class:


public class FilterSimpleBlur:Filter

{


public override String getName(){return "Simple 5
-
Pixel Blur";}


public override Surface apply(Surface input)


{



Surface output = new
Surface(input.wid
th(),input.height());




int x,y;



for (y=1;y<input.height()
-
1;y++){




for (x=1;x<input.width()
-
1;x++)

{





output.surfaceArray[x,y]=






(







input.surfaceArray[x,y
-
1]+







input.surfaceArray[x
-
1,y]+







input.surfaceArray[x,y]+







inp
ut.surfaceArray[x+1,y]+







input.surfaceArray[x,y+1]






) / 5.0;




}

Extensible Visualizer For Atomic Force Microscopy


64



}



output.recalculateBitmapFromSurfaceArray();



output.generate3DDataFromSurfaceArray();



return output;


}

}



Once the filter has been implemented
, add a line to reference it

in the FManager class,
and the application will add it to the list of filters.


Filter[] filterArray = new Filter[] {


new FilterNoChange(),


new FilterPerAtomLJ(),


new FilterVerticalFlip(),


new FilterSimpleBlur() //Your new filter!

};



Extensible Visualizer For Atomic Force Microscopy


65

User Guide 4
-

Creating a
U
ser
-
D
efined
T
ool.


This user guide will lead you through the process of creating a custom tool.


All tools inherit from the Tool class
;

this ensures that a
n

identical

interface can be
maintained with all tools. All tools must implement the fol
lowing functions:


getName()

Returns a string containing the name of the tool.


applyGraphic(Image image)

Takes the current output surface image, and returns the same image with an overlay of
visual feedback from the tool. For example, this function of Too
lProbe returns the
original surface image, with a red cross superimposed on the selected location.


getInfo()

This function returns a string of human
-
readable information that the tool has
gathered. In ToolRectangle this contains information such as the av
erage value in the
rectangle or the location of the top
-
left point. If the tool
does not implement this
function,
then
the base class’s function is used and an
empty string

is returned
.


If the developer wishes, the following functions can be overridden fo
r additional
functionality:


mouseUp()

Receive a notification when mouse button released.


mouseDown()

Receive a notification when mouse button pressed.


mouseMove()

Receive a notification when mouse position changes. In combination with mouseUp
and mouseD
own, this can be used to create click and drag functionality.

Extensible Visualizer For Atomic Force Microscopy


66


click()

This is a simple notification of a click.


showProperties()

This allows a tool to get information from the user. For example, the text tool's font,
colour and content can be set though
a properties window.


In the ToolProbe class below, the local recalc3DModel() function is called to generate
a 3D model that will be rendered in the 3D window. The 3D data is stored in the
tool3D object, containing structures used by OpenGL to draw a 3D ob
ject.



The completed class:


public class ToolProbe : Tool {



public ToolProbe() {


}



int ellipseRadius=6;



public override String getInfo(){


return "Coordinates: "+

(new Point(xPos,yPos).ToString())+




"
\
nEllipse radius: "+

ellipseRadius.ToString()
+




"
\
nProbe value: "+

surface.surfaceArray[xPos,yPos]+

"
\
nProbe value scaled to 0.0
-
1.0:
"+surface.surfaceArrayScaled[xPos,yPos]+

"
\
nFalse color value at probe: "+

surface.getBitmap().GetPixel(xPos,yPos).ToString();


}


public override System.Drawing.Ima
ge
applyGraphic(System.Drawing.Image imgOriginal) {

Extensible Visualizer For Atomic Force Microscopy


67




Bitmap imgNew = new Bitmap(imgOriginal);




Graphics graphicImage = Graphics.FromImage( imgNew );




graphicImage.SmoothingMode = SmoothingMode.AntiAlias;




Pen probePen=new Pen(Color.Red);




graphic
Image.DrawEllipse(

probePen,

new Rectangle(

xPos
-
ellipseRadius,

yPos
-
ellipseRadius,

ellipseRadius*2,

ellipseRadius*2

)

);




Point a1 = new Point(xPos, yPos+ellipseRadius*2);



Point a2 = new Point(xPos, yPos
-
ellipseRadius*2);



Point b1 = new Point(xPos
+ellipseRadius*2, yPos);



Point b2 = new Point(xPos
-
ellipseRadius*2, yPos);




graphicImage.DrawLine(probePen, a1, a2);



graphicImage.DrawLine(probePen, b1, b2);




return imgNew;


}



public override string getName() {



return "Probe Tool (+3D)";


}



int xPos=0;


int yPos=0;



bool isMouseDown=false;


public override void mouseUp(object sender,
System.Windows.Forms.MouseEventArgs e){isMouseDown=false;}

Extensible Visualizer For Atomic Force Microscopy


68


public override void mouseDown(object sender,
System.Windows.Forms.MouseEventArgs e){isMouseDown=tru
e;}


public override void mouseMove(object sender,
System.Windows.Forms.MouseEventArgs e){

if (isMouseDown){




xPos=e.X;




yPos=e.Y;




if (xPos<0) xPos=0;




if (xPos>255) xPos=255;




if (yPos<0) yPos=0;




if (yPos>255) yPos=255;




recalc3DModel();



}


}



void recalc3DModel(){



tool3D.primitiveType=WGLAV5.GL.GL_LINES;




//Scale to
-
1 / 1



double xPosScaled=((xPos/255.0)*2)
-
1;



double yPosScaled=((yPos/255.0)*2)
-
1;



double zPosScaled=

(surface.surfaceArrayScaled[xPos,yPos]*2)
-
1;




double probe
Radius=0.1;




tool3D.dVertexFlat=new double[]{




xPosScaled+probeRadius,yPosScaled,zPosScaled,




xPosScaled
-
probeRadius,yPosScaled,zPosScaled,




xPosScaled,yPosScaled+probeRadius,zPosScaled,




xPosScaled,yPosScaled
-
probeRadius,zPosScaled,




xPosScale
d,yPosScaled,zPosScaled+probeRadius,




xPosScaled,yPosScaled,zPosScaled
-
probeRadius



};




tool3D.dNormalFlat=new double[]{









0,0,
-
1.0,









0,0,
-
1.0,









0,0,
-
1.0,

Extensible Visualizer For Atomic Force Microscopy


69









0,0,
-
1.0,









0,0,
-
1.0,









0,0,
-
1.0,



};




tool3D.dVertex
ColorFlat=new double[]{











1.0,0,0,1.0, //rgba









1.0,0,0,1.0,









1.0,0,0,1.0,









1.0,0,0,1.0,









1.0,0,0,1.0,









1.0,0,0,1.0



};




tool3D.iFaceIndexFlat=new int[]{0,1,2,3,4,5}; //lines


}

}


Once the tool has been impleme
nted, add a line to reference it in the TManager class,
and the
new tool will appear in the list of
available tools

when the application starts
.
As seen with ToolText, reference the new tool multiple times if you want to be able to
use many
instances of th
at tool
on the output surface.


Tool[] toolArray = new Tool[] {


new ToolText(),


new ToolText(),


new ToolText(),


new ToolScanLineBox(),


new ToolRectangle(),


new ToolProbe() // Your new tool!

};