WAVIMG - TEM image calculations from wave functions

 

The purpose the program WAVIMG is to calculate image intensity distributions from electron wave functions for a given set of TEM imaging parameters. The program is controlled via a text-list parameter file and requires a complex valued wave function as input data.
The image calculation starts with the computation of an image plane wave function by applying an electron optical transfer function, which includes image aberrations up to the 8th polynomial order. Subsequently the image intensity is calculated by taking the absolute square of the image plane wave function supporting different options to include the effect of partial coherence. The final image contrast can be attenuated by applying a frequency modulated detector transfer function (MTF) and vibrational damping envelopes. An optional simulation of realistic image noise is also available.
The program is compiled for 64-bit operating systems for single-thread calculations and can be called from command-line shell or from other programs.

 

Summary of program functions:

INPUT DATA : Required input data for calculating a TEM image with the program WAVIMG is at least one or more complex-valued electron wave function provided on the form of raw binary files. Such wave functions can be calculated with the program MSA from the Dr. Probe simulation package. All required input data such as the input wave function, microscope parameters and calculation procedure options have to be provided in form of a text-list parameter file, which is described in the section PROGRAM CONTROL below.

TEM IMAGE CALCULATION : The computation of a TEM image with WAVIMG is performed in two essential steps.
In the first step, an intermediate image is calculated from the input exit-plane function by applying a coherent transfer function and contrast dampening due to partial temporal and partial spatial coherence. The coherent transfer function includes geometrical image aberrations and an objective aperture. The effect of partial coherence of the electron contrast transfer is determined by an effective focus spread and an effective semi-convergence angle and can be simulated by explicit focal and beam-tilt averaging of coherent sub images or by a much faster but less accurate quasi-coherent approximations. In these procedures, the image intensity is calculated by taking the absolute square of image plane wave functions in real space. Alternatively, the program provides also the option to calculate image intensities in Fourier space including coherent and partially coherent contrast transfer functions in a transmission-cross-coefficient, see [K. Ishizuka, Ultramicroscopy 5 (1980) 55-65].
In the second step, incoherent image aberrations are applied to the intermediate image obtained after step one to calculate the final image. These incoherent aberrations are a detector MTF and vibrational damping envelopes, also known ad image spread. Taking these to incoherent contrast reduction mechanism into account it is possible to obtain matches between experimental images and simulated images on an absolute intensity scale, e.g. in [C.L. Jia, et al., Microsc. Microanal. 19 (2013) 310-318.] and [C.L. Jia, et al., Nature Materials 13 (2014) 1044-1049.].
In addition to a straight-forward image simulation WAVIMG provides the option to export the image-plane wave function including optional attenuations of the diffracted beams by quasi-coherent and incoherent dampening envelopes.
A very powerful function of WAVIMG is the option to produce series of TEM images with a very flexible way of image parameter variation. A series of images can also be composed to a map image, such as a defocus-thickness map. Up to 5 nested parameter loops can be defined allowing different forms of parameter variations. A detailed description of the loop functionality is given in the section PROGRAM CONTROL below.

PROGRAM CONTROL : Input data, microscope parameters, and options determining the image calculation procedure of WAVIMG have to be provided in form of a parameter file. The parameter file is a text file containing a list of program parameters in a fix sequence. The table given below describes the structure of the parameter file and provides a short description for each parameter. The parameter file is a mandatory parameter for calling the wavimg.exe application.

The WAVIMG parameter file format

Line

Parameters

Description (Version 0.55+)

01

<string>

File name of the input wave function
Example: 'wav\exit-wave.dat'

02

<number>, <number>

Number of columns and rows (samples) of the input wave function [pixels]
Example: 192, 256

03

<float>, <float>

Physical row and column sampling rate of the input wave function [nm/pixel],
Example: 0.003878, 0.003727

04

<float>

Primary electron energy [keV],
Example: 300.0

05

<number>

Switch option for the type of output:

  • 0 = TEM image
  • 1 = complex image plane wave function
  • 2 = complex image plane wave amplitude
  • 3 = complex image plane wave phase
  • 4 = complex image plane wave real part
  • 5 = complex image plane wave imaginary part
  • 6 = TEM image map composed of a 2D parameter variation

Example: 0

06

<string>

File name of the output image or wave function data
Example: 'img\TEM-image.dat'

07

<number>, <number>

Number of columns and rows (samples) of the output image [pixels]
Example: 64, 72

08

<number>, <float>, <float>, <float>

Image data type, image vacuum mean intensity [counts], conversion rate [counts/e-], readout noise rms amplitude [counts]
Image data types: 0 = 32-bit float, 1 = 32-bit integer, 2 = 16-bit integer
Example (default simulation): 0, 1.0, 1.0, 0.0
Example (simulation with noise): 1, 3451.2, 5.1, 3.0

09

<number>

Switch option SF to extract a particular image frame (SF = 0: OFF, SF = 1: ON)
The parameters defined in lines 10 - 12 are ignored when the frame extraction is switched off here.
Example: 1

10

<float>

Image sampling rate [nm/pixel] (only if SF = 1)
Example: 0.008973

11

<float>, <float>

Image frame offset in pixels of the input wave functions (only if SF = 1)
e.g. 13.4, 16.2

12

<float>

Image frame rotation with respect to the input wave horizontal axis [deg] (only if SF = 1)
Example: 0.0

13

<number>

Switch option for selecting the model for the simulation of partial coherence in the image formation.

Switch

Coherence model

1

explicit focal averaging and quasi-coherent beam-convergence envelope in real space
(non-linear, CS-corrected TEM only, quick)

2

explicit focal and angular averaging in real space
(non-linear, all TEM, time-consuming)

3

quasi-coherent linear image formation in Fourier space
(linear, for weak phase objects only, quick)

4

full partially coherent TCC synthesis in Fourier space
(non-linear, all TEM, time-consuming)

5

explicit focal, angular, and frozen-lattice averaging in real space
(non-linear, no approximation, time-consuming, requires a set of wave functions from different frozen lattice variants)

Example: 1

14

<number>, <float>

Partial temporal coherence switch and focus-spread (1/e-half width) [nm]
Set the switch = 0 to deactivate and = 1 to activate the simulation of partial temporal coherence
Example: 1, 3.8

15

<number>, <float>

Partial spatial coherence switch and semi-convergence angle (1/e-half width) [mrad]
Set the switch = 0 to deactivate and = 1 to activate the simulation of partial spatial coherence
Example: 1, 0.4

16

<number>, <float>, <string>

Switch option, k-space scaling, and file name for the simulation of a frequency modulated detector transfer function (MTF)
Set the switch = 0 to deactivate and = 1 to activate the MTF simulation.
The k-space scaling should be equal to the ratio of sampling rates of experiment and simulation (sexp:ssim).
Example: 1, 1.0, 'C:\data\CCD-MTF-300kV.dat'

17

<number>, <float>, <float>, <float>

Switch option, and rms amplitudes [nm, nm, deg] of the effective image spread.
Set the switch = 0 to deactivate or = 1 or = 2 to activate the simulation of an image spread envelope.
Switch = 1 assumes an isotropic image spread defined by one rms amplitude.
Switch = 2 assumes an anisotropic image spread defined by two perpendicular major rms amplitudes and an azimuth orientation angle. The orientation determines the direction of the first major vibration axis with respect to the horizontal image axis.
Example: 1, 0.016

18

<number>

Number Nabr of image aberrations set below
You have to provide exactly this number of aberration definitions in the following lines.
Example: 2

18+

<number>, <float>, <float>

Aberration definition by an index number and two coefficient values given in [nm] for all aberrations
Example (5.8 nm defocus): 1 5.8 0.0
Example (4.7 mum star aberration at 30 deg): 6 4070. 2350..

The index number (0 ... 23) identifies the aberration type and the two values are the x and y component (or the real and imaginary part) of the aberration coefficient in nanometers. The aberrations are identified by index according to the following list:

Index

Aberration

0

Image shift (a11, C0,1, A0)

1

Defocus (a20, C1,0, C1)

2

Twofold astigmatism (a22, C1,2, A1)

3

Coma (a31, C2,1, 3·B2)

4

Threefold astigmatism (a33, C2,3, A2)

5

Spherical aberration (a40, C3,0, C3)

6

Star aberration (a42, C3,2, 4·S3)

7

Fourfold astigmatism (a44, C3,4, A3)

8

Coma (5th order) (a51, C4,1, 5·B4)

9

Three-lobe aberration (a53, C4,3, 5·D4)

10

Fivefold astigmatism (a55, C4,5, A4)

11

Spherical aberration (6th order) (a60, C5,0, C5)

12

Star aberration (6th order) (a62, C5,2, 6·S5)

13

Rosette aberration (a64, C5,4, 6·R5)

14

Sixfold astigmatism (a66, C5,6, A5)

...

  (further in the power-law series)  

23

Eightfold astigmatism (a88, C7,8, A7)

Nabr aberration definitions are expected following line 18. The default aberration coefficient values are all zero. For the default case, where you simulate an image without aberrations, you can set Nabr = 0 and leave out all aberration definitions.

Note that depending on the number of aberration definitions Nabr specified above, the content below the aberration definitions moves a respective number of lines downwards in the parameter file. This is denoted below by adding Nabr to the line numbers following.

19+Nabr

<float>

Objective aperture radius [mrad]
Example: 250.0

20+Nabr

<float>, <float>

Center of the objective aperture with respect to the zero beam [mrad, mrad]
Example: 0.0, 0.0

21+Nabr

<number>

Number of parameter loops Nlp defined below.
At least Nlp loop definitions have to follow this line. Since each loop definition itself requires 5 lines, we restrict the description here to 1 loop definition. When more than one loop is defined, the first loop definition in the parameter file will be the innermost loop of a nested loop calculation.
As the parameter file ends after the loop definitions, you may simply switch off all parameter loops by setting Nlp = 0.
Example: 1

22+Nabr

<number>

Loop parameter class Lc.

  • 1 = coherent aberration
  • 2 = incoherent aberration
  • 3 = input wave function file

Example: 1

23+Nabr

<number>

Loop parameter index Lp
Example (defocus): 1

24+Nabr

<number>

Loop variation form Lf

  • 1 = linear ramp
  • 2 = cosine oscillation
  • 3 = list directed aberration parameters

Example: 1

25+Nabr

<float>, <float>, <number>

Loop range (Lr0, Lr1, Lrn)

  • Lf = 1: Lr0 = min., Lr1 = max., Lrn = number of samples
  • Lf = 2: Lr0 = amplitude, Lr1 = frequency, Lrn = number of samples
  • Lf = 3: ignored, parameter values are taken from file

Example: 0.0, 10.0, 21

26+Nabr

<string>

Loop string identifier Ls

This string is used very flexible depending on the loop class and form:

  • Lc = 3: The string Ls specifies the exact substring preceding the index substring in a loop over input wave function file names.
    For example set Ls = '_sl' to address the wave function files of a thickness series as produced by the program MSA such as 'wave_sl001.dat', 'wave_sl002.dat', 'wave_sl003.dat', etc.
  • Lf = 3: The string Ls specifies the exact file name describing a list directed parameter variation.

Example: '_sl'

In line (16) of the WAVIMG parameter file you specify a detector MTF by a file name. The MTF file is a text list of values describing the frequency dependent amplitude modulation of the image contrast in a radially symmetric form. The MTF data is assumed to be given without the attenuation due to pixel binning. Note the MTF may be different for each detector and can vary significantly with the electron energy. If possible the MTF should be measured with a knife edge or similar method. The measured MTF of a Gatan UltraScan 1000 with 2k x 2k pixels for 300 keV electrons is provided here by as an example [Download MTF]. The format of the MTF text file is described in the table below.

The MTF file format

Line

Parameters

Description (Version 0.55+)

01

<number>

Number of MTF data NMTF = N/2+1, where N is the number of CCD pixels along one dimension
Example (2k x 2k CCD): 1025

02

<float>

MTF(k=0)
Example: 1.00

03

<float>

MTF(k=1/N)
Example: 0.983

...

<float>

NMTF+1

<float>

MTF(k=1/2)
Example: 0.0434

The list directed aberration parameter loop form (Lf=3) allows you to apply a completely flexible form of multiple parameter variation. This form of parameter variation requires an additional input file, which specifies a list of aberration vectors to be applied with each step of the respecive WAVIMG parameter loop. Aberration vectors specified in the file are added to the current aberration vector starting from the input made in the WAVIMG parameter file and via the command-line arguments. Multiple list directed parameter variations are thus added up in each step of the loop. The format of the parameter variation list is described in the table below.

The aberration parameter variation list format

Line

Parameters

Description (Version 0.55+)

01

<number>

Number LN of aberration vectors in the list
Example: 10

02

<number>

Number LNP of aberrations in each aberration vector.
Example: 2

03

LNP × <number>

List of aberration indices in each vector. See line (18+) of the description of the WAVIMG parameter file format above for a list of aberration indices.
Example (defocus and spherical aberration): 1 5

4+

2 LNP × <float>

Aberration coefficients [nm], 2 for each aberration of the vector.
Example (+4nm defocus, -8mum CS): 4.0 0.0 -8000.0 0.0
Example (+5nm defocus, -12mum CS): 5.0 0.0 -12000.0 0.0

 

PROGRAM CALLING : The program WAVIMG can be run from the Windows OS command console cmd.exe or from other programs by executing wavimg.exe. The program requires at least one command-line argument when called, which specifies a program parameter file. The following table lists all command-line options of WAVIMG version 0.55+ and provides short descriptions of their meaning.

Option

Description (Version 0.55+)

-prm <file name>

Specifies the input parameter file. Enclose the file name string using quotation marks if the file name contains space characters.
Example: -prm 'prm\wavimg.prm'

-out <file name>

(OPTIONAL) Specifies the name of the output file which will store either the resulting TEM image or image wave function in raw binary form. Enclose the file name string using quotation marks if the file name or the disk path contains space characters. Suffixes may be added automatically by WAVIMG if parameter variation loops are applied.
Example: -out 'img\TEM-image.dat'

-foc <defocus [nm]>

(OPTIONAL) Overrides the image defocus parameter (nm) set in the parameter file and uses the new defocus value instead.
Example: -foc -2.6

-btx <beam tilt x [mrad]>

(OPTIONAL) X component of an additional beam tilt applied to the incident wave function in milliradians. Using this option overrides the respective value specified in the parameter file.
Example: -btx 3.5

-bty <beam tilt y [mrad]>

(OPTIONAL) Y component of an additional beam tilt applied to the incident wave function in milliradians. Using this option overrides the respective value specified in the parameter file.
Example: -bty -2.5

-oar <aperture radius [mrad]>

(OPTIONAL) radius of the objective aperture in milliradians. Using this option overrides the respective value specified in the parameter file.
Example: -oar 50.0

/sil

(OPTIONAL) Silent mode, minimize textual output during the calculation.

/nli

(OPTIONAL) Deactivate the output of intermediate images during parameter variation loops. Useful for calculation of parameter variation maps.

/dbg

(OPTIONAL) Show extra textual debug output during the calculation.

 

OUTPUT DATA : The output of WAVIMG is a list or a single file containing binary raw image or wave function data. Images are stored as arrays of 32-bit float, 32-bit integer, or 16-bit integer values depending on the setting in line (08) of the WAVIMG parameter file. Full image wave functions are stored as 64-bit complex data arrays, and components of the wave data, such as amplitude or phase are stored as 32-bit data arrays.
When a list of files is created with the parameter variation loop function of WAVIMG, the specified output file name is extended by a name suffix substring of the form '_###' for each loop, where ### is the loop index in form of a three digit number with leading zeroes. In case of multiple nested loops, the indices of the loops are added in reverse order to the image file name, such that the index of the first (innermost) loop appears at the end of the file name.

 

Examples

Simple program call with parameter file:
wavimg -prm prm\wavimg.prm

Call with specific output file name and modified defocus -4.6 nm:
wavimg -prm prm\wavimg.prm -out img\TEMimage_foc-4.6nm.dat -foc -4.6

 


Last update: August 1, 2017

mailto:ju.barthel-at-fz-juelich.de

disclaimer(de)