PySTEMLab

4D-STEM · EDS · electron PDF

Every probe position holds a diffraction pattern. PySTEMLab turns them into maps you can question.

PySTEMLab is an interactive environment for four-dimensional scanning transmission electron microscopy, developed at Ben-Gurion University of the Negev. It takes raw scans with simultaneous HAADF and EDS signals through centring, region selection, classification, nucleus detection and pair-distribution-function analysis, with every step inspected by eye and reproducible by script.

Live app link coming soon Watch the tour
14
linked dashboards, from raw scan to G(r)
4
independent ways to classify a film, compared on one region
6
successive scans of a Ge–Sb–Te film read as a dose series
0–30 V
bias series of a second film, from amorphous to polycrystalline

Workflow

One project, seven steps, the same region throughout

A project holds the scans and their calibration once; every dashboard then works on the same region of interest, so classes, nuclei and PDFs from different methods can be compared probe position by probe position.

  1. Project managerEMD and MRC scans, detector calibration, EDS cube
  2. Shift & Maskcentre every pattern, mask the bright-field disc
  3. Region of interestdraw the analysis window once, used everywhere
  4. Virtual detectorbright-field, annular and max-intensity images, any pattern on click
  5. ClassifyI(q) phase mapping, PCA and SimCLR clustering, HAADF–EDS correlation
  6. Nucleus markerBragg-contrast detection, hand correction, grain segmentation
  7. PDF explorerAu-calibrated electron G(r) for every class

Tour · recorded in the real software

PySTEMLab at work on a Ge–Sb–Te scan

Each clip is an unedited screen recording of PySTEMLab running on scan 0033 of the dose series (110 × 45 probe positions, 256 × 256 patterns, simultaneous HAADF and EDS). Buttons are pressed, the computation runs, and the results appear. Press play on any clip.

InspectClick anywhere on the scan to see the diffraction pattern recorded at that probe position: the Au cap at the top, the amorphous film, and Bragg spots where a nucleus sits.Full-size screenshot
Virtual DetectorAnnular virtual detectors on the full 256×256 patterns, with the azimuthal I(q) of the mean pattern showing the detector band.Full-size screenshot
Nucleus MarkerAutomatic Bragg-contrast detection outlines the crystalline nuclei (8 objects in this scan); the expert then adopts, merges or corrects them by hand.Full-size screenshot
Component AnalysisNon-negative matrix factorisation of all 4,950 patterns into five components, with their maps and basis patterns, in a few seconds.Full-size screenshot
Phase MappingAzimuthal I(q) of every pattern → PCA → 3D UMAP → clustering. Classes appear on the UMAP, on the scan and as mean EDS spectra.Full-size screenshot
Correlation ExplorerHAADF against summed EDS for every probe position, split into bands of equal HAADF intensity, each with its mean pattern and spectrum.Full-size screenshot
Cluster ExplorerWhole-pattern PCA → UMAP → spectral clustering into seven classes, linked to the scan map, mean I(q), EDS and class patterns.Full-size screenshot
PDF ExplorerElectron pair distribution functions G(r) of every class, from Au-calibrated mean patterns, with I(Q), S(Q) and F(Q).Full-size screenshot

Try it · computed in your browser

A virtual detector on real 4D-STEM data

These are measured data, binned four-fold in each detector direction so they fit in a web page. Move over the map to see the diffraction pattern at each probe position, click to pin it, and drag the rings on the pattern to build your own annular detector. The image on the left is recomputed from thousands of patterns every time you move a ring. This is the same operation PySTEMLab's Virtual Detector dashboard performs on the full-resolution data.

Data set
Image

Loading…

Real space

Diffraction

Patterns on a logarithmic scale. The dark centre is the masked bright-field disc. Ring radii in scattering vector q, calibrated on the Au cap.

Live app

Use PySTEMLab itself

The full application runs on our lab workstation and is reachable from the web. It opens on the same Ge–Sb–Te data shown above, so every dashboard in the tour can be tried with its own controls.

Live app link coming soon