← back to the tutorial

3D fitting: bead calibration and spline fitting

The words of this tutorial, step by step. The text lives in src/smappy/tutorial/topics/; the directions it follows are in src/smappy/tutorial/STYLE.md.

Why a measured PSF

1. card: 3D fitting: bead calibration and spline fitting

In 3D, z is read from the shape of each spot, so the fit has to know that shape at every z.

A real PSF is not the ideal one a formula gives: aberrations bend it. So SMAPpy measures it, on beads, and fits with that realistic model. The fit is more precise, and z comes out right.

spoken: In 3D, z is read from the shape of each spot. SMAPpy uses a realistic PSF model, measured on beads, not an ideal formula.

2. card: Astigmatism

A cylindrical lens in the detection path makes each spot elliptical: wide in one direction above the focus, in the other below it.

spoken: A cylindrical lens makes the spots elliptical, and their shape tells how high each molecule sits.

3. card: Bead stacks

Fluorescent beads on a coverslip, imaged while the objective steps through focus: each bead records the PSF at every z.

Many beads are aligned and averaged, and a spline makes the average smooth, so the model can be read at any z.

spoken: Beads imaged through focus record the PSF at every z. Averaged and smoothed, they become the model.

The calibration window

4. The PSF calibration section of the Localize tab, beside the fitters, opens its window.

5. Add the bead stacks: files, or a whole folder. All of them go into one calibration, so more beads make a smoother model.

6. The method: the pupil model, the default, learns the optics. Here the bead average, which is quicker: it aligns the beads and averages them.

7. The z step comes from the file's metadata. A plain TIFF has none, so type it in.

8. The bead box is the square cut around each bead: large enough for the widest spot, far out of focus.

Calibrate

9. Calibrate finds the beads, aligns them in x, y and z, and builds the model.

10. Overview: the beads it found, green if used, and the averaged PSF seen from the side, narrowing through focus.

11. Each bead is a row, with how well it matches the others. Outliers are left out by themselves; space excludes one by hand, then Calibrate again.

Check it

12. Calibrate also fits the beads back with the spline fitter, as the data will be fitted: each bead's z against where it was, on the line over the range the calibration can be trusted.

Save and use

13. Save model put the calibration next to the beads; the name says what it is. Use in the Spline 3D fitter puts it into the fitter.

Fit in 3D

14. Spline 3D now has the calibration. Give it the acquisition; the camera and the detection are as in 2D.

15. Run.

16. Colour by z, and the ring rises and falls as it was simulated.

17. Far from focus the spots are faint and wide, and z is less sure. The z filter keeps the range the calibration covers.

Next

18. card: What to remember

- SMAPpy fits 3D with a measured PSF, from beads.
- PSF calibration: add the stacks, set the z step, calibrate, check the fit quality; it is saved beside them.
- Spline 3D: the acquisition and the calibration; the rest as in 2D.
- Trust z over the calibrated range, and filter to it.

spoken: That is 3D fitting: measure the PSF on beads, check it, and fit with it. Next: rendering the result.