TEM · 4D-STEM

4D-STEM basics: one diffraction pattern at every probe position

Start by clicking anywhere on the sample map below and watch the diffraction pattern change between vacuum, three grains, a grain boundary and a precipitate. Then draw your own detector in widget 2 and see the image form from the same data.

What is 4D-STEM?

In scanning TEM (STEM) a focused probe steps across the sample. A normal STEM detector keeps one number per step. In 4D-STEM a fast pixel camera records the whole diffraction pattern at every step. Two scan coordinates (x, y) and two pattern coordinates (kx, ky) make a four-dimensional data set. Here: a 48 × 48 scan, 5 nm steps, 64 × 64 pixel patterns, 300 kV, of a thin aluminium foil.

The scan (48 × 48 positions, 240 nm across). Click or drag to move the probe. Dashed outline: the strained band of grain 1 (used in widget 3).
Diffraction pattern at the probe (64 × 64 pixels, 0.98 mrad per pixel, edge at 31 mrad). Each spot is a disc as wide as the probe's convergence angle.

Probe and camera

Map shows
Jump to

The 4D data set

Try it: press vacuum: only the central disc. Press grain 1 (a [001] zone axis: a square grid of spots), then grain 2 ([011]: a rectangle) and grain 3 ([111]: a hexagon). Press precipitate: extra weak spots appear halfway between the grain 1 spots. Then drag α above 4.9 mrad: the discs grow until the 200 discs touch the central disc.

What is a virtual detector in 4D-STEM?

Because every pattern is stored, you can choose the detector after the experiment. A virtual detector is a mask on the pattern: sum the counts inside it at every scan position and you get one image. A disc on the central beam gives bright field (BF). A ring outside it gives annular dark field (ADF). A small aperture on one Bragg spot gives virtual dark field: only the crystals that send electrons into that spot light up.

Pattern with the detector. Drag inside the coral shape to move it; drag its edge to resize. Click a spot to put a dark-field aperture there.
Virtual image, recomputed from all 2 304 stored patterns each time the detector moves. Click it to pick a probe position.

Virtual detector

Detector
Aperture on
Pattern shown
Try it: with bright field, vacuum is brightest and grain 2 darkest. Switch to annular DF: the contrast flips, vacuum goes black, and the precipitate is much brighter than grain 1 around it. Now press Al3Sc 100 spot: the precipitate is the brightest thing on the map, because only its ordered L12 lattice sends electrons to that spot. Press grain 2 111: only grain 2 lights up.

What can you compute from one 4D-STEM dataset?

A virtual detector keeps one number per pattern. Better methods use the whole pattern: match it to calculated patterns to find the orientation and phase, measure where the Bragg discs sit to get strain, or take the centre of mass (CoM) of the intensity to measure how far the beam was deflected by fields in the sample. All three run here on the same stored data set.

What to compute

Method

Template matching

Colour by
Try it: in orientation, the three grains come out red ([001]), green ([011]) and blue ([111]); switch to phase and only the precipitate is Al3Sc. In strain, the band reads close to the 0.50% you injected and the precipitate reads about +1.0% (its larger lattice, not a real strain; the fit reads it below its 1.32% misfit because its extra superlattice spots sit next to each disc); drop the electrons per pattern to 103 and the map turns to noise. In deflection, the thin wedge on the left shows a steady deflection close to the model line; grain 3 looks stronger still, but that is diffraction, not a field: switch to central disc only and it drops back to the noise floor.

How big is a 4D-STEM dataset, and how long does it take?

The size is (scan positions) × (pattern pixels) × (bytes per pixel). The time is scan positions divided by the camera frame rate. The dose is beam current × time per pattern, spread over one scan step. Pick a camera and a scan and read the three numbers off the bars.

Log-scale bars. Grey marks are reference points (computer memory, network links, minutes). The coral bar is your setting.
Example cameraPixelsFrame rateStored here asSource
EMPAD128 × 1281.1 kHz32 bitTate et al. 2016
4D Camera (NCEM)576 × 57687 kHz16 bit dense (counted data is stored sparse)Ercius et al. 2024
ARINA (hybrid pixel)192 × 192up to 120 kHz16 bit (an assumption)DECTRIS brochure 2022

Camera and scan

Try it: with the EMPAD example, a 256 × 256 scan of 128 × 128 patterns is 4.29 GB and takes 59.6 s. Switch to the 4D Camera: the same scan takes under a second but is 43.5 GB, and the camera sends 57.7 GB/s. Then slide the frame rate up with the current fixed: the dose per pattern falls in step, because each pattern gets less time.

What to remember

One pattern per probe position4D-STEM stores the full diffraction pattern at every scan step. Every normal STEM image is one virtual detector away.
Choose the detector afterwardsBF, ADF and dark field from any spot come from the same data. A dark-field aperture on a superlattice spot picks out one phase.
Small discs or sharp probes, not bothA larger α gives a smaller probe (0.61λ/α) but bigger discs, which here makes disc positions less precise and makes discs overlap above 4.9 mrad for Al 200.
Budget firstSize grows with N2 × pixels2. A fast camera shortens the scan, but the dose per pattern falls with it unless the current goes up.
More detail: how the synthetic data set is made, and the limits of the model

Geometry. 300 kV electrons, λ = 1.969 pm. Pattern pixel = 0.05 Å−1 = 0.98 mrad. Aluminium, a = 4.0495 Å; Al3Sc (L12), a = 4.103 Å, 1.32% larger (Knipling et al. 2006). The precipitate has the cube-on-cube orientation with grain 1 and is assumed to run through the whole foil. The foil is a wedge from the vacuum edge (thickness rises 1 nm per nm) to about 68 nm, then slowly to about 85 nm.

Intensities. Kinematic: each Bragg disc gets |F|2 t2/(1 + (π t s)2), with s the excitation error from Ewald-sphere curvature and specimen tilt, and a smooth limit on the total scattered fraction. Atomic scattering amplitudes use a rough rule (∝ Z0.8 with a Gaussian fall-off); relative intensities are only approximate. A broad diffuse halo stands for thermal diffuse and inelastic scattering and grows with thickness and Z. Disc edges are softened by a camera point-spread function (Gaussian, σ = 0.7 pixel). Counts are Poisson with no read noise (an ideal counting camera). Real patterns show dynamical contrast inside the discs, Kikuchi bands and higher-order Laue zones; the model has none of these.

Template matching (as in ASTAR/ACOM, Rauch and Véron 2014, and py4DSTEM, Savitzky et al. 2021): after subtracting a radial background, the square root of each pattern is correlated with kinematic templates for Al and Al3Sc along [001], [011], [111] and [112], at every in-plane angle in the chosen step. The best score gives zone, angle and phase. Real ACOM uses precession to make patterns less sensitive to small tilts.

Strain. For every pattern indexed as grain 1 ([001]), the centre of mass of each fundamental disc (inside a window of radius R + 2 pixels, background removed) is found, and a lattice (origin plus two reciprocal vectors) is fitted by weighted least squares. With M the fitted reciprocal basis and M0 the reference, I + ε = (M0 M−1)T. The reference is the median of the boxed unstrained region. Measured strain is relative to that reference, so a different lattice parameter (the precipitate) reads as "strain". Here it reads about 1.0%, not 1.32%: with its superlattice spots removed the same fit gives 1.35%, so the weak spots next to each disc bias the background and the centre. Zeltmann et al. (2020) show that patterned probes and cross-correlation beat plain discs on real data; this model has no dynamical disc contrast, so its precision is a best case for these pixels and counts.

Centre of mass. A slowly varying phase φ(x) = σV0t(x) tilts the beam by β = (λ/2π)∇φ = λσV0∇t/2π; at 300 kV σ = 6.53 × 10−4 rad V−1 Å−1, so a 1:1 wedge with V0 = 12 V gives 24.5 µrad. The whole pattern moves by β. V0 for aluminium is set here as an assumption; measured values for crystals are about 9 to 17 V (Si 9.26 V, MgO 13.01 V, PbS 17.19 V; Gajdardziska-Josifovska et al. 1993). The CoM noise is about √⟨k2⟩/N, which is why taking the CoM of the central disc alone (small ⟨k2⟩) is quieter and ignores uneven Bragg spots. Scan and descan: the vacuum mean is subtracted as the zero.

On this site: STEM detectors guide · Aberration correction · SAED pattern simulator · Grain orientations in reciprocal space · GPA strain mapping · Quantitative HAADF · Beam damage and dose · CBED thickness
Related chapters: EBSD 2: reading IPF maps · EBSD 6: TKD at the nanoscale · EBSD 8: KAM, GNDs and step size · Strengthening mechanisms

Questions people ask

What is 4D-STEM?

A STEM method in which a pixel camera records a full diffraction pattern at every probe position. The data set has two real-space and two reciprocal-space dimensions, hence "4D". It is also called scanning nanobeam electron diffraction when the probe is nearly parallel.

What is virtual dark field imaging?

You place a small software aperture on one diffraction spot and sum the counts inside it at every scan position. Only regions that diffract into that spot are bright. Unlike a real objective aperture, you can move it after the experiment and try many spots on one data set.

How is 4D-STEM orientation mapping different from EBSD?

EBSD reads Kikuchi patterns from the surface of a bulk sample in the SEM, with a step of tens of nm at best. 4D-STEM orientation mapping reads spot patterns through a thin foil in the TEM, with steps of a few nm. Both give orientation maps coloured the same way (inverse pole figure colours).

What convergence angle should I use for 4D-STEM strain mapping?

Small enough that the Bragg discs do not overlap (below λg/2 for the lowest-order spot, 4.9 mrad for Al 200 at 300 kV), and large enough that the probe is as small as you need. Nanobeam strain maps often use about 0.5 to 2 mrad, giving probes of one to a few nm.

How big is a 4D-STEM dataset?

Scan positions × pattern pixels × bytes per pixel. A 256 × 256 scan with 128 × 128 pixel, 32-bit patterns is 4.29 GB; the same scan with 576 × 576, 16-bit patterns is 43.5 GB. Counting cameras store only the electron hits, which is often far smaller.

What is the difference between DPC and centre-of-mass imaging?

Differential phase contrast (DPC) uses a detector split into segments and takes differences of their signals. Centre-of-mass imaging uses the full pattern from a pixel camera and computes its intensity-weighted mean position. Both measure how far the beam is deflected, which tracks electric or magnetic fields in the sample.

What software is used to analyse 4D-STEM data?

Open-source Python packages such as py4DSTEM (Savitzky et al. 2021), pyxem (Johnstone et al.) and LiberTEM do virtual imaging, disc finding, strain, orientation mapping, CoM and ptychography. Vendor software for ACOM (such as ASTAR) does template matching.

Does 4D-STEM give a higher dose than normal STEM?

Not by itself: the dose depends on beam current, dwell time and step size. Pixel cameras are slower than a normal STEM detector, so dwell times are often longer, but fast counting cameras now reach tens of kHz, and one low-dose scan can give many signals at once.

References

Show the 11 references
  1. C. Ophus, Four-dimensional scanning transmission electron microscopy (4D-STEM): from scanning nanodiffraction to ptychography and beyond, Microscopy and Microanalysis 25, 563 to 582 (2019), doi:10.1017/S1431927619000497. The review this page follows.
  2. B. H. Savitzky, S. E. Zeltmann, L. A. Hughes et al., py4DSTEM: a software package for four-dimensional scanning transmission electron microscopy data analysis, Microscopy and Microanalysis 27, 712 to 743 (2021), doi:10.1017/S1431927621000477.
  3. D. N. Johnstone, P. Crout, M. Nord et al., pyxem: an open-source Python library for multi-dimensional diffraction microscopy, Zenodo, doi:10.5281/zenodo.2649351.
  4. S. E. Zeltmann, A. Müller, K. C. Bustillo, B. Savitzky, L. Hughes, A. M. Minor and C. Ophus, Patterned probes for high precision 4D-STEM Bragg measurements, Ultramicroscopy 209, 112890 (2020), doi:10.1016/j.ultramic.2019.112890.
  5. E. F. Rauch and M. Véron, Automated crystal orientation and phase mapping in TEM, Materials Characterization 98, 1 to 9 (2014), doi:10.1016/j.matchar.2014.08.010.
  6. M. W. Tate, P. Purohit, D. Chamberlain et al., High dynamic range pixel array detector for scanning transmission electron microscopy, Microscopy and Microanalysis 22, 237 to 249 (2016), doi:10.1017/S1431927615015664. EMPAD: 128 × 128 pixels, 1.1 kHz, 106:1 dynamic range.
  7. P. Ercius, I. J. Johnson, P. Pelz et al., The 4D Camera: an 87 kHz direct electron detector for scanning/transmission electron microscopy, Microscopy and Microanalysis 30, 903 to 912 (2024), doi:10.1093/mam/ozae086. 576 × 576 pixels, 87 kHz, about 480 Gbit/s.
  8. DECTRIS, DECTRIS ARINA: an ultra-fast 4D STEM hybrid-pixel detector, product brochure (2022). 192 × 192 pixels, up to 120 000 frames per second.
  9. K. E. Knipling, D. C. Dunand and D. N. Seidman, Criteria for developing castable, creep-resistant aluminum-based alloys: a review, Zeitschrift für Metallkunde 97, 246 to 265 (2006). Al a = 4.0496 Å, Al3Sc a = 4.103 Å, misfit +1.32%.
  10. M. Gajdardziska-Josifovska, M. R. McCartney, W. J. de Ruijter, D. J. Smith, J. K. Weiss and J. M. Zuo, Accurate measurements of mean inner potential of crystal wedges using digital electron holograms, Ultramicroscopy 50, 285 to 299 (1993).
  11. E. J. Kirkland, Advanced Computing in Electron Microscopy, 3rd ed., Springer (2020): electron wavelength, the interaction parameter σ and STEM probe formation.
Cite this page: Tripathy, Manisha. “4D-STEM Basics.” untethered atom, 2026, https://untetheredatom.com/tem/4d-stem-basics.
BibTeX
@misc{tripathy2026fourdstem,
  author = {Tripathy, Manisha},
  title  = {4D-STEM Basics},
  year   = {2026},
  howpublished = {\url{https://untetheredatom.com/tem/4d-stem-basics}},
  note   = {Interactive web tool}
}
Last updated 24 September 2026.