Interactive demos
Every interactive demo in the course, in teaching order. Each one also appears in its unit’s exercise, together with questions to explore.
The course map
All days, their prerequisites and a learning path to any unit. Page: Course overview.
Transforming an image with a 2×2 matrix
Drag the two columns of the matrix and watch the image follow. Unit: Images as arrays & geometric transforms.
3×3 kernels
Edit nine weights and see the filtered image live; click a pixel to see the weighted sum. Unit: Filtering & convolution.
Build a wave from five frequencies
Unit: Images in frequency space.
Filter an image in frequency space
Keep or remove parts of the 2D spectrum and see the image rebuilt. Unit: Images in frequency space.
The shape of a point cloud: PCA
Drag the points of a cloud of two-pixel images and a direction through it: centring, the covariance ellipse, the principal components, projection and reconstruction error. Unit: Principal component analysis.
Smoothing before differentiating
A noisy 1D profile, its finite difference and its derivative-of-Gaussian response, with the kernel drawn to scale. Unit: Edges: Gaussian derivatives and Canny.
Canny step by step
Smoothing, gradient, non-maximum suppression and hysteresis, with a click-a-pixel inspector and the hysteresis flood replayed ring by ring. Unit: Edges: Gaussian derivatives and Canny.
A 1D scale space
The blurred signal, slope or curvature for all σ at once, and each bump picking its own scale. Unit: Scale space, blobs and pyramids.
Blobs over scales
Scale-normalised LoG and DoG blob detection in (x, y, σ), circles of radius √2·σ against the truth, and image pyramids. Unit: Scale space, blobs and pyramids.
The Hessian per pixel
Eigenvalues of the Hessian classify every pixel as blob, ridge, saddle or flat; trace, determinant and multi-scale vesselness. Unit: The Hessian: blobs, ridges and saddles.
The structure tensor
Orientation, coherence and corners from the averaged outer product of gradients, with the gradient cloud of any window. Unit: The structure tensor.
Quantisation and dithering
Round an image to 1–8 bits, with or without dither, and see the error and its histogram. Unit: Quantisation & bit depth.
How many bits does a camera need?
A simulated camera (full well, read noise, ADC bits, exposure) and its noise-versus-signal plot. Unit: Camera noise, SNR and PSNR.
Showing a 12-bit image: windows, wrap-around, CT windows
Tone curves: point operations as curves
A curve from raw value to display level over the input histogram: window, gamma, log, S-curve, a free curve, negative, threshold. Stretching 8-bit data leaves a comb; 12-bit data does not. Unit: Contrast and intensity transforms.
Histogram equalisation and matching
The cumulative histogram as the mapping, why the result is only roughly flat, exact (rank) equalisation, and matching to another histogram. Unit: Contrast and intensity transforms.
CLAHE: local, clipped equalisation
One curve per tile, blended between the four nearest tile centres; the clip limit caps the contrast gain and the noise. Unit: Contrast and intensity transforms.
Display vs data: what transforms do to measurements
A control and a treated image under the same transform, with the treated/control ratio measured on the display or on the raw data. Unit: Contrast and intensity transforms.
The bits of a float
Unit: Floating point.
Summing many pixels in float32 and float16
Unit: Floating point.
PSF and OTF of a microscope
Change the NA, the wavelength, defocus or motion and watch the PSF, the OTF with its cut-off 2NA/λ, and the blurred object. Unit: Image formation and the point spread function.
Two points on a pixel grid
Move two points together, change the pixel size and the photon count, and see when the dip disappears and when a grating aliases. Unit: Resolution, sampling and measuring the PSF.
The axial PSF: widefield and confocal
The xz slice of the 3D PSF, sampled with a z-step of your choice; the lateral and axial widths and the axial Nyquist step. Unit: Resolution, sampling and measuring the PSF.
Measuring a PSF from beads
Average 1 to 30 noisy beads after background subtraction and sub-pixel centring, and compare the result with the true PSF. Unit: Resolution, sampling and measuring the PSF.
Deconvolution lab
Blur a test object, add noise and restore it with the inverse filter, a truncated inverse, Wiener or Tikhonov, reading each method from its gain curve. Unit: Linear deconvolution.
The regularisation path
A 1D profile restored with data term + λ · penalty (energy, roughness, total variation, non-negativity) or by stopping an iteration early, with the L-curve and the discrepancy principle. Unit: Regularisation.
Richardson–Lucy step by step
Scrub through the iterations of Richardson–Lucy on photon-count data: semi-convergence, a forgotten background, a wrong PSF and blind deconvolution. Unit: Richardson–Lucy, 3D, and the PSF.
3D deconvolution and the missing cone
A widefield or confocal 3D stack restored with 3D Richardson–Lucy: beads sharpen in z, a horizontal sheet stays smeared. Unit: Richardson–Lucy, 3D, and the PSF.
Denoisers compared
Gaussian, median, bilateral, non-local means and Wiener, each judged by what it destroys, with the method noise. Unit: Denoising and what you may measure.
What may be measured after restoration
A field with known truth: integrated intensities hold, while peaks, sizes, separations and counts change with the restoration. Unit: Denoising and what you may measure.
Histogram and a global threshold
Drag a threshold over the histogram, add noise and smoothing, and watch the mask and its area change. Unit: Histograms & a global threshold.
Otsu by hand
Drag the bars of an 8-level histogram and watch the between-class variance table and the isodata steps. Unit: Choosing the threshold.
Two Gaussians, six thresholds
Compare Otsu, isodata, minimum error, triangle, maximum entropy and the Bayes boundary on a two-class mixture. Unit: Choosing the threshold.
Local thresholds under uneven illumination
Global Otsu, background division, mean − C, Niblack and Sauvola on a shaded image with ground truth. Unit: Local thresholds & hysteresis.
Hysteresis thresholding
Two thresholds, keeping only what is connected to a sure seed: in 1D and on faint filaments. Unit: Local thresholds & hysteresis.
ROC and precision–recall
Confusion matrix, Dice and the ROC and precision–recall curves of a threshold sweep against ground truth. Unit: Evaluation against ground truth.
From a spectrum to three numbers
Draw a spectrum and see what the eye, a camera or a colour-blind viewer makes of it; make metamers and watch them break under another lamp. Unit: From a spectrum to three numbers.
The chromaticity diagram
Mix two lights on the xy diagram, or design a display from three primaries and a white point. Unit: From a spectrum to three numbers.
Blur in linear light
The same blur or downsampling on gamma-encoded codes and in linear light: 128 or 188? Unit: RGB: gamma, linear maps and white balance.
Colour as a matrix
Y′CbCr with chroma subsampling, greyscale as a choice of weights, and any 3×3 matrix on linear RGB. Unit: RGB: gamma, linear maps and white balance.
White balance
A spectrally rendered colour chart under different lamps, corrected by grey world, white patch or a grey card in different bases, scored by ΔE against daylight. Unit: RGB: gamma, linear maps and white balance.
The colour cloud
An image’s pixels as a rotatable 3D point cloud that morphs between sRGB, linear RGB, XYZ, Y′CbCr, HSV and CIELAB. Unit: HSV, CIELAB and colour segmentation.
Colour segmentation
RGB thresholds, a hue wedge, a ΔE ball, Otsu on one channel or k-means: which space makes the red apple a simple region? Unit: HSV, CIELAB and colour segmentation.
Colour maps
Jet versus viridis with the lightness profile underneath, diverging maps for signed data, channel merges and a dichromat simulation. Unit: Colour for display.
PCA of the colour cloud
The principal axes of an image’s colour cloud and a decorrelation stretch. Unit: Colour for display.
Erosion and dilation step by step
Paint a small binary image, edit the structuring element and its origin, and step through erosion, dilation, boundaries and duality pixel by pixel. Unit: Erosion and dilation.
Opening and closing step by step
The same grid with opening, closing, both orders, and an opening applied twice. Unit: Opening, closing and the distance transform.
The two-pass distance transform
Step through the forward and backward passes of the city-block or chessboard distance transform and read off an erosion as a threshold. Unit: Opening, closing and the distance transform.
Granulometry
Open a binary image with discs, squares or lines of growing size and watch the area left and the pattern spectrum, a size histogram without segmentation. Unit: Opening, closing and the distance transform.
Rolling the SE along a profile
Push a flat or non-flat structuring element under or over a 1D profile and compare erosion, dilation, opening, closing, top-hats, gradient and median. Unit: Grey-level morphology: top-hat and gradient.
Top-hat on an uneven background
Remove a sloping, vignetted background with a top-hat and count the spots one threshold finds, before and after. Unit: Grey-level morphology: top-hat and gradient.
Reconstruction in 1D
Grow a marker under a 1D signal one geodesic dilation at a time: reconstruction, h-maxima, h-minima and minima imposition. Unit: Reconstruction and h-extrema.
Reconstruction on images
Fill holes, clear the border, open by reconstruction, and find one regional maximum per nucleus with the h-maxima transform. Unit: Reconstruction and h-extrema.
Connectivity pairs: the digital topology paradox
Choose the connectivity of the objects and of the background separately, and see a closed diagonal curve stop separating its inside from the outside. A 3D tab does the same with 6/18/26 voxels. Unit: Connectivity and labelling.
Labelling step by step
Flood fill with a queue or a stack, two-pass labelling with its equivalence table, and run-based labelling on a small editable grid. Unit: Connectivity and labelling.
Union–find forests
Watch naive unions build a chain, and union by rank and path compression keep the trees flat. Unit: Connectivity and labelling.
Moments of a shape
Edit a shape on a pixel grid. See its centroid, second-moment matrix, eigenvectors, equivalent ellipse, Euler number, and three perimeter estimates against the exact value at every resolution. Unit: Region properties and moments.
Shape features
Convex hull and solidity, form factor, Feret diameters with rotating calipers, inscribed and enclosing circles, and Fourier outlines. Includes a units switch, anisotropic pixels and mask-error controls. Unit: Shape features.
Filter and count objects
A pipeline from threshold to count, with a measurement table and a scatter plot linked to the label image. Brush a rectangle to filter objects, and compare border rules, including the unbiased counting frame. Unit: Working with label images.
Flooding a profile
Raise the water level over a 1D landscape and watch basins fill and dams appear; fill shallow basins with h, flood the derivative, or place markers. Unit: Images as landscapes: watershed by flooding.
Priority-queue flooding step by step
Pop one pixel at a time from the queue and see the decision, the queue and the watershed line; compare 4 and 8 neighbours, FIFO and LIFO. Unit: The flooding algorithm on a grid.
Watershed of an image
Flood the gradient of a test image or a micrograph and fight oversegmentation with smoothing, h-minima and clicked markers; replay the flooding. Unit: Watershed segmentation of a real image.
Splitting touching discs with the distance transform
Drag two discs together and see when the neck of the distance transform is deep enough to split them; ellipses, holes, metrics and a nuclei image. Unit: Splitting touching objects with the distance transform.
Intensity features of one cell
Six cells with the same mask and the same total signal. Change the background offset, gain, noise, saturation and mask error, and watch the mean, median, MAD, edge/mean ratio, mass displacement and radial rings respond. The population and plate tabs add per-well aggregation and robust z normalisation. Unit: Intensity inside an object.
The grey-level co-occurrence matrix
Count pairs of pixels at a chosen distance and angle, and compare contrast, homogeneity, ASM, entropy and correlation for two texture patches, including two with the same histogram. Unit: Texture: co-occurrence matrices.
Neighbours, parents and children
Count neighbours in a cell population under three definitions, compare nearest-neighbour distances with a random pattern (Clark–Evans), handle objects at the image border, and assign spots to nuclei or cells. Unit: Neighbours, parents and children.
Sliding and scoring
Slide one signal over another and watch SSD, cross-correlation and NCC being drawn, each fooled in its own way. Unit: Finding a shift by sliding and scoring.
Template matching
Drag a template over a micrograph and see its NCC map and best matches. Unit: Finding a shift by sliding and scoring.
Cross-correlation with the FFT
The FFT computes the correlation for every shift at once: compare it with brute force, see wrap-around and padding, and watch each frequency vote. Unit: Cross-correlation with the FFT.
Phase correlation
Register two crops of a micrograph by cross-correlation, phase correlation or NCC, under noise, uneven light and without a taper. Unit: Phase correlation.
Stitching a mosaic
Nine tiles at jittered stage positions: pairwise shifts, the four candidates, chaining versus global least squares, wrong pairs and blending. Unit: From a peak to a mosaic.
Sub-pixel peaks
Parabola, centroid and upsampled DFT on a peak whose true position is known exactly, with the error for every fraction of a pixel. Unit: From a peak to a mosaic.
Drift correction
Correct the drift of a time-lapse by registering to the first frame, the previous one or key frames, and the drift of a localisation-microscopy acquisition from time blocks. Unit: From a peak to a mosaic.
The energy of a line profile
Segment a noisy 1D profile: thresholding against the labelling with the smallest energy, found exactly by dynamic programming. Unit: Segmentation as energy minimisation.
Maximum flow, one augmenting path at a time
Step through Ford–Fulkerson on a small graph, see the residual graph, and the minimum cut at the end. Unit: Graphs, cuts and maximum flow.
The graph of a small image
Pixels as nodes, t-links and n-links with their capacities, and the minimum cut; make your own cut and compare. Unit: Graph-cut segmentation.
Interactive graph cut
Paint object and background seeds and see the segmentation update. Unit: Graph-cut segmentation.
Graph cut on a micrograph
The same graph cut on a real fluorescence image of nuclei, at 128², 256² or 512² pixels, with the maximum flow solved in WebAssembly; a few strokes segment every nucleus. Unit: Graph-cut segmentation.
Fiedler vectors and normalized cuts
Split points or a small image with the second eigenvector of the graph Laplacian. Unit: Spectral partitioning and normalized cuts.
Grow a decision tree
Add points of two or three classes, grow a tree split by split, read the split scan and the error against depth, or fit a step function to an edge profile. Unit: Decision trees.
Bootstrap and averaging
Draw bootstrap samples and count the points left out, and see why averaging correlated predictors stops at a floor. Unit: Bagging and random forests.
A forest in the plane
Many trees on bootstrap samples vote: probability map, single trees, out-of-bag and test error, and the effect of the features tried per split. Unit: Bagging and random forests.
Feature importance
Impurity and permutation importance of a forest on a table of cell measurements, with duplicated and correlated features. Unit: Forests on feature tables, and feature importance.
Paint and classify pixels
Paint a few strokes, and a forest on a multiscale feature stack labels every pixel; look at the uncertainty, correct, and evaluate on a held-out region. Unit: Pixel classification with a forest.
Fit a line scan with a small neural network
Train a 1 → H → 1 ReLU network live and watch the hinges move. Unit: Neural networks.
Classify points with a small neural network
Change the hidden layers, units and activation and watch decision regions and per-unit thumbnails form as the network trains. By hand, drag a single neuron’s line; with the training controls, see overfitting on validation curves. Units: From a neuron to a network, Learning.
Backpropagation step by step
A two-neuron network drawn as a computational graph: forward values, backward gradients with each edge’s local derivative, one update, and a finite-difference check. Unit: Learning: loss, gradient descent and backpropagation.
Gradient descent on a loss landscape
Start paths on a two-parameter loss and compare learning rates, mini-batch noise, momentum and starts in different valleys. Unit: Learning: loss, gradient descent and backpropagation.
One convolutional layer
A bank of eight 3×3 kernels, hand-made or learned, with their feature maps after ReLU. Shift the input or pool the maps. Unit: Convolutional networks.
Receptive fields of stacked layers
Stack convolutions, pooling and dilated convolutions, then click a unit to see which input pixels it depends on. Unit: Convolutional networks.
Inside a trained convolutional network
Draw or rotate a digit and follow it through a small trained CNN: feature maps, class probabilities, each unit’s favourite patches, occlusion maps, and training with and without augmentation. Unit: Convolutional networks.
A U-Net segments nuclei
A tiny trained U-Net against Otsu’s threshold on synthetic nuclei. Shows errors, Dice and feature maps, and the effect of removing skip connections, using a Dice loss, and domain shift. Unit: Segmentation networks.
Matching predicted objects to true objects
Predicted nuclei from an error generator (jitter, outline bias, merges, splits, misses, specks) or edited by hand, matched to the truth at an IoU threshold: IoU table, greedy vs optimal matching, F1 against τ next to the pixel Dice, the PR curve and AP, and a second annotator as the ceiling. Unit: Matching objects: IoU, F1 and average precision.
Correlation is not agreement: the Bland–Altman plot
Automated against manual counts (or object areas) with bias, scatter and proportional bias: the scatter plot with r, the ratio, and the Bland–Altman plot with bias and limits of agreement. Unit: Boundaries, counts and the uncertain ground truth.
Hausdorff distance and average surface distance
Drag a predicted outline, add a thin spike or a stray fragment, and compare IoU, Hausdorff, HD95 and the average surface distance; the radius slider keeps the pixel error and changes the object size. Unit: Boundaries, counts and the uncertain ground truth.
Five ways to split: leakage in validation
A k-nearest-neighbour pixel classifier on twelve images from four days, tested with random pixels, random blocks, blocks with a buffer, by image and by day; with random labels, random pixel splits still score 78 %. Unit: Honest validation: leakage, splits and domain shift.
Peeking at the test set
Pick the best of k equally good settings on a test set and see how much the reported score overstates a fresh re-test; a validation set removes the optimism. Unit: Honest validation: leakage, splits and domain shift.
Pseudoreplication: cells, experiments and pairs
A simulated two-condition experiment shown as a SuperPlot, analysed with cells as n, experiment means as n and paired means, with false-positive rates and power over 1000 repetitions. Unit: From measurements to claims.
Many features on a plate: multiple testing and confounding
Hundreds of features tested on a well plate with gradients and edge effects: p-value histogram, sorted p-values with the uncorrected, Bonferroni and Benjamini–Hochberg lines, and a layout confounded with the plate gradient. Unit: From measurements to claims.
Optimiser race
Plain gradient descent, momentum and Adam side by side on a long valley, a saddle, a curved valley and a noisy bowl, each with its own learning rate; schedules and a loss scale factor. Unit: Optimisers and learning rates.
A deep stack
Size of the activations and gradients through up to 50 layers: initial scale, bend, batch or layer norm, residual connections. Unit: Initialisation, normalisation and residual connections.
Augmentation explorer
Flips, zoom, rotation, elastic deformation, intensity, blur and noise applied live to a micrograph; random copies. Unit: Regularisation and data augmentation.
The curve doctor
Eight recorded training runs to diagnose (overfitting, bugs, learning rate, imbalance), with their fixes. Unit: Reading training curves.
PCA as a linear autoencoder
Turn a one-number linear autoencoder on two-pixel images; train a nonlinear one on a curve. Unit: From PCA to autoencoders.
The VAE loss in one dimension
Move the encoder’s cloud and see reconstruction, KL and their sum. Unit: The variational autoencoder.
Generating images with a VAE
Encode, decode, walk and sample in the 2D latent space of handwritten digits and of synthetic cell shapes. Unit: Generating and exploring images.
Four instance maps on one image
Simulated network outputs (boundary class, distance, star-convex polygons, flows) turned into objects, with error sliders and merges/splits counted. Unit: From masks to objects.
Boxes, IoU and non-maximum suppression
Drag boxes to see IoU, step through greedy NMS on touching cells, and compare anchors with centre heat maps. Unit: Finding objects as boxes.
A GAN in one dimension
A line generator against a quadratic discriminator, trained live: the data and generator densities, the discriminator against the best one, the path of the generator’s parameters, and the losses. Unit: Generative adversarial networks.
One pixel, three translators
What translators trained with squared error, absolute error or as a conditional GAN output where the input does not decide the target, and what unpaired training can reach; scored against held-out truth, including treated cells. Unit: Image-to-image translation and hallucination.
A normalising flow, layer by layer
Six affine coupling layers trained on two moons, stepped through: data pushed towards a Gaussian layer by layer, the exact density, samples, and a probe point’s log-likelihood. Unit: Normalising flows.
Self-attention on patches
Click a patch to see its attention weights over the whole image next to a convolution’s fixed footprint, and the image after one attention layer. Unit: Attention, transformers and pretrained models.
Frozen features and a linear probe
Paint a few strokes and train a probe on raw patches, the filter stack or a small self-supervised encoder; click for similarity or a prompt mask. Unit: Attention, transformers and pretrained models.
Calibration and temperature
A reliability diagram of a simulated classifier: make it overconfident, fix it with a temperature, then shift the domain. Unit: Attention, transformers and pretrained models.
Diffusion in 2D
Watch point clouds melt into noise and come back by repeated denoising, with exact or learned scores, few or many steps, conditioning and guidance. Unit: Diffusion models and generated detail.
Which details are real?
Restore a blurred cell with an exact generative prior: the posterior mean is blurry and honest, the samples are sharp and invent nucleoli. Unit: Diffusion models and generated detail.
Rays, polygons and decoding
A star-convex polygon from a few rays: drag the centre, change the number of rays, and see the missed and extra pixels; then decode a simulated network output by threshold and polygon non-maximum suppression, step by step. Unit: Star-convex polygons.
Masked image modelling in miniature
Hide 6 × 6 patches (or single pixels) of synthetic nuclei or the micrograph and fill them by interpolation or by a PCA window model learnt without labels; PSNR on the hidden pixels. Unit: Pretext tasks and masked image modelling.
Contrastive learning on a circle
A tiny encoder trained live with InfoNCE on 64 synthetic cells: choose the augmentations, the temperature and the negatives, and see what the embedding keeps (shape, brightness) or how it collapses. Unit: Contrastive learning.
Noise2Void with a linear filter
A 5 × 5 filter trained on one noisy image: blind spot, no blind spot, Noise2Noise or a clean target; put the pixel back; correlated noise and stripes; compared with a Gaussian blur and non-local means. Unit: Self-supervised denoising.
StarDist: the real network
The trained StarDist network running in the browser: probability, ray lengths, every candidate polygon, the polygons left after suppression and the label image, on sample micrographs or your own image. The network weights are downloaded once (about 6 MB). Unit: Star-convex polygons.
Following the arrows
Flow fields from heat diffusion inside each object: every pixel follows the arrows to its object’s centre, and pixels that meet are one object. Unit: Flow fields to objects.
Cellpose: the real network
The Cellpose 3 network running in the browser: predicted flows and cell probability, the paths pixels take, the masks and the flow check, on sample images or your own. The network weights are downloaded once (about 13 MB); press Run. Unit: Flow fields to objects.
YOLO: the real network
A small single-shot detector running in the browser: raw candidates on three grids, score maps, the distance distributions of one box, and non-maximum suppression, on photos and on micrographs, where it fails. The network weights are downloaded once (about 5 MB). Unit: From an image to a list of objects.
Decoding a simulated detector
Click a grid cell to see its four distance distributions and class scores, the decoded box and its overlap with the true box; step through non-maximum suppression and count the errors. Unit: From an image to a list of objects.
Promptable segmentation: the real network
A promptable segmentation network running in the browser: click or draw a box, get three candidate masks with their scores, or let a grid of clicks segment the whole image. The network weights are downloaded once (about 78 MB) and encoding an image takes tens of seconds. Unit: Promptable segmentation.
A promptable toy you can open up
A synthetic image with nucleoli, nuclei and groups: one click gives three candidates (part, object, group), with negative clicks, boxes and automatic masks, and every step visible. Unit: Promptable segmentation.
Networks against a classical pipeline
Seven annotated images: a classical pipeline with sliders, and the three real networks on the same images, all scored against the annotation with F1 curves, merges and splits. Unit: Networks and classical pipelines compared.
Transfer learning: four strategies side by side
A small network pretrained on four shapes learns three cell phenotypes from a few labels: frozen backbone + new head, last layers tuned, all layers tuned, and from scratch, trained live with curves, weight counts and the old task’s accuracy. Unit: Transfer learning.
Low-rank changes of a weight matrix
A weight change, its best rank-r approximation B·A and what is left out, with the singular values, the numbers to store and the error; two presets use the real change made by fine-tuning a small network. Unit: Fine-tuning strategies.
Active learning: which cell next?
A pool of unlabelled cells with a rare subtype; label at random, the most uncertain, the most different, both, or the model’s mistakes, or click cells yourself, and compare learning curves. Unit: Few labels: annotation and the human in the loop.
Domain shift: two microscopes
A classifier trained on microscope A meets microscope B: a shift slider, the class balance, and four remedies (normalisation, augmentation, fine-tuning on 10 cells) with accuracy against shift and a shift score that needs no labels. Unit: Domain shift and adaptation.
Hit-or-miss and thinning on a grid
Fit three-state templates (1, 0, don’t care), thin a shape template by template, and check which pixels are simple. Unit: Hit-or-miss and thinning.
Medial axis: maximal discs and the grassfire
Drag a shape’s corners and see its distance transform, its medial axis by three methods, the grassfire front, and the shape rebuilt from the axis discs. Unit: Medial axis, distance transform and reconstruction.
From skeleton to graph: pruning and length
Turn a skeleton into nodes and edges, prune the spurs, and compare three length estimators on lines at any angle. Unit: From skeleton to graph: pruning and length.
Measuring neurons and vessel networks
Run vesselness, threshold, skeleton and graph on a synthetic neuron or vessel tree and compare length, branch points, Sholl profile, radius and tortuosity with the known truth. Unit: Measuring neurons and vessel networks.
Moments of any order
The labelling day’s shape canvas with moments up to order 4: the triangle of moments, the marginals, skewness and kurtosis, a pixel as a point or a square. Unit: Moments as projections onto monomials.
Which moments survive a transformation?
A reference shape and a moved, scaled, rotated or mirrored copy: raw, central and normalised moments and Hu’s seven invariants side by side, with pose normalisation. Unit: Normalisation and moment invariants.
Complex moments as turning arrows
Rotate a shape and watch each complex moment turn (p − q) times as fast; mirror it and every arrow is reflected. Unit: Normalisation and moment invariants.
Monomials, Gram–Schmidt and Legendre polynomials
Why monomials are a poor basis: their Gram matrix and condition number, Gram–Schmidt step by step, and 1D fits that break down in finite precision. Unit: Better bases: Legendre moments and reconstruction.
Rebuild an image from its moments
An image reconstructed from its moments up to order N with monomials, Legendre and Zernike polynomials, against a Fourier low-pass with the same number of coefficients. Unit: Better bases: Legendre moments and reconstruction.
Zernike polynomials and rotation
The Zernike pyramid with radial profiles and optics names, and a rotated copy of an image whose |Z_nm| stay while the phases turn. Unit: Zernike moments on the unit disc.
Point patterns and complete spatial randomness
Seeded point patterns (CSR, clusters, hard core, lattice, gradient, colonies): quadrat counts with the variance-to-mean ratio and the χ² test, the ratio against quadrat size, kernel intensity, “which one is random?”, and points detected from a rendered spot image. Unit: Point patterns and complete spatial randomness.
Nearest neighbours and empty space: G, F and J
Nearest-neighbour (G), empty-space (F) and J functions against CSR; border correction with the guard zone, small windows and thin tissue bands. Unit: Nearest neighbours and empty space.
Ripley’s K, the L function and the pair correlation
K, L − r and the pair correlation g with a probe disc and ring; edit your own pattern; no, border, translation and isotropic edge corrections and their bias. Unit: Ripley’s K, the L function and the pair correlation.
Simulation envelopes and global tests
Pointwise against global (MAD) simulation envelopes, how often CSR is falsely rejected, and comparing conditions with images or experiments as n. Unit: Is it more than chance? Simulation envelopes.
Two cell types and an uneven density
Two cell types in a tissue: cross-L, mark connection and inhomogeneous L against relocation, permuted labels or inhomogeneous Poisson nulls; tissue mask against the whole image. Unit: Two cell types and an uneven density.
Runge’s phenomenon
One polynomial through n samples against piecewise-linear and the natural cubic spline; equispaced or Chebyshev nodes, draggable samples. Unit: Polynomial wiggles, piecewise cubics and Bézier curves.
De Casteljau and Bézier joins
The de Casteljau construction with the Bernstein weights, convex hull and curvature comb, and a second piece joined with C⁰, G¹ or C¹. Unit: Polynomial wiggles, piecewise cubics and Bézier curves.
B-spline basis functions
Basis functions on draggable knots (degree 0–3), their sum, the Cox–de Boor tower and repeated convolution of boxes. Unit: B-splines and NURBS.
B-spline and NURBS curves
Local control against a single Bézier, knot types, weights and exact circles and conics. Unit: B-splines and NURBS.
Interpolate, approximate, smooth
Noisy samples fitted by an interpolating, a least-squares and a smoothing spline, with the leave-one-out error and the effective number of parameters against λ. Unit: Interpolating, approximating and smoothing splines.
Smooth outlines from pixels
A closed smoothing spline on a pixel outline: length by edge count, chain code and spline, curvature along the outline, and Fourier descriptors for comparison. Unit: Interpolating, approximating and smoothing splines.
Image interpolation beyond bilinear
Nearest, bilinear, cubic convolution and the cubic B-spline (with and without prefilter): zoom, repeated rotation and frequency responses. Unit: Splines on images.
Free-form deformation
Drag the control points of a cubic B-spline deformation grid; the deformed image and the Jacobian determinant, with folding. Unit: Splines on images.
Active contours (snakes)
A closed chain of beads pulled by elastic and rigid internal forces and by the edge map, with GVF and balloon forces and the snake matrix on demand; from the units Active contours and The snake as a linear system.
The modes of a snake
The internal forces as a circulant matrix: eigenvalues per wave around the curve, the factor per step of the explicit and semi-implicit updates, and the contour’s own modes dying out; from the unit The snake as a linear system.
Procrustes alignment
Align one landmark set onto another step by step (centre, scale, rotate) with the 2D closed form, with reflection and rigid options, and generalised Procrustes on a training set; from the unit Shape models.
A point distribution model
PCA of aligned landmark shapes (hands, nuclei, leaves): modes of variation with ±3√λ sliders, alignment and correspondence failures, and projecting a dragged shape onto the model; from the unit Shape models.
Active shape model search
Suggest points along the normals, fit the pose, project and clamp, coarse to fine, with noise, occlusion and a snake for comparison; from the unit Active shape models.
Slicing a surface: curves as level sets
Cut the surface z = φ(x, y) at height c and watch contours split and merge; click for the normal and the curvature. Unit: Curves as level sets.
Moving fronts: the level set equation
Move curves with constant speed and curvature flow, see merging, splitting, swallowtails, the CFL limit and reinitialisation. Unit: Moving a curve: the level set equation.
Geodesic active contours
A front that brakes at edges and is pulled into them: shrink-wrap several objects, leak through a weak edge, get stuck in a concavity. Unit: Edge-based segmentation: geodesic active contours.
Chan–Vese: segmentation by regions
Two means and a short boundary: robust to noise and blur, λ = 0 is thresholding, holes appear, bad starts get stuck. Unit: Region-based segmentation: Chan–Vese.
The DP table, step by step
Fill the table of cheapest paths cell by cell, see the candidates and pointers, backtrack, and compare with the greedy path and the number of paths. Unit: The DP principle: minimal paths on a grid.
Boundaries in polar coordinates
Unwrap the image around a draggable centre and find the best closed boundary by DP, with smoothness, edge polarity and three ways to close the curve. Unit: Closed boundaries: DP in polar coordinates.
Dijkstra step by step
The same grid without a fixed order: the smallest tentative pixel becomes final, the queue is shown sorted, and one raster pass is shown failing on a detour. Unit: When there is no order: Dijkstra and live-wire.
Live-wire
Click a seed and the cheapest path to the pointer follows in real time; fix anchors, close the contour, and see where the wire short-cuts or jumps to a stronger edge. Unit: When there is no order: Dijkstra and live-wire.
Fast marching vs Dijkstra
Arrival times of a front by fast marching beside 4- and 8-neighbour Dijkstra: circles instead of diamonds, image-based costs, and minimal paths by gradient descent. Unit: From Dijkstra to fast marching.
Every state of a tiny Ising lattice
Click spins on a 2×2 or 3×3 lattice and see the energy, the partition function and the probability of every energy level; in sample mode a Gibbs or Metropolis chain fills in the exact bars. Unit: Energy and probability: the Ising model.
The 2D Ising lattice and its phase transition
A 256×256 lattice sampled live: domains below T_c, noise above, clusters of all sizes at T_c; cooling, quenching and a T-scan against Onsager’s exact curve. Unit: Sampling, temperature and the phase transition.
Denoising a binary image with an Ising prior
Compare ICM, simulated annealing, Gibbs sampling (MPM), mean field and the exact minimum cut on a noisy binary image, by energy and by wrong pixels. Unit: Bayesian denoising with an Ising prior.
Quadratic, Huber and TV smoothing in 1D
Denoise a profile with a step, a ramp and a narrow peak under a quadratic, Huber or total-variation prior; see prior samples and the matrix I + λL with its frequency response. Unit: Quadratic smoothing and total variation.
The random walker on a chain
Voltages on a resistor ladder: averaging sweeps, random walks and the minimum cut on the same weights. Unit: The random walker.
Random walker segmentation
Paint seeds and see the probabilities, the uncertainty and random walks from any pixel. Unit: The random walker.
Spanning trees step by step
Kruskal, single linkage, Felzenszwalb–Huttenlocher, Prim from markers and minimax paths on a small grid. Unit: Spanning trees.
FH and single linkage on an image
Felzenszwalb–Huttenlocher with a live k, single linkage, pre-smoothing and minimum size. Unit: Spanning trees.
Graph cut, random walker and watershed on the same seeds
Sum, squares and maximum: three seeded segmentations side by side. Unit: Watershed as a minimum spanning forest.
Merge trees and ultrametric contour maps
Hierarchies by altitude, dynamics, area, volume or region means; cut the dendrogram, read the UCM. Unit: Hierarchical segmentation.
SLIC superpixels
k-means in colour and position: iterations, compactness, connectivity, metrics, and graph cuts on superpixels. Unit: Superpixels.
Points and their curves: the Hough duality
Drag points in the image plane and watch their sinusoids in (θ, ρ) meet when the points are collinear; switch to slope–intercept form to see why it fails for steep lines. Unit: Hough transform: lines.
Line detection with the Hough transform
Edge points, the (θ, ρ) accumulator and the detected lines or segments, with controls for the bin size, the threshold, NMS, clutter and gradient voting. Unit: Hough transform: lines.
Circle detection: rings of votes
Each edge point votes for a ring of possible centres, or for one or two dots along its gradient. Scan the radius, change the polarity, and read a radius histogram at any centre. Unit: Hough transform: circles.
The generalised Hough transform: R-table and voting
Build an R-table from a template you can edit, then find translated, rotated, scaled and occluded copies in a cluttered scene. Unit: The generalised Hough transform.
RANSAC step by step
Draw minimal samples, count the inliers within ±ε, refit, and compare with least squares and with the Hough transform of the same points, together with the probability of success after N samples. Unit: Hypothesise and verify: RANSAC.
Running totals and the summed-area table
Fill an integral image step by step and sum any rectangle from four signed table entries, or see a range sum as the rise of a running total. Unit: Integral images.
Box filters: four methods, and repeated boxes
Count and time a k × k box blur done directly, separably, with running sums and with an integral image, and watch repeated boxes turn into a Gaussian. Unit: Box filters & local statistics.
Local mean, standard deviation and precision
Local statistics and contrast normalisation from the integral images of I and I², and what float32, wrapping integers and cancellation do to them. Unit: Box filters & local statistics.
Rectangle (Haar-like) features
Drag edge, line, diagonal and centre − surround templates over an image and see their table lookups, responses and response maps. Unit: Rectangle features.
A box feature stack
Box means, standard deviations, centre − surround and edge features at five scales; paint two classes and see which feature separates them. Unit: Rectangle features.
Boosting and the attentional cascade
Train a boosted detector stump by stump on cartoon faces or cells, build a cascade, and run it over a test scene. Unit: Boosted detectors & the cascade.
Spots in 1D: filter, then local maxima
A noisy profile with eight spots (a close pair, a dim neighbour, spots on a ramp): Gaussian, zero-mean, LoG, DoG or à trous filtering, then local maxima in a window of radius r, or h-maxima by height above the saddle. Unit: Finding spots: filter, then local maxima.
Spot detection
A synthetic fluorescence image with uneven background: seven spot filters (including the zero-mean matched filter and the à trous product), local maxima, a threshold in units of the noise, and detections scored against the truth. Unit: Finding spots: filter, then local maxima.
How many false spots?
Noise maxima are many and higher than ordinary pixels: the histogram of maxima, false spots per image against the threshold (measured, naive tail, Euler formula), and Poisson noise fixed by a local noise estimate or the Anscombe transform. Unit: How many false spots? Thresholds from noise statistics.
Localising one spot
Brightest pixel, centroid, parabola, log-parabola, least-squares and maximum-likelihood Gaussian fits of a Poisson spot: their bias across a pixel and their precision against the Cramér–Rao bound. Unit: Sub-pixel localisation.
Two spots: one or two?
Two spots a distance d apart: when the maxima merge (2σ raw, 2√2σ after the matched filter), and when a two-spot fit pays its penalty. Unit: Crowded spots and evaluating a spot detector.
Evaluating a spot detector
Distance-gated one-to-one matching of detections to truth (greedy or optimal), F1 against the gate, the precision–recall curve and F1/RMSE against density, plus a by-hand example where greedy matching loses a match. Unit: Crowded spots and evaluating a spot detector.
The DoG pyramid, step by step
Build the octave pyramid of differences of Gaussians one level at a time. Click a candidate to see its 3 × 3 × 3 neighbourhood, its sub-pixel refinement and the contrast and edge tests. Unit: Keypoints: corners and blobs across scale.
Repeatability of keypoint detectors
Harris at one σ, multi-scale Harris, DoG and FAST on a scene and a copy of it under a known zoom, rotation, tilt, lighting change and blur. See which points are found again, with the repeatability curve against zoom or angle. Unit: Keypoints: corners and blobs across scale.
A descriptor, step by step
Resample a keypoint’s window in its own frame and build a gradient-histogram, binary or normalised-patch descriptor. Compare its distances to every descriptor of a turned, zoomed and relit second view. Unit: Describing a keypoint.
Matching descriptors: ratio test and mutual check
Nearest-neighbour matches between two views, scored as correct or wrong against the known transform. Try a distance threshold, the ratio test, the mutual check and one-to-one assignment, with histograms, a precision–recall curve and approximate k-d tree search. Unit: Matching descriptors.
The transform zoo
Drag target points and fit a translation, a rigid map, a similarity, an affine map or a homography by least squares. See the degrees of freedom, the pairs each model needs, and what one outlier does. Unit: From matches to a transform.
RANSAC on matches, and a mosaic
Step through RANSAC on matched keypoints and compare it with the predicted number of iterations. The result is shown as a checkerboard overlay. Mosaic mode stitches four tiles by a pairwise chain or a global fit, with feathering or multi-band blending. Unit: From matches to a transform.
Iterative closest point, step by step
Two point sets without correspondences: match every moving point to its nearest fixed point, fit the best transform, repeat. See where ICP converges and where it stops in a local minimum, what a good start does, how points without a partner pull the fit and how trimmed ICP ignores them, and how an outline slides along itself. Unit: Aligning point sets.
Speed from slope and change
A 1D profile moves over time: frame 1 and frame 2 with the slope and the change at a pixel, the per-pixel estimate −It/Ix against the window least-squares estimate, and a kymograph with a slope ruler. Presets show the by-hand bump, a ramp, motion that is too fast, bleaching and vesicle transport. Unit: Brightness constancy and the aperture problem.
Reading flow fields
Translation, rotation, expansion, shear, a vortex, a saddle, cells moving apart and a closing wound, each shown as arrows, as the flow colour wheel and as speed, with a “which field is this?” quiz. Unit: Brightness constancy and the aperture problem.
The aperture problem
A bar, a grating, a corner or a texture moves behind a hole. Each pixel’s constraint is a line in velocity space: along an edge all lines coincide, at a corner they cross at the true motion. Drag the true velocity. Unit: Brightness constancy and the aperture problem.
Lucas–Kanade optical flow
The micrograph moved by a known flow: estimated flow, the confidence (smaller eigenvalue of the structure tensor), the endpoint error, warping iterations and a coarse-to-fine pyramid; click a pixel to see its window’s constraint lines. Unit: Lucas–Kanade.
Horn–Schunck optical flow
Animated sweeps of data + λ·smoothness: filling-in of flat regions, smeared or sharp motion boundaries (quadratic or robust smoothness), the endpoint error against λ, Lucas–Kanade for comparison and the warping residual. Unit: Horn–Schunck and evaluating flow.
Joint histogram and similarity measures
Slide a contrast-mapped copy of the micrograph over the original: the joint histogram, and SSD, NCC and mutual information against the shift, for same, gain + offset, inverted and non-monotone contrast. Unit: Non-rigid registration.
Free-form registration
A B-spline control grid deforms the moving image: drag control points or optimise SSD, NCC or mutual information + λ·bending, coarse to fine; checkerboard, difference, the sampled grid and the Jacobian determinant (folding in black), with the error against the known deformation. Unit: Non-rigid registration.
Linking two frames
Detections at two frames, all draggable: nearest neighbour (conflicts in red), greedy (step through the order) and global assignment, with a gate and the cost b of ending or starting a track; the cost matrix or the augmented matrix with the chosen cells boxed. Unit: From detections to tracks.
Linking a simulated movie
A seeded movie of particles entering and leaving the field, linked by nearest neighbour, greedy or global assignment; wrong links marked, stage drift and its correction, and the link error against the displacement/spacing ratio. Unit: From detections to tracks.
The Kalman filter step by step
Predict and update in one dimension: prediction, measurement and estimate as Gaussians, the gain, the ±2σ band over time, missed measurements and the steady-state gain. Unit: Motion models and the Kalman filter.
Linking with prediction
Crossing, turning and stop-and-go particles tracked three ways: nearest neighbour, global assignment on the last position, and global assignment on a Kalman prediction with ellipse gates; link errors and identity switches side by side. Unit: Motion models and the Kalman filter.
Gaps, divisions and lineage trees
Simulated dividing cells with missed detections, false detections and segmentation splits: two-stage linking with gap closing, splitting and merging in a space–time view, the true and found lineage trees, and the censoring of cycle times. Unit: Gaps, divisions and lineage trees.
The mean squared displacement
Simulated tracks of free, directed, confined, anomalous, switching and persistent motion: MSD per track and pooled, on linear or log–log axes with the fit range, the per-track D histogram, the localisation-error offset, and the speed trap. Unit: Speed, MSD and modes of motion.
A linear classifier
Turn the normal vector w and shift the line; signed distances, nearest class mean, 1-NN and the perceptron. Unit: Linear classifiers.
The support vector machine in 2D
Add and drag points; the max-margin street, support vectors and slack, with C and (in other units) kernel functions and cross-validation. Unit: Maximum margin and support vectors.
Four loss functions
The 0–1, hinge, logistic and squared losses of a 1D classifier, each point’s loss and the average loss against the threshold. Unit: Maximum margin and support vectors.
Lift and cut: the kernel trick as a picture
Lift 2D points into 3D with a feature map; a plane there is a curve here. Unit: Kernel functions and the kernel trick.
Kernel functions in 2D
Linear, polynomial and RBF kernel functions, gamma and C, RBF bumps and the kernel matrix. Unit: Kernel functions and the kernel trick.
An SVM in the pixel classifier
The random forests day’s pixel classifier with the SVM: standardisation, gamma, one-vs-rest vs one-vs-one, and cross-validation by stroke vs by pixel. Unit: SVMs for pixel classification.
Training error, test error and cross-validation
A test set, error curves against C and gamma, and a 5-fold cross-validation map. Unit: SVMs for pixel classification.
k-means step by step
Assign points to the nearest centre, move centres to the means, and watch J fall; restarts show the local minima. Unit: Feature spaces & k-means.
Gaussians, ellipses and mixtures
Drag the axes of a 2D Gaussian, compare Euclidean and Mahalanobis distance, and mix two or three components with hidden labels. Unit: The multivariate Gaussian & mixtures.
EM step by step (1D)
E-step and M-step one at a time on a few points, with every responsibility and parameter in a table. Unit: Fitting a mixture: EM.
EM in 2D
Fit a Gaussian mixture to 2D points with any covariance type and start; watch the log-likelihood, restarts, collapse and BIC/AIC. Unit: Fitting a mixture: EM.
Grey-level mixtures
A K-class Gaussian mixture fitted to an image histogram: labels, probability maps, Bayes boundaries and multi-level Otsu. Unit: Mixtures on images.
Colour segmentation with mixtures
k-means against full-covariance mixtures in RGB, Lab and Lab + position, with Dice against the truth and low-likelihood anomalies. Unit: Mixtures on images.
Noise against the spectrum
White noise drowns an image’s weak high frequencies first: the noise floor against the radially averaged power spectrum, the Wiener denoiser of a Gaussian image model, and a sample of that model. Unit: Noise levels, denoisers and the score.
Pairs, averages and a learned denoiser
Training pairs (noisy, clean) in 1D: their binned average is the exact best denoiser, which is a step along the score; a tiny network trained by denoising score matching, and where it fails. Unit: Noise levels, denoisers and the score.
Samplers in 1D
Deterministic and stochastic sample paths through the noise levels, with the exact score: too few steps, step spacing, two-stage steps, Langevin corrections, a bad start, and inversion. Unit: Samplers, steps, and judging the samples.
Judging generated samples
Precision, recall, Fréchet distance and nearest-training distance of generated 2D clouds: a generator between the modes, mode dropping, a memoriser, and the diffusion sampler with more and more steps. Unit: Samplers, steps, and judging the samples.
Guidance in 1D
Classifier-free guidance with exact denoisers: guided samples against the sharpened density, narrower and pushed away from the other class, beyond any real example for large w. Unit: Conditioning, guidance and latent diffusion.
Latent diffusion on cell shapes
Diffusion in the 2D latent space of the cell-shape VAE: samples land where real codes are (unlike the VAE prior), dividing cells on demand, caricatures with strong guidance, copies with tiny spreads. Unit: Conditioning, guidance and latent diffusion.
Measured and imagined, in 1D
A diffusion prior for an inverse problem with an explicit cut-off: Tikhonov, posterior mean and samples, the part of each sample the measurement cannot see, an approximate diffusion sampler, and the coverage of the 90 % band. Unit: Diffusion priors for inverse problems.
What virtual staining can know
Predict a fluorescence channel from a transmitted-light-like channel with an exact generative prior: the visible nucleus is predicted, invisible spots become an average, and a treatment effect vanishes. Unit: Diffusion priors for inverse problems.
Drifting: generating in one step
Points pulled towards real points and pushed away from the other generated points: they drift from noise onto two moons; the temperature, attraction only (mean shift), augmented views for a few points, and coverage. A second mode trains a small generator with the same field and samples it in one pass. Unit: Drifting: generating in one step.
The Haar transform step by step
Averages and differences of an 8- or 16-sample signal, one level at a time, with the reconstruction from the coefficients you keep. Unit: Localised basis functions and the Haar transform.
Sparsity in two bases: Fourier and wavelets
Keep the K largest coefficients of a 1D signal in the Fourier and in a wavelet basis and compare the errors. Unit: Localised basis functions and the Haar transform.
The wavelet filter bank
Low-pass and high-pass filters, keep every second sample, and back: perfect reconstruction, aliasing when a branch is missing, borders, the cascade and the basis functions. Unit: Multiresolution, filter banks and Daubechies wavelets.
The 2D wavelet transform
Subband pyramid of an image, reconstruction from the largest coefficients or without whole bands, and a comparison with Fourier and the 8×8 DCT. Unit: The 2D wavelet transform and sparsity of images.
Denoising by wavelet shrinkage
Hard and soft thresholding of the wavelet coefficients of a noisy image, the universal threshold, the noise estimate from the finest band, and cycle spinning. Unit: Denoising by wavelet shrinkage.
Build a Huffman code
Drag the bars of a histogram and build its Huffman tree merge by merge; compare the entropy, the average code length and a fixed-length code, and decode a message by walking the tree. Unit: Information, entropy and entropy codes.
Prediction and residuals
Predict each pixel from its decoded neighbours (left, up, average, planar, Paeth, MED) and see how narrow the residual histogram becomes, with entropies and real DEFLATE sizes; add noise to find the floor. Unit: Prediction, dictionaries and lossless formats.
One block in three bases: DCT, DFT, KLT
Take one 8 × 8 block apart into DCT, DFT or KLT basis images, keep the largest or the first coefficients, and compare the energy compaction of the three bases. Unit: Transform coding, the DCT and the KLT.
Periodic or mirrored? DFT against DCT
Drag the 8 samples of a row and compare its periodic extension (DFT) and mirrored extension (DCT), their coefficients and the row rebuilt from the first k. Unit: Transform coding, the DCT and the KLT.
The JPEG pipeline
Compress an image with JPEG at any quality: follow one block through DCT, quantisation, zigzag and Huffman bits, see blocking, ringing and colour bleeding, and plot PSNR and SSIM against the file size. Unit: The JPEG pipeline, artefacts and quality metrics.
Same MSE, different quality
Five distortions tuned to exactly the same mean squared error: PSNR cannot tell them apart, SSIM can. Unit: The JPEG pipeline, artefacts and quality metrics.
What compression does to measurements
Store a synthetic 12-bit fluorescence image lossless, as JPEG or with a wavelet codec, and see what happens to spot counts, spot intensities, noise, texture and the 8-pixel blocking grid. Unit: Compression and measurements, JPEG 2000, formats.
Projections and the sinogram
Turn the detector around an object, drop point masses and watch each one trace a sinusoid in the sinogram. Unit: Projections and the sinogram.
Back-projection, angle by angle
Smear each projection back along its rays, with or without a ramp filter, and see the halo appear or cancel. Unit: Back-projection and the Fourier slice theorem.
The Fourier slice theorem
The 1D spectrum of a projection against the 2D spectrum along the same line, and direct Fourier reconstruction from spokes. Unit: Back-projection and the Fourier slice theorem.
How much data does a reconstruction need?
Angles, angular range, detector bins and dose for filtered back-projection; streaks, the missing wedge and noise. Unit: Filtered back-projection and sampling.
ART and SIRT by hand
A 2×2 or 3×3 image as a linear system with its null space, and ART zig-zagging between the measurement lines of two pixels. Unit: Reconstruction as a linear system.
Iterative reconstruction with priors
ART and SIRT with non-negativity and total variation against filtered back-projection: semi-convergence, few views, a missing wedge. Unit: Reconstruction as a linear system.
Heat flow is a Gaussian blur
Explicit heat steps on a profile or an image next to the Gaussian with σ = √(2t). The demo also shows the amplification factor of one step, the checkerboard of an unstable step, implicit steps and the border rules. Unit: Smoothing as heat flow.
Edge-stopping diffusion
Perona–Malik on a profile and on the noisy test card. Drag K on the flux plot; the shaded part is the backward range, where edges sharpen. The 2D tab shows the conductivity map and the PSNR over time. Unit: Edge-stopping diffusion: Perona–Malik.
Total variation flow
Plateaus sink at the rate perimeter/area. Small discs fade first, and corners round off while straight edges stay. The image tab compares TV, Perona–Malik and heat at equal smoothing. Unit: Total variation flow.
Bilateral and NLM weight maps
Click a pixel to see which pixels the bilateral filter and non-local means average there, with the effective number of averaged pixels. Also shown: iterated and joint bilateral filtering. Unit: Neighbourhood filters in depth.
Filling holes
Harmonic (Jacobi, Gauss–Seidel, direct solve), TV and exemplar inpainting on images with known truth. The demo shows the bar connectivity rule, how texture is copied, and how exemplars can invent a nucleus. Unit: Filling holes.
All smoothers on one image
Eight smoothers on one test card, each at its best-PSNR setting: Gaussian, median, Perona–Malik, TV, bilateral, NLM, wavelet shrinkage and Wiener. Compare their method noise, profiles and scores under Gaussian, Poisson and salt-and-pepper noise. Unit: All smoothers on one image.
The lasso picture
Drag the least-squares point of a two-unknown problem and watch where the ℓ2, ℓ1, ℓ½ and ℓ0 balls touch the misfit ellipses; transfer curves and the lasso path. Unit: Sparsity and the ℓ1 penalty.
ISTA, FISTA and matching pursuit
Recover a signal that is sparse in spikes, wavelets, the DCT or two bases at once, through a blur or a mask; step through ISTA, compare FISTA and OMP. Unit: Solving with ℓ1.
Restoring images with a sparsity prior
Denoise, deblur and inpaint with Tikhonov, wavelet ℓ1, TV, patch dictionaries or NL-means. Units: Solving with ℓ1, Sparse coding and dictionary learning.
Compressed sensing in 1D
Measure a sparse signal with random or regular Fourier samples, a Gaussian matrix or random pixels; zero filling, the sampling PSF, ℓ1 and OMP recovery. Unit: Compressed sensing.
The phase transition
Fill in the Donoho–Tanner diagram of ℓ1 and OMP recovery cell by cell and compare with the theoretical curve. Unit: Compressed sensing.
Compressed-sensing MRI
Skip k-space lines (centre, regular, random, variable density, radial) and reconstruct by zero filling or wavelet/TV-sparse FISTA. Unit: Fast MRI with compressed sensing.
Learning a patch dictionary
Learn atoms from image patches with K-SVD, MOD or k-means; inspect the sparse code of any patch and compare with PCA and the DCT. Unit: Sparse coding and dictionary learning.
Spectra, filters and the mixing matrix
Drag dye peaks and filter bands and watch bleed-through, the mixing matrix and the condition number change. Unit: Bleed-through and compensation.
Compensate a two-colour image
Guess the spillover of a two-colour cell image and see the ghost of the nucleus, the tilted pixel populations and the correlation disappear. Unit: Bleed-through and compensation.
Unmix a lambda stack
Unmix a four-component cell recorded in 3–32 channels by least squares, and watch the residual, similar dyes and photon noise. Unit: Least-squares unmixing.
The cloud, the cone and the simplex
Rotate a cell’s pixels in channel space, normalise the cone into a triangle, drag the endmembers and compare LS, NNLS and fully constrained solutions. Unit: Endmembers: the geometry of mixtures.
Finding the spectra
Count the components from the singular values and find the spectra with PCA axes, vertex finding or NMF, with and without pure pixels. Unit: Endmembers: the geometry of mixtures.
Colour deconvolution of H&E
Separate a synthetic H&E slide into stain maps in optical density, drag the stain vectors and see crosstalk, conditioning and Macenko’s estimate. Unit: Stain separation: colour deconvolution.
Colocalisation coefficients on a grid
Two small editable channels (3 × 3 or 6 × 6) and the scatter plot of their pixel pairs, with live Pearson r, Spearman, overlap, k1, k2 and Manders M1/M2; the pixels M1 and M2 count are outlined. Presets: the exercise example, an offset, A inside B, one bright outlier carries r, anti-correlation, no thresholds. Unit: Colocalisation of two channels.
Colocalisation of two channels
The 2D histogram of two channels, with Pearson’s r, Spearman, the overlap coefficient, Manders’ M1/M2 (with or without the own-channel threshold) and draggable thresholds. Costes’ threshold search, block randomisation, and presets for the classic pitfalls (background, missing thresholds, bleed-through, shift). Unit: Colocalisation of two channels.
Is it more than chance?
Shift curves (r against a shift of one channel), block randomisation with a permutation p-value (1-px shuffle for comparison), the product-of-differences image with Li’s ICQ against shuffled data, and the Costes trace, on a synthetic two-cell scene. Unit: Is it more than chance?.
Objects and distances between channels
Spots detected in two channels at physical scale (65 nm pixels, NA 1.4): A → B distance histogram with the chance level for random B spots, nearest-neighbour or one-to-one pairing, the cross-L function with an envelope of relocations inside the cells, three overlap definitions for larger objects, and the bias of distances measured below the resolution. Unit: Objects instead of pixels.
Confounds and corrections
The two-channel forward model: per-channel PSF, chromatic shift, bleed-through, shared background, noise; corrections in pipeline order (top-hat, compensation with an estimated leakage, registration from two-colour beads), with r, M1/M2, ICQ and the object fraction for an ideal, the measured and the corrected images. Tab: r and object fraction against the true pair distance. Unit: What the microscope does to colocalisation.
The FRET ruler
Drag a donor and an acceptor drawn to scale, turn their dipoles and shift the acceptor’s spectra; watch E(r), the Förster radius and the sensitive window. There is also a population mode where the mean E differs from E at the mean distance. Unit: FRET in pictures: a ruler for nanometres.
Three images, two controls
A field of donor-only, acceptor-only, no-FRET, fusion and binding cells. Remove bleed-through and cross-excitation, measure the coefficients from the controls, and compare Fc, the two indices and E_app. Unit: Three images, two controls: sensitised emission.
Acceptor photobleaching
Bleach the acceptor in a region you draw and watch the donor dequench. Correct for incomplete bleaching, donor bleaching and drift. Includes photoconversion and a half-paired population. Unit: Acceptor photobleaching, and what an efficiency means.
Ratio imaging
A biosensor time-lapse with uneven thickness. Try the ratio with and without background subtraction, masks, the intensity-modulated display, binning, bleaching and a channel shift, then calibrate to a concentration near R_max. Unit: Ratio imaging, biosensors and the noise of a ratio.
The noise of a ratio
Monte Carlo of A/D for photon counts. Compares the delta method, bias and tails, the ratio of sums with the mean of ratios, and shared flicker, plus the three-image difference Fc and the bleach E = 1 − P/Q. Unit: Ratio imaging, biosensors and the noise of a ratio.
Photons into a histogram
Time-correlated single-photon counting photon by photon: laser pulses, at most one timed photon per pulse, the instrument response, background, wrap-around and pile-up, with the mean-arrival and two-gate estimates. Unit: Lifetimes, decays and photon counting.
A lifetime image
A FLIM image of a synthetic cell: intensity, lifetime as colour with intensity as brightness, and the histogram of any pixel; binning, masking, mean arrival vs two gates. The same demo has three more modes in later units: global analysis (lifetimes fitted once, amounts per pixel), the phasor histogram with a cursor and a brush, and FRET and NADH fraction maps. Unit: Lifetimes, decays and photon counting.
Fit a decay
Fit a decay through the forward model with least squares, χ² with 1/y weights or the Poisson likelihood; residuals, the cost landscape and the optimiser’s path, one or two lifetimes. Unit: Fitting decays with few photons.
The photon budget
A Monte Carlo of five lifetime estimators: bias and spread with few photons and background, the error against N with the 1/√N line, and how many more photons two lifetimes need. Unit: Fitting decays with few photons.
Excitation and emission waves
Frequency-domain lifetimes: the emission wave is delayed and flattened; phase and modulation lifetimes agree for one exponential and differ for a mixture. Unit: Frequency domain and phasors.
The phasor plot
Single lifetimes on the universal semicircle, mixtures on chords at their photon fractions, three species in a triangle; IRF calibration, coarse bins, noisy clouds and the second harmonic. Unit: Frequency domain and phasors.
FRET on the phasor plot
Donor-only point, FRET state and the line between them: efficiency vs interacting fraction, the FRET trajectory, autofluorescence, acceptor leak and few photons, with a fit and the phasor line as estimates. Unit: FLIM-FRET and metabolic imaging.
Slices of a 3D stack
Orthogonal and oblique slices, the MIP and the voxel → world matrix of an anisotropic nuclei stack. Unit: 3D images.
Marching squares by hand
Edit the corner values of a small grid and see the case of each cell, the crossing points and how saddle cells are decided. Unit: Level sets & marching squares.
Contours of an image
Marching-squares contours of a test image or a micrograph, with the iso-value, blur and noise as controls and readouts of length and enclosed area. Unit: Level sets & marching squares.
One marching-cubes cell
Click the corners of a cube to see its case, its class among 15 and 23, the triangles, ambiguous faces, cracks and tetrahedra. Unit: Marching cubes.
Marching cubes on a volume
Extract isosurfaces from 3D volumes live, with the iso-value, blur, noise, normals, z spacing, algorithm and face rule as controls, and readouts of area, volume and topology. Unit: Marching cubes.
Measuring surfaces
Compare voxel faces with marching cubes as the resolution grows, plot volume against the iso-value, and decimate a mesh made from a binary mask. Unit: Measuring surfaces.
Following a vertex through the pipeline
A small house shown in model, world, view, clip/NDC and screen space, with the camera frustum, live M, V and P matrices and one vertex followed through every space. Unit: Meshes, coordinate spaces and projection.
A rasteriser, pixel by pixel
Step through the pixels of one or two triangles on a coarse grid to see edge functions, barycentric coordinates, the z-buffer, the top-left rule, culling, perspective-correct interpolation and depth precision. Unit: From triangles to shaded pixels.
Shading: Lambert, Phong, Blinn–Phong
Flat, Gouraud and per-pixel lighting of a sphere, torus or gem, with normals transformed by M or by M⁻ᵀ, drawn by the course’s own software rasteriser. Unit: From triangles to shaded pixels.
GPU texture formats
The same data in two texture formats side by side, stretched so the steps show; nearest or linear filtering (needs WebGL2). Unit: How graphics cards store colour.
Texture filtering and mipmaps
A checkerboard on a receding floor sampled nearest, bilinear, from the nearest mipmap level or trilinear, with an option to colour each pixel by its mip level. Unit: How graphics cards store colour.
Compositing one ray
One ray through a slice of a synthetic head, composited sample by sample front to back or back to front, with a transfer-function editor, early termination and opacity correction. Unit: Seeing voxels.
Volume rendering
MIP, MinIP, average, direct volume rendering with a transfer function, and isosurface ray casting of a synthetic head, with step size, opacity correction, early termination and voxel spacing to explore. Unit: Seeing voxels.
The pinhole camera
A 3D scene (WebGL) and the camera’s 640 × 480 image: focal length, principal point, skew, pose, roll and distortion; click a pixel to see its ray; K, [R | t], P or the graphics-convention matrices. Unit: The pinhole camera and calibration.
Calibrating a camera
DLT on two checkerboard walls (normalised or not, pick points) or homographies of a flat board in 1–5 poses; refine the reprojection error with or without distortion; residual arrows and singular values. Unit: The pinhole camera and calibration.
Triangulation in flatland
Drag 1D cameras and a point: ±δ px wedges, the uncertainty region, a cloud of noisy triangulations, depth error against depth with the Z² rule, and a third view. Unit: Two views: epipolar geometry, triangulation.
Epipolar geometry
Click a point and see its epipolar line, the epipoles and the epipolar plane in 3D; sideways, forward and general motion; estimate F by the eight-point algorithm (normalised or not) or RANSAC from noisy matches with outliers. Unit: Two views: epipolar geometry, triangulation.
Stereo matching
Rectified synthetic pairs with ground truth: SAD, NCC and census costs, window size, winner-takes-all, scanline DP, SGM with 4 or 8 directions, the left–right check and sub-pixel disparity; cost curves, and a second tab with one row’s x × d cost slice (the cost slice). Unit: Stereo: from disparity to depth.
Plane sweep in flatland
Depth hypotheses along a reference ray, photo-consistency across 2–5 views, and the depth of every pixel against the truth; textureless and occluded presets. Unit: Structure from motion and bundle adjustment.
Bundle adjustment in flatland
Ten 1D cameras around an outline: Gauss–Newton against Levenberg–Marquardt steps, the RMS per step, the gauge on or off (zero eigenvalues), outliers with squared or Huber loss, covariance ellipses, the sparsity of the Jacobian and incremental reconstruction. Unit: Structure from motion and bundle adjustment.
A step-through ray caster
Trace one pixel at a time on a coarse grid and watch each ray in a top view of the scene. For every sphere, plane and triangle the readout shows the discriminant and roots, t, and the barycentric coordinates u, v. With recursion turned on, you also see the whole ray tree: shadow, reflected and refracted rays with their weights, shadow acne and light leaks. Units: Rays from the camera, Shadows, mirrors and glass.
Rays in 2D: reflection, refraction and Fresnel
A 2D sandbox with a source and objects of glass, water or oil: a slab, a ball, a lens, a prism and a coverslip stack. It shows Snell’s law, total internal reflection, the Fresnel split of power between reflected and refracted light, dispersion, spherical aberration, and the focal shift from a refractive-index mismatch. Unit: Shadows, mirrors and glass.
Boxes, grids and tests
Bounding-volume hierarchies (median split or the surface area heuristic) and uniform grids over a 2D scene of discs and segments. Step through the traversal of one ray and count box tests and object tests against brute force. A plot shows tests per ray against N for brute force, the grid and the BVH. Unit: Tracing fast.
Monte Carlo for one pixel
The light arriving at one surface point, estimated with random directions drawn from a uniform pdf, a cosine pdf, a pdf aimed at the lamp, or a pdf that misses the lamp. Repeating the estimate 500 times gives a histogram, an RMS error that falls as 1/√N, fireflies from a tiny lamp, and the bias of a bad pdf. Unit: Path tracing.
A progressive path tracer
A closed box with a diffuse, a mirror and a glass ball, path traced in the browser with WebGL2. You can set the target samples per pixel and the bounce count, and choose uniform, cosine or light sampling, a smaller lamp, or a Whitted mode. Views show the standard deviation, the error against a reference, and normal and albedo. An RMS-versus-spp plot and a denoise panel (Gaussian, bilateral, non-local means, joint bilateral) complete it. Unit: Path tracing.
The same filter on the CPU and the GPU
A k×k filter measured in your browser on one CPU thread and on the GPU (WebGL2), with upload, compute and download times. Unit: Many simple cores.
Warps and divergence
A simulated multiprocessor: branch divergence in warps of 32 pixels (rows or 8×4 tiles), loops that wait for the slowest lane, and latency hiding with many resident warps. Unit: Many simple cores.
Coalescing and tiles
Which 128-byte lines a warp touches for rows, columns, strides and interleaved colour; global reads of a stencil with tiles and halos. Unit: Memory is the bottleneck.
Roofline and end-to-end time
Arithmetic intensity of image operations on generic devices, memory- against compute-bound, float16, and when transfers make the GPU lose. Units: Memory is the bottleneck, What GPUs are good and bad at.
Data-parallel patterns
Tree reduction (and why its last digit depends on the split), Hillis–Steele and Blelloch scans, stream compaction, and an atomic histogram with contention and privatisation. Unit: Data-parallel patterns.
Irregular algorithms in parallel
Label propagation and pointer jumping against sequential union–find, the DP wavefront, and level-synchronous against priority-queue flooding. Unit: What GPUs are good and bad at.