Skip to content

Light field: ZEISS Lightfield 4D

LF4D-Recon reconstructs ZEISS Lightfield 4D data on the GPU with pySRX: calibrated light-field PSFs, Richardson-Lucy, an autograd MAP with a per-view haze model, and a neural field (the LF4D NeRF) that can be re-imaged afterwards through a virtual confocal. This page follows the project's slide deck.

Lightfield 4D: 37 views at once

The light path: sample, 40x/1.1 W objective, pupil, a micro-lens array of 37 lenslets in 3 focal groups, and the sCMOS camera recording 37 views

The 37 raw views as they sit on the camera, each a slightly different view of the same tissue

A micro-lens array (MLA) sits in a plane conjugate to the objective pupil (x1.52), so each of the 37 lenslets sees the sample through a small part of the pupil, from a slightly different angle: parallax encodes depth. Three lenslet groups carry an extra defocus (-0.33, 0 and +0.33 mm), so each group is sharp at a different depth. One camera frame therefore holds a whole volume, recorded at once.

The pupil with the 37 fitted lenslets, coloured by focal group

Left: the 37 raw views as they sit on the sCMOS camera (the MLA arrangement). Right: the lenslets fitted in the pupil (NA 1.1), coloured by focal group. Imaging: Anna Scheper, Fritzsche Group, University of Oxford.

Reconstruction workflow

From the raw CZI to the result stack: 1 raw CZI, 2 OME-Zarr, 3 PSF estimation (with experimental bead PSFs), 4 GPU deconvolution, 5 result stack

From the raw ZEN file to the benchmark. The raw CZI (37 views per scene) is converted to OME-Zarr by tanoa, with the views on the channel axis and the micro-lens-array metadata kept; calibration fits the lenslet positions and focal-group depths against ZEN's own volume; the calibrated light-field PSFs drive a GPU Richardson-Lucy; the volume is written as OME-Zarr on ZEN's grid and benchmarked against ZEN (sharpness, resolution, noise, fit to the raw views, time).

Richardson-Lucy

XZ sections through the PSF of one off-axis view per focal group, each with its lenslet in the pupil

One Richardson-Lucy iteration: the current guess is forward projected (what the camera should see), compared with what the camera saw, and the mismatch is sent back to give a better guess

One Richardson-Lucy iteration on real data (scene 15, central view, ZEN's best-focus plane). The current volume is projected through the calibrated light-field PSF, compared with the measured view (the ratio: blue below 1, red above), and the ratio is back projected (\(H^{\top}\)) and multiplies the volume. Left: XZ sections through the PSF of one off-axis view per focal group; the tilt is the parallax, and the groups are sharp at different depths.

The same plane at every iteration until convergence, with the data misfit falling

Each view is the sum over depth of the volume convolved with that view's PSF, plus a background; Richardson-Lucy is the maximum-likelihood (EM) step for Poisson photon noise, and stops when the volume no longer changes (see Concepts). Above: the same plane at every iteration, and the data misfit.

Calibration on ZEISS data

An edge lenslet sees the sample at an angle θ, so a point at depth z appears shifted by z tan θ; the central lenslet sees no shift

Why calibrate? The CZI does not record where each lenslet sits in the pupil, or which depth each focal group focuses on. Both set every view's parallax (shift = z tan θ) and blur, so with the wrong geometry light is put at the wrong depth. Fitting them to ZEN's own reconstruction raises the view-to-model agreement from NCC ≈ 0.1 to ≈ 0.65. Adding lens (barrel) distortion changes nothing (k1 = -0.001, under 1 px): ZEN's rectification already removes it.

Raw view (magenta) over the model (green) before calibration, after a rigid calibration and with lens distortion, for views 24 and 13; and the fitted best-focus depth of each focal group against the optics

The lenslet pupil positions, the focal shift of each group and a per-view offset, gain and background are fitted by forward projecting ZEN's volume and matching the 37 measured views (NCC on band-passed images). White means aligned.

Improvement 1: per-view haze

For a central and an edge view: raw view = in-volume signal + fitted haze + residual, with a profile along a line

Raw view = in-volume signal (the calibrated forward projection of the MAP volume) + a fitted haze map + residual. The haze is smooth (a 12 x 12 control grid per view) and carries 39 % of all counts in this scene: light from outside the reconstructed 121-plane volume. Plain Richardson-Lucy has only a flat per-view background, so it explains this light with dim, extended structure in the volume (blur, a raised floor).

Improvement 2: autograd MAP

The MAP loop: volume parameters, forward projection, expected counts and Poisson deviance against the raw views, plus a TV prior and the haze grid, with the gradient of the loss flowing back by autograd

The same Poisson model as Richardson-Lucy, written as a loss and minimised with PyTorch autograd and Adam: Poisson deviance plus a 3D total-variation prior, over the volume (kept non-negative) and the per-view haze jointly. Autograd differentiates through the FFT projector, so the back projection is not coded by hand. Right: ZEN, Richardson-Lucy (300 iterations) and MAP at ZEN's matched plane; 600 Adam steps, 190 s on an RTX A4500.

Ours vs ZEISS: the same plane

The raw central view, ZEISS ZEN and three pySRX reconstructions on ZEN's grid: XY with two regions, the regions enlarged, XZ and YZ sections, and an intensity profile

All on ZEN's grid at ZEN's best-focus plane of the calibration scene; each method on its own 0.1 to 99.8 percentile range. Imaging: Anna Scheper, Fritzsche Group, University of Oxford.

LF4D NeRF: the light field as a NeRF

The 37 lenslets as 37 cameras; a point at three depths seen in three views; and rendering written as the forward model H

Each lenslet is a calibrated camera: its position in the pupil plays the role of the NeRF camera pose (parallax), and its focal group plays the role of the lens (defocus blur). Fluorescence only emits, so rendering is exactly the FFT forward projection H. Training compares the rendered views with the 37 raw views by Poisson deviance, with a smooth per-view haze. The generic idea is on the Concepts page.

The Instant-NGP hash grid: 16 grids from coarse to fine, hash tables shared by the fine levels, and a tiny MLP that decodes the density

The LF4D NeRF uses the encoding of Instant-NGP (Instant Neural Graphics Primitives with a multiresolution hash encoding; Müller et al., 2022), the fast NeRF variant. A grid here is a lattice of corner points laid over the whole volume, like the voxel corners of a 3D image, and each corner holds two learned numbers. There are 16 such grids of different cell size, from 22.5 µm cells (the outline of the tissue) to 0.7 µm cells (one reconstruction pixel). To read the field at a point, each grid interpolates the 8 corners of the cell that contains it; the 16 × 2 = 32 numbers go to a tiny network (about 6 300 weights) that returns the density. The coarse grids have few corners and store each one. The two finest grids have more corners than their table of 2 097 152 (221) rows, so a hash function maps each corner to a row and a few distant corners share one. About 15 M table entries describe the 31.7 M-voxel volume; what they add over a voxel grid is a multi-scale prior and a field that can be read anywhere. The details, and what pySRX changes from Instant-NGP, are on the Concepts page.

Convallaria 20x against a confocal

Drag the divider, or pick the two methods to compare: XY at the matched depth z = 7.6 µm above, and an XZ section across the whole field below (z drawn about 4x stretched).

Raw light field, central view LSM 980 confocal, resampled LSM 980 confocal, Nyquist ZEISS ZEN Accelerated RL Autograd MAP LF4D NeRF Raw light field, central view LSM 980 confocal, resampled LSM 980 confocal, Nyquist ZEISS ZEN Accelerated RL Autograd MAP LF4D NeRF

488 ex 560 ex outside the confocal stack.

Every method registered onto the confocal frame (239 tiles, 0.76 µm RMS). The default reference is the confocal resampled to the light-field pixel (1.409 µm, box-integrated), so it is compared at the same pixel; the native Nyquist confocal is in the menu too. The two channels (488 ex green, 560 ex magenta) each on that method's own 0.1 to 99.8 percentile range; light-field methods at their native voxels, nearest. RL, MAP and the LF4D NeRF on the 0.547 µm z grid, ZEN on its own 4.38 µm grid; grey: outside the confocal stack. Imaging: Kseniya Korobchevskaya, OZCoE, University of Oxford.

The full figure, with three regions, XZ and YZ sections and an axial profile:

Every light-field method against the LSM 980 confocal Nyquist stack at the matched depth: XY, regions, XZ and YZ sections and an axial profile, for both channels

Every LF4D method against the LSM 980 confocal Nyquist stack at the matched depth z = 7.6 µm, after registration (239 tiles, 0.76 µm RMS). Richardson-Lucy and MAP are reconstructed on a 0.547 µm z grid; the LF4D NeRF is the same trained field re-sampled on that grid without retraining. Imaging: Kseniya Korobchevskaya, OZCoE, University of Oxford.

The scorecard: agreement with the confocal, resolution, sharpness, axial extent and CNR for every method in both channels

Values are 488 ex, 560 ex; bold green marks the best light-field method per channel, and the two confocal columns are references, not ranked. In short: ZEN is closest to the confocal on most agreement metrics; pySRX wins axial extent, 560 sharpness and 560 CNR. At 1.409 µm the pixel, not the reconstruction, sets the lateral limit: the confocal resampled to that pixel falls into the same range as every light-field method. Imaging: Kseniya Korobchevskaya, OZCoE, University of Oxford.

Field distortion against the LSM 980

Comparing two microscopes pixel by pixel assumes their images have the same geometry. The LF4D comparison measured how far they do not: each acquisition of the Convallaria section was registered onto the LSM 980 Nyquist stack with a model that includes scale and radial lens distortion.

  • The model. An in-plane rotation, a 3D translation, an isotropic scale \(s\) and a Brown-Conrady radial distortion \(k_1\) about the centre of the camera field. \(k_1\) is normalised so that it equals the fractional distortion at the field corner (negative: barrel) (register.FieldTransform).
  • The fit, in four steps: template matching on 1 µm/px maximum projections of the in-focus planes (coarse_xy, on focus_mip); mutual information (SimpleITK, Euler2D; fine_xy); a GPU Powell search that maximises the normalised cross-correlation (NCC) over the translation, rotation, \(s\) and \(k_1\) (fit_distortion); and a z offset that maximises the mean plane-wise NCC (search_z). register.register runs all four.
  • An independent check. Tile-wise phase correlation measures the displacement field without any model (displacement_field). Its radial component (radial_displacement) is plotted against the radius, with the fitted model on top.
from pysrx import register as R

# (C, Z, Y, X) stacks and their (z, y, x) voxel sizes in µm; the LSM 980 stack is the reference
tf, field = R.register(lsm, lf4d, lsm_spacing, lf4d_spacing)
R.distortion_summary(tf, field)    # scale error, k1 and shift at the corner, fit RMS, tiles, NCC
on_lsm = R.resample_to_ref(lf4d, lsm.shape[1:], lsm_spacing, lf4d_spacing, tf)   # LF4D on the LSM 980 grid

How to measure this on your own microscope: Measure field distortion.

LF4D: the fitted distortion grid, exaggerated ten times, and the radial displacement of 221 measured tiles against the radius, with the fit

LSM 980 confocal at 512 pixels: the grid is undistorted and the measured tiles lie on zero

Leica THUNDER spinning disk: a scale error and barrel distortion, measured on 250 tiles

Leica THUNDER spinning disk after LVCC deconvolution: the same geometry as the raw spinning disk

From left: LF4D, LSM 980 confocal (512 px), THUNDER spinning disk, and the same after LVCC deconvolution. Top: a 50 µm grid (grey) and the fitted distortion (colour, exaggerated ten times); dashed, the region measured against the LSM 980. Bottom: radial displacement of the measured tiles (dots) and the fit (line; dashed, extrapolated). Click a figure to enlarge it.

Acquisition Scale error \(k_1\) at the corner Shift at the corner Fit RMS Tiles NCC, rigid → fitted
LF4D −2.60 % −0.24 % −1.23 µm 1.24 µm 221 0.638 → 0.879
LSM 980 confocal, 512 px −0.06 % −0.01 % −0.02 µm 0.34 µm 255 0.990 → 0.996
THUNDER spinning disk −2.76 % −0.55 % −2.57 µm 1.41 µm 250 0.762 → 0.972
THUNDER, LVCC deconvolved −2.72 % −0.62 % −2.93 µm 1.42 µm 252 0.696 → 0.957

What it shows:

  • Scale dominates. Distances in the LF4D image come out 2.6 % shorter than in the LSM 980 image: about 5.5 µm at the edge of the 424 µm common field, four light-field voxels. The spinning disk shows almost the same scale error. The second LSM 980 acquisition agrees with the reference to 0.06 %, so the measurement itself is sound.
  • Lens distortion is small. Barrel distortion moves the LF4D field corner by 1.2 µm, under one voxel. The views inside the light field agree with this: fitting radial distortion across the 37 views gives \(k_1 = -0.001\), because ZEN already rectifies them.
  • It matters for every comparison. Without the scale term, the LF4D and confocal images drift apart towards the edges of the field. The NCC rises from 0.64 to 0.88 once scale and distortion are fitted, and the Convallaria comparison above uses the same registration.

Caveats: scale and distortion are measured relative to the LSM 980 scan field, so they say which system differs, not which one is right; and only within the confocal's 424 µm field, beyond which the model is extrapolated. Tilt is not fitted: the 12 to 16 µm deep confocal and spinning-disk stacks, and the 4.4 µm LF4D z step, cannot constrain it. Method and data: the LF4D comparison of the ZEISS Lightfield 4D, the LSM 980 and a Leica THUNDER spinning disk, imaging the same section with 20x/0.8 air objectives.

Virtual pinhole: a digital confocal

A pinhole in a confocal blocks out-of-focus light; the same as a PSF for several pinhole sizes; and the trained field re-imaged through a virtual pinhole

In a point-scanning confocal, light from the focal point passes the pinhole and light from above or below is mostly blocked. Because the LF4D NeRF is a continuous field, it can be imaged after the acquisition by any such virtual instrument: the field convolved with a confocal PSF of P Airy units. This sets what each instrument would record; it cannot add resolution the field does not have.

The field re-imaged as widefield and through pinholes of 5, 2, 1, 0.5 and 0.2 Airy units, with the optical sectioning curve of each

The digital confocal renders next to the real LSM 980 confocal and ZEN, with agreement scores

The LF4D NeRF, trained only on the raw light-field views, rendered through a virtual confocal (NA 0.8, pinholes 0.2 to 5 AU, plus widefield) and compared with the real LSM 980 confocal stack (1.0 AU at 488, 0.83 AU at 568). Imaging: Kseniya Korobchevskaya, OZCoE, University of Oxford.