# Phase offset method of ptychographic contrast reversal correction

Christoph Hofer  Chuang Gao  Tamazouzt Chennit  Biao Yuan  Timothy J.
Pennycook<EMAIL_ADDRESS>EMAT, University of Antwerp,
Groenenborgerlaan 171, 2020 Antwerp, Belgium  NANOlab Center of Excellence,
University of Antwerp, Groenenborgerlaan 171, 2020 Antwerp, Belgium

###### Abstract

The contrast transfer function of direct ptychography methods such as the
single side band (SSB) method are single signed, yet these methods still
sometimes exhibit contrast reversals, most often where the projected
potentials are strong. In thicker samples central focusing often provides the
best ptychographic contrast as this leads to defocus variations within the
sample canceling out. However focusing away from the entrance surface is often
undesirable as this degrades the annular dark field (ADF) signal. Here we
discuss how phase wrap asymptotes in the frequency response of SSB
ptychography give rise to contrast reversals, without the need for dynamical
scattering, and how these can be counteracted by manipulating the phases such
that the asymptotes are either shifted to higher frequencies or damped via
amplitude modulation. This is what enables post collection defocus correction
of contrast reversals. However, the phase offset method of counteracting
contrast reversals we introduce here is generally found to be superior to post
collection application of defocus, with greater reliability and generally
stronger contrast. Importantly, the phase offset method also works for thin
and thick samples where central focusing does not.

###### keywords:

Electron ptychography , Phase wrap , 4D STEM

††journal: Ultramicroscopy

##  1 Introduction

Electron ptychography offers very high dose efficiency [1, 2, 3], the ability
to reveal the locations of light elements neighboring heavy atoms [4, 5], post
collection aberration correction and superresolution [6, 7]. These advantages
make the method a very attractive complement to Z-contrast annular dark field
(ADF) workflows [8], with the phase images providing stronger images of the
structure and the Z-contrast stronger sensitivity to composition. With
advances in cameras having greatly reduced or completely removed the problem
of slow scans with 4D STEM [9, 10], there is now relatively little drawback to
collecting data for ptychography.

Compared to phase contrast imaging with conventional high resolution
transmission electron microscopy (HRTEM), the contrast transfer function (CTF)
of direct focused probe methods such as single side band (SSB) [11, 12, 13]
and Wigner distribution deconvolution [14] are very simple, requiring no
aberrations to form contrast and exhibiting no zero crossings. This makes
these ptychographic methods much easier to interpret than HRTEM, at least for
potentials that are not overly strong. The phase is related to the strength of
the potential encountered by the beam electrons and thus as the strength of
the potential increases eventually the phase can exceed the limit imposed by
the $2\pi$ range of values available to phase and wrap around. This means that
as phase increases it can suddenly go from being maximally positive at $\pi$
to maximally negative at -$\pi$, causing a very large change in contrast from
only a small change in the sample. Therefore, even though the SSB ptychography
CTF, derived using the same weak phase approximation as HRTEM CTFs, shows all
frequencies being passed with the same sign, contrast reversals can occur
because of wrap around.

One of the most observed contrast reversal behaviour in atomic resolution
imaging is a dip in the phase at the center of the atomic columns [15, 5, 14].
These often appear as donut shapes in the images and like a volcano with a
caldera in line profiles, and represents a reversal from the centrally peaked
probe shaped atoms one observes when the potential is weaker. This makes some
intuitive sense as the center of an atomic column in the location of the
strongest potential, and thus it is natural to expect that this will be where
wrap around will occur first as the potential increases. This intuitive
expectation is also in accord with the fact that it is the heavier atomic
columns that exhibit donuts first as thickness increases [5]. Such contrast
reversals have also been observed in iCoM and iterative ptychography [15, 16].
This again makes intuitive sense as all these methods are attempting to
retrieve the same phase shift induced on the beam electrons by the sample.
Perhaps less intuitive is the fact that the range of phase values in the final
images generally remains much less than $2\pi$ in atomic resolution imaging,
at least in single slice ptychography, but it is not just the phases in the
final image that can phase wrap – the individual frequency components can also
phase wrap.

If the goal is to locate the light elements hidden in the ADF signal by strong
scattering of nearby heavy elements, the appearance of donut contrast on the
heavier columns is often not a significant impediment. However as the
thickness increases the contrast can become more complex [5]. Furthermore, it
is often preferable for images of atomic structure to appear as close to the
relatively simple probe shaped spikes in intensity occurring in ADF imaging,
even if simply for ease of interpretation. However the contrast reversals can
also degrade overall contrast and reduce the visibility of the structure at
lower doses [17], as well as complicate quantification.

For quite a range of thicknesses, central focusing of the beam offers phase
images free from contrast reversals and with the strongest contrast overall
[5, 15, 17]. However this conflicts with the optimal focus for ADF imaging,
the entrance surface. Thus optimizing the probe focus for the phase images
during acquisition can significantly degrade the quality of simultaneously
acquired ADF images, especially as the sample thickness increases and the
distance between the entrance surface and optimal focus for ptychography
widens. Fortunately post collection adjustments can be applied. The ability of
ptychography to adjust aberrations post collection can be leveraged to apply a
post collection defocus which can often remove the contrast reversals [5].
However the application of post collection defocus also often reduces the
overall contrast, even if the atoms all appear “atom like” after the contrast
reversal correction. Furthermore, in some cases, post collection defocus does
not remove contrast reversals with satisfying results, and indeed in other
cases neither does physically focusing the probe during data acquisition [15,
17]. Another interesting approach to overcome contrast reversals is multislice
ptychography [18]. Here, the specimen is divided in multiple slices and the
phase is solved in each slice separately. Crucially, each slice is thin enough
so that phase wraps are avoided within the slices.

Here we delve deeper into the phase wrapping process causing the contrast
reversals, and demonstrate a better way to counteract them for SSB
ptychography when using focus during acquisition either is not an option or
does not satisfactorily remove the reversals. As the potential of a single
atom is increased, the phases of the spatial frequencies change nonlinearly,
with the higher frequencies changing faster than the lower frequencies. This
means that as the potential is increased, the higher spatial frequencies
eventually hit the limit imposed by the 2$\pi$ range of phases available and
wrap around. Once a frequency wraps around, its phase contrasts very strongly
with the frequencies that have not yet wrapped around. Thus these asymptotes
in the phase response produce contrast reversals, and they can do so without
any dynamical scattering. Applying defocus can roll the phases back around or
reduce the amplitude of the wrapped around frequencies sufficiently that the
contrast reversals can be removed. However, we find directly adjusting the
phases with an offset applied to the zero frequency (DC) phase is generally a
better method. We show that this method can robustly counteract contrast
reversals regardless of the thickness or initial focus of the probe. Although
central focusing remains preferable for the absolute best phase contrast in
many cases, the phase offset method provides significantly improved contrast
compared to defocus correction when a post collection solution is required.
Furthermore, the phase offset method can correct contrast reversals in cases
where physical defocus cannot satisfactorily do so. The ability of the phase
offset to retain contrast is especially important when the sample is fragile
and one has a low dose budget. We demonstrate this experimentally at a dose of
at 50 e${}^{-}/$Å2 with a thin highly beam sensitive methylammonium (MA)-PbI3
perovskite solar cell material[19, 20] which exhibits contrast reversals that
cannot be corrected by defocus at all, whether applied during data collection
or after.

##  2 Results and Discussion

Figure 1: Single atom SSB simulations using potentials ranging from a U atom
potential to 20 times that potential, showing how the potential strength
itself causes contrast reversals, which manifest here as donut shaped atom
contrast. The 2nd row shows the phase vs frequency in 2D, and the 3rd row line
profiles of the rotationally symmetric phase response. As the potential
increases the curvature of the phase increases, the phase hits the top limit
and wraps around resulting in contrast reversal at the center of the atom. As
the wrap around shifts to lower frequencies the donut hole expands. Scale bar
is 2 Å.

Figure 1 displays single atom SSB images phase vs frequency plots starting
with a U atom, and incrementally multiplying the strength of the potential by
a factor of 5 up to 20. For the SSB recontruction, the package pyPtychoSTEM
[21] is used and for the simulation of the 4D data abTEM [22] is used and. The
convergence angle is set to 30 mrad. Obviously, the multiplied potential then
corresponds to an atom heavier than any known, but this super heavy atom
allows us to probe the effect of the potential without dynamical scattering
complicating matters. With the already very heavy U atom, the phase curves
significantly upwards as a function of the magnitude of the spatial frequency,
but remains entirely within the 2$\pi$ phase range without any phase wrap.
Multiplying the U potential by a factor of 5, the phase increases more rapidly
with respect to frequency, and a phase wrap occurs as the phase extends beyond
$\pi$. This results in a significant proportion of the higher spatial
frequencies switching from being strongly positive to strongly negative,
creating a strong contrast between frequencies lower than and higher than the
asymptote, and resulting in a contrast reversal in the form of a small donut
hole appearing in the center of the image of the atom. As the potential is
increased to U $\times 10$, the phase vs frequency curvature increases. The
first wrap around asymptote shifts to lower frequency, a second wrap around
point appears and the donut hole increases in size. As the potential is
further increased the curvature further increases, further altering the
balance between positive and negative phase frequencies, and overall the donut
hole increases in width.

Figure 2:  Illustration of the effects of the different frequency ranges on
the simulated SSB image of the U$\times 20$ potential using masking in Fourier
space. With the full range of frequencies out to $2\alpha$ included (a), the
atom appears as a thin ring with a slight peak in its center. As we
progressively mask out the frequencies after each phase wrap (b–d) around
asymptote the positive ring of phase progressively fills more of the central
region of the atom, until after removing the contributions from all
frequencies above the first wrap around it becomes atom like again, with a
peak at the center of the atom. Of course, by limiting the contribution to
lower spatial frequencies the image is also limited in resolution. Scale bar
is 1 Å for the phase image and 20 mrad for the phase and amplitude vs.
frequency plot, respectively.

Figure 2 shows how the different ranges of frequencies influence the phase
image for the U$\times 20$ single atom potential using masking in probe
reciprocal space. For this potential, the strongest single atom potential we
have used, there are three phase wraps occurring within the $2\alpha$ range of
frequencies passed using our 30 mrad convergence angle ($\alpha$), with the
last wrap occurring almost at the $2\alpha$ limit of the SSB contrast transfer
function [12, 13]. These three distinct ranges have frequencies with strongly
contrasting phases. Starting with all spatial frequencies included (Fig. 2a),
the single atom appears as a thin ring of strongly positive phase with a lower
phase region in the center. The central region has a small peak of slightly
more positive phase with this potential. As we mask out more higher
frequencies, such that frequencies higher than the second phase wrap occurring
in the middle of the $2\alpha$ range of frequencies are incrementally
excluded, the ring of positive phase in the image fills inwards (Fig. 2b). The
small positive peak in phase at the center of the atom disappears and instead
becomes a minimum.

As we mask more of the higher frequencies, between the first asymptote and
second asymptote, the donut shape fills in more, with the central “hole”
becoming more positive overall but still dipping significantly compared to the
phase further from the center of the atom (Fig. 2c). In this step we have
reduced the number of strongly negatively phased frequencies above the first
phase wrap asymptote contrasting with the strongly positively phased
frequencies below the asymptote. When we remove all the frequencies above the
first wrap point, we remove these strongly contrasting negative phase
frequencies and the atom turns “atom” shaped (Fig. 2d).

As has been shown previously, defocus can often be used to counteract the
contrast reversals [5, 15, 17]. For thicker samples, physically placing the
probe focus in the centre of the sample is often found to be optimal. With a
single atom, however, there is no difference between the entrance surface and
the center of the sample. Thus there is no significant variation of defocus
through the sample, the reason for central focusing being optimal in many
cases [17]. However we can still counteract the contrast reversals of a single
atom with defocus as shown in figure 3 using a 5 nm defocus with the U$\times
20$ potential.

Figure 3:  Illustration of the influence of post-collection and physical
defocus on SSB ptychography with simulations using the U$\times 20$ potential.
The SSB images are displayed on the same intensity scale, with the contrast
ratio (C) of the maximum phase to background phase indicated. To ease
interpretation, the profiles of the frequency response include just one of the
two frequency curves that arise with a single atom. The full frequency
response is displayed in the 2D phase vs frequency plots, with the alternating
checkerboard pattern the result of the tandem phase vs frequency curves
associated with the single atom that hit the $\pi$ upper limit at different
frequencies and separately wrap around as is visible in the line profiles in
figure 1. From the line profiles it is apparent that the the physical defocus
brings the amplitudes close to zero after the first wrap around, whereas the
post collection defocus pushes the first wrap point out to higher spatial
frequencies, resulting in stronger contrast in this case.

While physical defocus is most commonly found best for the ptychographic
contrast, particularly with intermediate thickness samples in which central
focusing is optimal, the option to counteract the reversals with the probe
focused elsewhere can be a significant benefit. This can often be achieved
with the ability of ptychography to alter aberrations post collection [5].
Figure 3 illustrates this for the U$\times 20$ potential using a 3 nm defocus
applied post collection.

Physical and post collection defocus are generally found to behave somewhat
differently, as is also the case here despite this being a single atom with
presumably insignificant dynamical effects. Although both physical and post
collection defocus remove the donut shape in the SSB image, the behavior
further from the atom is different with a ring of higher phase appearing in
the post collection defocus results closer to its center than in the
physically defocused case. The 2D plot of phase vs frequency is more complex
in the physical defocus case here, with the post collection appearing to
nonlinearly push the phase wraps out to higher frequency. There are still
three phase wraps in the post collection case, but they are concentrated
closer to the 2$\alpha$ transfer limit, leaving a broader range of unwraped
lower frequencies. In the physically defocused case, it appears more that it
is the suppression of the amplitudes of the phases after the first wrap that
results in the contrast reversal removal.

The reduction of contrast that can result from post collection defocus
motivated us to search for an alternative strategy to counteract contrast
reversals. We present here what we call the phase offset method. Given that
the DC term provides the baseline phase which all other frequencies interfere
with when transforming from probe reciprocal space into real space to form an
image, by altering the relative phase of the DC term and all the other phases
with a rigid offset, we can manipulate the phase wrap point and move it to
higher frequencies without otherwise altering the overall shape of the phase
vs frequency plot. In practice one can simply shift the DC term itself,
although for the purposes of illustration here we instead shift the phases of
the other frequencies while keeping the DC term phase constant in our plots of
phase vs frequency as this better shows the effect on the phase wraps.

Figure 4 illustrates the use of a phase offset with the U$\times 10$
potential. Without any correction the phase vs frequency curve displays a
sharp jump from the DC term to the first non zero frequency. Applying an
offset of -1.8 radians to the non-zero frequency components rigidly shifts the
phase curve down such that there is no discontinuity moving from the DC term
to the higher spatial frequencies until the positive $\pi$ upper limit is hit
and the phase wrap occurs as shown in Figure 4e. Importantly, with this offset
the phase wrap occurs at a significantly higher spatial frequency than without
the offset, and as can be seen from the figure the resulting image, Figure 4c,
is donut free and much more closely resembles the shape of a lighter single
atom that does not cause wrap around. There is a negative halo, but this is
normal for a single atom in ptychographic images [23]. Using other values for
the offset either does not fully correct the contrast reversal as in Figure 4b
or inverts the donut image as in 4d.

Figure 4: Illustration of the use of a phase offset on strong phase objects.
(a–d) SSB images simulated with the U$\times 10$ potential using offsets
phases of 0.0, -0.9, -1.8 and -2.7 mrad on the non-zero spatial frequencies
with the DC values set to zero. (e) Line profiles of of the phases with no
offset and the optimal -1.8 rad offset, again with only the upper phase vs
frequency curve shown for simplicity.

While a single atom is a rather simple system, it turns out that this phase
offset method is quite robust with crystals. As a first example, Fig. 5
examines the use of the phase offset with 16 nm thick SrTiO3 (STO). In panel a
the probe is focused to the entrance surface, which we emphasize is the best
condition for ADF imaging. However, this leads to contrast reversals of the
heavy Sr and Ti sites in the SSB image. Physically focusing to the middle of
the specimen, as in Fig. 5b, removes the contrast reversals as a result of the
defocus phase compensation of different layers [17]. To correct the contrast
reversals using post collection defocus applied to data taken with the probe
physically focused to the entrance surface during acquisition requires, in
this case, a significantly larger defocus which, as we will show, results in a
significant contrast reduction of the phase image. The post collection defocus
adjustment often leads to sufficiently large contrast reduction that the atoms
are not visible at low doses such as the 500 e${}^{-}/$Å2 used in the bottom
row of Fig. 5. As seen in the figure, the image in which the contrast
reversals have been corrected using physical defocus remains quite clear at
this dose. Compared to post collection defocus, the phase offset does not
reduce the contrast nearly as much, providing an image in which all the
locations of the atoms are easily identified also at the lower dose.

We note that as the ptychographic contrast is not as high here with the focus
set at the entrance surface even with the phase offset method, compared to
physically focusing to the center of the sample, one must choose to prioritize
either optimal ptychographic contrast at the expense of the ADF or having a
better ADF contrast by focusing to the entrance surface and compensating the
ptychography with a phase offset. Many materials science samples can handle
many orders of magnitude higher doses than 500 e${}^{-}/$Å2, and for these one
may wish to to optimize the ADF by focusing to the entrance surface while
still obtaining a high quality contrast reversal free ptychographic image via
the phase offset method. On the other hand, if the dose budget for a given
sample is very low, one might consider that one might not obtain useful
information from the far less dose efficient ADF signal even with the focus at
the entrance surface, and choose to physically focus to the center of the
sample. Of course, optimizing the focus under low dose conditions can also be
very difficult and thus there likely remains benefit to optimizing via post
collection adjustments such as the offset method at low doses as well, even if
a central focus was the aim.

Figure 5: Comparison of SSB images simulated for 16 nm thick STO with the
probe focused to the entrance surface (df = 0), the central slice (df = 8 nm)
without further correction, and focused to the entrance surface with a post-
collection defocus of 10 nm and using the phase offset method. The top row of
images is noise free, while the bottom row of images use a dose of 500
e${}^{-}/$Å2. Here the central focusing is optimal, correcting the reversal
with strong contrast. The post-collection defocus correction is very noisy in
the low dose simulation, but the phase offset method retains sufficient
contrast to locate all the columns at low dose while retaining the optimal
probe focus for the ADF. Scale bar is 3 Å.  Figure 6:  Simulated SSB imaging
of STO as a function of thickness comparing the uncorrected and phase offset
results with the probe focused to the entrance surface. The top half of the
figure is with infinite dose, and the bottom with a dose of 500 e${}^{-}/$Å2.
These show the robustness of the phase offset method across a wide range of
thickness. Scale bar is 3 Å. Figure 7:  Comparison of physical defocus and the
phase offset method for contrast reversal removal with 50 nm thick STO
simulations. Central focusing (25 nm df) does not remove the contrast
reversals in this case. Instead, close to the exit surface, using 44 nm of
defocus, was found to be optimal using a focal series. However, physically
focusing just 6 nm from the exit surface results in additional atom like
features appearing where there are no atoms. This does not occur using the
phase offset on data taken with the probe focused to the entrance surface.
Furthermore the O columns are more visible at the low 500 e${}^{-}/$Å2 dose
using the phase offset method than physical focusing. Scale bar is 3 Å.

Since ptychographic contrast is quite sensitive to the sample thickness, we
now demonstrate that the offset correction can be successfully applied to a
large variety of thicknesses. Fig. 6 shows STO SSB images noise free and with
a dose of 500 e${}^{-}/$Å2 with thicknesses of 16 nm, 20 nm, 24 nm and 50 nm.
This covers a range of specimen thicknesses typical of atomic resolution
electron microscopy in materials science. Focusing on the entrance surface
leads to contrast reversals as seen in the first and third rows of Fig. 6. The
phase offset correction leads to a reasonable contrast with all thicknesses.
In the 24 nm case, the oxygen columns have a much weaker contrast in both the
uncorrected and the corrected phase images. This can be improved by physically
focusing to the center of the sample thickness, as we showed previously [17],
however, this can be difficult in experiments in practice without live
processing. For 50 nm of STO, the contrast reversals are sufficiently complex
in the uncorrected image that it is practically uninterpretable at 500
e${}^{-}/$Å2. This is a very low dose for STO, but it is nevertheless
informative regarding the contrast generally as well for samples that handle
only very low doses.

50 nm is also an interesting case because the center of the sample is not the
focal plane exhibiting optimal contrast, as we found previously by performing
a simulated focal series [5]. Figure 7 shows that the central focal plane
exhibits quite strong contrast complexity that is not “atom-like”. Instead, it
was found that physically focusing to near the exit surface provides much
better correction of contrast reversals. An example of this is shown in figure
7 using a 44 nm defocus from the entrance surface, just 6 nm from the exit
surface of the sample. Here the contrast is much better, and is much more
interpretable, including at 500 e${}^{-}/$Å2. However some artifacts remain in
the form of atom like spots in between the actual atoms, as is seen in the
noise free image. These are not present in the phase offset images, which not
only show no contrast reversals or artifacts but actually show more visible
contrast on the O sites at 500 e${}^{-}/$Å2. Given the difficulty of
optimizing focus during low dose work, the performance of the phase offset
here is encouraging.

Furthermore, focus adjustment of the beam cannot not always remove contrast
reversals. While one might expect that contrast reversals arise only in
relatively thick materials, surprisingly thin materials can also encounter
contrast reversals, and these can be impossible to remove with defocus. Clark
et al. showed this for very thin GaN [15]. We have explored this for 5 nm
thick STO [17], which we find also exhibits contrast reversals which cannot be
counteracted with central focusing. This is perhaps intuitive given the small
range of defocus that exists within the sample. However, the reversals also
can not be corrected with any focal point within the sample, or even within a
useful range beyond as shown in Fig. 8. While perhaps the contrast reversal
begins to be counteracted far beyond the exit surface, the contrast has
already been significantly reduced to the point where the O sites are hardly
visible. In contrast, applying a phase offset to the entrance surface focused
data completely removes the contrast reversals. This shows that the phase
offset method can be more robust than defocus adjustment generally.

Figure 8:  Simulated focal series for 5 nm thin STO showing that no defocus
value can counteract the contrast reversals within a range that does not
overly distort the images. Importantly, the phase offset method counteracts
the contrast reversals with the probe focused to the entrance surface and
retains good contrast.Scale bar is 2 Å.

We now demonstrate the phase offset method with experimental data. 4D STEM
data of a methylammonium(MA)-PbI3 perovskite was acquired using our Timepix3
event driven camera to easily achieve very low doses and avoid drift [9]. Due
to the extreme beam sensitivity of the material, we use a dose of just 50
e${}^{-}/$Å2. We note that this in the dose regime used in cyro electron
microscopy of proteins. Although the event driven camera makes such low dose
scans easy to achieve, the very low dose still makes it very difficult to find
the best focus for the ptychography during the experiment, especially as one
wishes to spend all the dose budget on imaging the regions of interest on the
sample, and not adjusting the focus on that area. In practice, at present
focusing is performed by optimizing the ADF image, which again is usually not
the best defocus for the simultaneously acquired ptychography data, at least
without further correction.

An SSB image of the MAPbI3 is shown without correction in Fig. 9a. The heavy
columns, which include Pb, tend to be donut shaped, despite the very low
thickness of approximately 4 nm as indicated from EELS measurements. This
thickness falls within the regime where the contrast reversals cannot be
corrected via defocusing, assuming the STO results are representative as we
expect. Indeed a post acquisition defocus series does not remove the contrast
reversals. The best result we could achieve with post collection defocus is
with 8 nm of defocus as shown in Fig. 9c. Applying a phase offset, however,
removes the contrast reversals without any obvious compromise of the contrast,
as shown in Fig. 9b.

Further increasing the post collection defocus reduces the contrast to the
point of losing the lattice contrast completely. This is in agreement with the
earlier discussion regarding the thin STO and the defocus series shown in Fig.
8, where a high defocus only corrects the reversals to a small extent. For low
dose data, such as that of the MAPbI3, such high defocus values lead to a
complete loss of the signal as a result of the contrast reduction associated
with defocusing. In this case, the phase offset is the only method that can
practically be used to obtain an easily interpretable image without contrast
reversals.

Since contrast reversals have also been observed in iterative ptychography
reconstructions [15], it is interesting to see if the phase offset can also be
used for these methods as one would expect. For this reason, we simulated a 4D
data set of MAPbI3 with an 80 nm defocus and processed it with the gradient
descent iterative ptychography algorithm as implemented in py4DSTEM [24].
Donuts appear on the Pb, similar to the SSB case as shown in Fig. 10a.
Applying the phase offset to the gradient descent result indeed removes the
contrast reversals as shown in panel b. A 50 e${}^{-}/$Å2 dose version of the
phase offset corrected ePIE reconstruction is shown in Fig. 10c.

In conclusion, the phase offset method offers a significant boost to our
ability to counteract contrast reversals in electron ptychography. Optimizing
the focus used with the data acquisition often provides the best ptychographic
contrast, such as central focusing with intermediate thicknesses. However
there are many situations where using a focus optimal for the ptychographic
contrast is not practical, and indeed cases where defocus cannot be used to
counteract contrast reversals at all. Often one may prefer to optimize defocus
for the ADF, as this cannot be corrected post collection. At doses
sufficiently high that the less efficient ADF signal shows good contrast, the
contrast reduction from using the offset method vs a physical defocus
optimised for the ptychography will often not be so significant as to matter
for locating atoms. At very low doses where the ADF provides very poor
contrast, one may choose to abandon the ADF and prioritize focusing for the
ptychography. However, the ADF can provide very informative information at
surprisingly low doses, even if exceedingly noisy, and in practice accurate
focusing is particularly challenging at extremely low doses. Furthermore,
defocus cannot always correct contrast reversals as is the case for the thin
few nm thick samples we discussed. Thus, as we see with the experimental
example with MAPbI3 here, the phase offset can be an important tool to remove
contrast reversals, even at the extremely low doses used in cryo electron
microscopy of proteins. Overall, we find the phase offset method reliably
overcomes contrast reversals with minimal contrast reduction, or even improved
contrast, compared to a defocus optimized for ptychography at the time of
acquisition and thus we expect it to become a standard tool in the use of
direct electron ptychography.

Figure 9:  Experimental SSB images of thin ca. 2–4 nm thick MAPbI3. (a)
Uncorrected SSB image taken with the focus optimized for the ADF (not shown)
Contrast reversals are clearly visible on the heavy columns as highlighted by
the red arrows. The phase offset corrected SSB image (b) removes the contrast
reversals while the post-collection defocus (pc-df) cannot completely remove
the contrast reversals. Scale bar is 3 Å‘. Figure 10:  Simulated ePIE images
of thin ca. 2.4 nm thick MAPbI3. (a) Noise-free uncorrected ePIE image taken
with a defocus of 80 nm. Donuts are clearly visible on the Pb sites, similar
to the SSB image. (b) Phase offset corrected version of (a). (c) is the same
as (b) but with an electron dose of 50 e${}^{-}/$Å2. Scale bar is 3 Å‘.

##  3 Acknowledgement

We acknowledge funding from the European Research Council (ERC) under the
European Union’s Horizon 2020 Research and Innovation Programme via Grant
Agreement No. 802123-HDEM (C.H., C.G., T.C., B.Y. and T.J.P.) and FWO Project
G013122N “Advancing 4D STEM for atomic scale structure property correlation in
2D materials” (C.H.).

## References

  * [1] T. J. Pennycook, G. T. Martinez, P. D. Nellist, J. C. Meyer, High dose efficiency atomic resolution imaging via electron ptychography, Ultramicroscopy 196 (2019) 131–135.
  * [2] L. Zhou, J. Song, J. S. Kim, X. Pei, C. Huang, M. Boyce, L. Mendonça, D. Clare, A. Siebert, C. S. Allen, et al., Low-dose phase retrieval of biological specimens using cryo-electron ptychography, Nature communications 11 (1) (2020) 2773.
  * [3] X. Pei, L. Zhou, C. Huang, M. Boyce, J. S. Kim, E. Liberti, Y. Hu, T. Sasaki, P. D. Nellist, P. Zhang, et al., Cryogenic electron ptychographic single particle analysis with wide bandwidth information transfer, Nature Communications 14 (1) (2023) 3027.
  * [4] H. Yang, R. Rutte, L. Jones, M. Simson, R. Sagawa, H. Ryll, M. Huth, T. Pennycook, M. Green, H. Soltau, Y. Kondo, B. Davis, P. Nellist, Simultaneous atomic-resolution electron ptychography and Z-contrast imaging of light and heavy elements in complex nanostructures, Nature Communications 7 (2016) 12532.
  * [5] C. Gao, C. Hofer, D. Jannis, A. Béché, J. Verbeeck, T. J. Pennycook, Overcoming contrast reversals in focused probe ptychography of thick materials: An optimal pipeline for efficiently determining local atomic structure in materials science, Applied Physics Letters 121 (8), 081906.
  * [6] Y. Jiang, Z. Chen, Y. Hang, P. Deb, H. Gao, S. Xie, P. Purohit, M. W. Tate, J. Park, S. M. Gruner, V. Elser, D. A. Muller, Electron ptychography of 2D materials to deep sub-Angstrom resolution, Nature 559 (7714) (2018) 343–349.
  * [7] Z. Chen, Y. Jiang, Y.-T. Shao, M. E. Holtz, M. Odstrčil, M. Guizar-Sicairos, I. Hanke, S. Ganschow, D. G. Schlom, D. A. Muller, Electron ptychography achieves atomic-resolution limits set by lattice vibrations, Science 372 (6544) (2021) 826–831.
  * [8] O. Krivanek, M. Chisholm, V. Nicolosi, T. Pennycook, G. Corbin, N. Dellby, M. Murfitt, C. Own, Z. Szilagyi, M. Oxley, S. Pantelides, S. Pennycook, Atom-by-atom structural and chemical analysis by annular dark-field electron microscopy, Nature 464 (2010) 571–4.
  * [9] D. Jannis, C. Hofer, C. Gao, X. Xie, A. Béché, T. Pennycook, J. Verbeeck, Event driven 4D STEM acquisition with a Timepix3 detector: Microsecond dwell time and faster scans for high precision and low dose applications, Ultramicroscopy 233 (2022) 113423.
  * [10] D. G. Stroppa, M. Meffert, C. Hoermann, P. Zambon, D. Bachevskaya, H. Remigy, C. Schulze-Briese, L. Piazza, From STEM to 4D STEM: Ultrafast Diffraction Mapping with a Hybrid-Pixel Detector, Microscopy Today 31 (2) (2023) 10–14.
  * [11] T. J. Pennycook, A. R. Lupini, H. Yang, M. F. Murfitt, L. Jones, P. D. Nellist, Efficient phase contrast imaging in STEM using a pixelated detector. Part 1: Experimental demonstration at atomic resolution, Ultramicroscopy 151 (2015) 160–167.
  * [12] H. Yang, T. J. Pennycook, P. D. Nellist, Efficient phase contrast imaging in STEM using a pixelated detector. Part II: Optimisation of imaging conditions, Ultramicroscopy 151 (2015) 232–239.
  * [13] C. M. O’Leary, G. T. Martinez, E. Liberti, M. J. Humphry, A. I. Kirkland, P. D. Nellist, Contrast transfer and noise considerations in focused-probe electron ptychography, Ultramicroscopy 221 (2021) 113189.
  * [14] H. Yang, I. MacLaren, L. Jones, G. T. Martinez, M. Simson, M. Huth, H. Ryll, H. Soltau, R. Sagawa, Y. Kondo, C. Ophus, P. Ercius, L. Jin, A. Kovács, P. D. Nellist, Electron ptychographic phase imaging of light elements in crystalline materials using wigner distribution deconvolution, Ultramicroscopy 180 (2017) 173–179.
  * [15] L. Clark, G. T. Martinez, C. M. O’Leary, H. Yang, Z. Ding, T. C. Petersen, S. D. Findlay, P. D. Nellist, The Effect of Dynamical Scattering on Single-plane Phase Retrieval in Electron Ptychography, Microscopy and Microanalysis 29 (1) (2022) 384–394.
  * [16] F. Allars, P.-H. Lu, M. Kruth, R. E. Dunin-Borkowski, J. M. Rodenburg, A. M. Maiden, Efficient large field of view electron phase imaging using near-field electron ptychography with a diffuser, Ultramicroscopy 231 (2021) 113257.
  * [17] C. Gao, C. Hofer, T. J. Pennycook, On central focusing for contrast optimization in direct electron ptychography of thick samples (2023).  arXiv:2306.08587.
  * [18] A. M. Maiden, M. J. Humphry, J. M. Rodenburg, Ptychographic transmission microscopy in three dimensions using a multi-slice approach, J. Opt. Soc. Am. A 29 (8) (2012) 1606–1614.
  * [19] Y. Li, W. Zhou, Y. Li, W. Huang, Z. Zhang, G. Chen, H. Wang, G.-H. Wu, N. Rolston, R. Vila, et al., Unravelling degradation mechanisms and atomic structure of organic-inorganic halide perovskites by cryo-EM, Joule 3 (11) (2019) 2854–2866.
  * [20] J. Ran, O. Dyck, X. Wang, B. Yang, D. B. Geohegan, K. Xiao, Electron-beam-related studies of halide perovskites: Challenges and opportunities, Advanced Energy Materials 10 (26) (2020) 1903191.
  * [21] C. Gao, C. Hofer, T. J. Pennycook, Pyptychostem, https://gitlab.com/pyptychostem/pyptychostem.
  * [22] J. Madsen, T. Susi, The abTEM code: transmission electron microscopy from first principles [version 2; peer review: 2 approved], Open Research Europe 1 (24).
  * [23] C. Hofer, T. J. Pennycook, Reliable phase quantification in focused probe electron ptychography of thin materials, Ultramicroscopy (2023) 113829.
  * [24] B. H. Savitzky, S. E. Zeltmann, L. A. Hughes, H. G. Brown, S. Zhao, P. M. Pelz, T. C. Pekin, E. S. Barnard, J. Donohue, L. Rangel DaCosta, et al., py4DSTEM: A software package for four-dimensional scanning transmission electron microscopy data analysis, Microscopy and Microanalysis 27 (4) (2021) 712–743.