Phase contrast transfer function -------------------------------- The phase contrast transfer function (PCTF) quantifies how accurately a reconstruction technique recovers the true exit wave, particularly at different spatial frequencies. This concept is essential for evaluating ptychographic reconstructions, single sideband (SSB) imaging, and other phase retrieval methods in 4D-STEM. Why we need PCTF ^^^^^^^^^^^^^^^^ When you reconstruct an exit wave using ptychography or SSB, the result is never perfect. The reconstruction algorithm has limitations, especially at high spatial frequencies where noise dominates and the signal is weak. You need a way to measure how much of the true structure actually survived the reconstruction process at each spatial frequency. The basic idea ^^^^^^^^^^^^^^ You compare two exit waves. The first is the true exit wave that you want to recover, which might come from a multislice simulation or an analytic object model. Call it :math:`\psi_{\text{true}}(x,y)`. The second is the reconstructed exit wave that comes out of your reconstruction algorithm (like ePIE). Call it :math:`\psi_{\text{recon}}(x,y)`. These two exit waves are not equal because the reconstruction is imperfect, especially at high spatial frequency where fine details are lost. Moving to Fourier space ^^^^^^^^^^^^^^^^^^^^^^^^ Instead of comparing the exit waves in real space :math:`(x,y)`, you take their Fourier transforms to get :math:`\tilde{\psi}_{\text{true}}(k_x,k_y)` and :math:`\tilde{\psi}_{\text{recon}}(k_x,k_y)`. Now you can directly see how much amplitude survives at each spatial frequency. At low spatial frequencies (large features), the reconstruction is usually good, so :math:`|\tilde{\psi}_{\text{recon}}(k_x,k_y)|` is close to :math:`|\tilde{\psi}_{\text{true}}(k_x,k_y)|`. At high spatial frequencies (fine details), the reconstruction deteriorates, and :math:`|\tilde{\psi}_{\text{recon}}(k_x,k_y)|` becomes much smaller than :math:`|\tilde{\psi}_{\text{true}}(k_x,k_y)|`. Computing the PCTF ^^^^^^^^^^^^^^^^^^ The phase contrast transfer function (PCTF) is defined as: .. math:: \boxed{\text{PCTF}(k_x,k_y) = \frac{|\tilde{\psi}_{\text{recon}}(k_x,k_y)|}{|\tilde{\psi}_{\text{true}}(k_x,k_y)|}} This ratio tells you what fraction of the true amplitude survives at each spatial frequency. A value of 1 means perfect reconstruction at that frequency. A value of 0.5 means only half the amplitude survived. A value near 0 means that spatial frequency was essentially lost. What it tells you ^^^^^^^^^^^^^^^^^ The PCTF curve shows you the effective resolution of your reconstruction: - **Low frequencies** (small :math:`k`): PCTF close to 1, meaning large features are accurately recovered - **Medium frequencies**: PCTF gradually decreases as reconstruction quality degrades - **High frequencies** (large :math:`k`): PCTF drops toward 0, indicating fine details are lost The spatial frequency where PCTF drops below some threshold (like 0.5 or 0.2) defines your effective resolution limit. This is more informative than simply looking at the reconstructed image, because you can quantify exactly which spatial frequencies are trustworthy. Example PCTF curves ^^^^^^^^^^^^^^^^^^^ Here are typical PCTF curves comparing ptychography and single sideband (SSB) imaging: .. plot:: :include-source: False import numpy as np import matplotlib.pyplot as plt # Spatial frequency range (in 1/Angstrom) k = np.linspace(0, 2.5, 500) # Ptychography CTF - maintains high values to higher frequencies # More robust due to multiple overlapping measurements ctf_ptycho = np.exp(-0.5 * (k / 1.5)**2) * (1 - 0.1 * k) ctf_ptycho = np.clip(ctf_ptycho, 0, 1) # SSB CTF - drops off more quickly at high frequencies # Limited by center beam information and noise ctf_ssb = np.exp(-1.2 * (k / 1.0)**2) * (1 - 0.15 * k) ctf_ssb = np.clip(ctf_ssb, 0, 1) # Noisy/poor reconstruction CTF ctf_poor = np.exp(-2.5 * (k / 0.7)**2) * (1 - 0.2 * k) ctf_poor = np.clip(ctf_poor, 0, 1) fig, ax = plt.subplots(figsize=(8, 5)) ax.plot(k, ctf_ptycho, 'b-', linewidth=2.5, label='Ptychography (good)') ax.plot(k, ctf_ssb, 'g-', linewidth=2.5, label='SSB (typical)') ax.plot(k, ctf_poor, 'r--', linewidth=2, label='Poor reconstruction') # Add threshold lines ax.axhline(y=0.5, color='gray', linestyle=':', linewidth=1.5, alpha=0.7, label='50% threshold') ax.axhline(y=0.2, color='gray', linestyle=':', linewidth=1.5, alpha=0.5, label='20% threshold') ax.set_xlabel('Spatial frequency (Å$^{-1}$)', fontsize=12) ax.set_ylabel('PCTF value', fontsize=12) ax.set_title('Typical PCTF curves for 4D-STEM techniques', fontsize=13, fontweight='bold') ax.set_xlim(0, 2.5) ax.set_ylim(0, 1.05) ax.grid(True, alpha=0.3, linestyle='-', linewidth=0.5) ax.legend(loc='upper right', fontsize=10, framealpha=0.9) # Add annotations ax.annotate('Good reconstruction\nup to high k', xy=(1.5, 0.5), xytext=(1.8, 0.75), fontsize=9, ha='left', arrowprops=dict(arrowstyle='->', color='blue', lw=1.5)) ax.annotate('Information lost\nat high k', xy=(1.5, 0.1), xytext=(1.8, 0.25), fontsize=9, ha='left', arrowprops=dict(arrowstyle='->', color='red', lw=1.5)) plt.tight_layout() Ptychography typically maintains higher PCTF values to larger spatial frequencies because it uses multiple overlapping probe positions, providing redundant information. SSB imaging relies on center beam information and typically has a more limited frequency response. The spatial frequency where the PCTF drops below 0.5 or 0.2 defines your effective resolution limit. Applications ^^^^^^^^^^^^ The PCTF concept is used throughout 4D-STEM analysis: - **Ptychography**: Comparing reconstructed object phase to simulated ground truth - **Single sideband imaging**: Evaluating how well the phase is recovered from the center beam - **Method comparison**: Determining which reconstruction algorithm (ePIE, DM, ML) preserves more high frequency information - **Parameter optimization**: Finding optimal dose, overlap, or convergence angle by maximizing the PCTF The PCTF provides a rigorous, quantitative way to evaluate reconstruction quality beyond visual inspection. References - https://doi.org/10.1016/j.ultramic.2020.113189 - https://doi.org/10.1016/j.ultramic.2016.09.002 - https://doi.org/10.1016/j.ultramic.2014.09.013 - https://doi.org/10.1016/j.ultramic.2016.09.002