        HolograFREE - Electron holography reconstruction routines
                by John Bonevich    1995-2004 NIST/NCEM/LBNL

These routines may be enabled by placing the HolograFREE.gtk file in the
Plugins folder of the DigitalMicrograph executable.  For example, the path
would be C:\Program Files\Gatan\DigitalMicrograph\Plugins\HolograFREE.gtk
Restarting the application will enable the routines under the HolograFREE
menu.  The on-line help file is reproduced below.  Please contact me by email
john.bonevich@nist.gov if you have questions, comments or suggestions.


An electron hologram is a fringe modulated image containing the amplitude
and phase information of an electron transparent object.  These routines 
reconstruct the amplitude/phase images allowing user control of various 
parameters.  Holograms are considered to have the following form: 
    I(r) = 1 + A(r)*A(r) + 2*A(r)*cos(P(r) + 2*pi*q(r))
where I is the image intensity in real-space (r), A the amplitude, P the 
phase and q the hologram carrier fringe modulation.

These routines operate on hologram images of size 2^n x 2^n where n is an 
integer.  Also a 'good' hologram has at least 4 pixels/fringe.  The 
displayed phase images are 'wrapped' between -pi to +pi radians.  Due to
the large size of the images used in reconstructing a hologram, the 
memory requirements for a 1024x1024 hologram image is about 60 MB.


Reconstruct...

'Normal' reconstruct takes the hologram (front image) and applies a Hanning 
window.  The Fourier transform is then calculated and the exact position
of the sideband determined.  The user may use either the sideband or its 
phase conjugate to reconstruct the hologram.  The user controls the size 
of the masking aperture as well as the aperture shape (circle or square).  
The amplitude and (wrapped) phase images are then calculated and 
displayed.  Two line plots of the phase are displayed, the x-profile and 
the y-profile.  The user may iteratively tilt the comparison wave used to 
calculate the phase as well as change the phase offset.

Notes: the user-specified aperture size S is determined as a circle of 
radius S or a square with edge 2S where S is by default half the distance 
(in pixels) from the auto-correlation to the sideband.  The dialog also 
contains the proper value for a one-third sized aperture.  The aperture 
is centered on the chosen sideband.  The tilts of the comparison wave are 
real numbers, typically values from -5 to 5 are adequate, however any 
number can be used.  The routine stores the tilt values for user 
reference, resetting the x, y and offset values to zero recovers the 
original phase image.

'Cs_defocus' reconstructs from a high resolution hologram and exactly
determines the position of the sideband as before.  The user may then 
specify the contrast transfer function (CTF) parameters of the microscope 
used to record the hologram.  The routine removes the effect of the CTF 
(in the form of exp(-iX[u])*envelope terms ) to calculate the object exit 
wavefunction.  The amplitude and (wrapped) phase images are calculated 
and displayed along with the phase x- and y-profiles.  The user may 
iteratively change the parameters of the CTF to recalculate the amplitude 
and phase images.  Note:  the hologram must be calibrated in either Angstrom
or nm units, else the routine exits.  The amplitude and phase images are
calibrated in nanometer units.

'From Reference' reconstructs the hologram using a reference hologram as 
the basis for calculation.  The user is prompted to select the hologram and 
its reference.  The routine returns 'reference corrected' amplitude and 
phase images as well as X- and Y- profiles of the phase.  This routine is 
useful to analyze the effects the reference wave perturbation.


Sidebands...

'Make Sidebands' will calculate the Fourier transform of the hologram and 
Hanning window.  A complex image is displayed.  The Hanning window is 
stored as a hidden image.  The user is then free to manipulate the pixel 
data, for example, masking the sidebands with apertures of arbitrary 
shape and position.

'From Sideband' assumes a complex image containing a single sideband (i.e., 
no auto-correlation or conjugate sideband).  The exact sideband position 
is determined and the amplitude and phase images calculated and displayed 
as well as the x- and y-profiles of the phase.  The user may iteratively 
tilt the comparison wave used to calculate the phase and change the phase 
offset.


Phase Data...

'Phase Amplify' takes any phase image.  The routine calculates the N-times 
amplified phase according to user-specified factor N.  The user may also 
offset the phase from -pi to +pi.  Note: N=1 amplification is meaningless.

'Phase Offset' takes a wrapped phase image and recalculates according to 
the user-specified offset to change the 'baseline' of the phase.  The 
phase data remains wrapped from -pi to +pi.

'Phase Tilt' takes a wrapped phase image and allows the user to impose a 
linear phase wedge effectively altering the tilt of the phase.  Returns 
a wrapped phase image (from -pi to +pi).  Identical to tilt in Reconstuct.

'Phase Unwrap' takes a wrapped phase image and removes the discontinuous 
jumps that result from the original phase wrapping (from -pi to +pi).  The 
phase is unwrapped from a user-specified origin.  Note: rapid jumps near 
image edges are problematic ...works best on the center 7/8 of the image.


'Polynomial Fit' takes any image and attempts to fit the data to a user 
specified Nth order polynomial (max N of 6).  The user may specify the 
number of iterations (typically 100) to allow for fitting convergence.  
Note: discontinuous (wrapped) phases can not be fitted.

