File › Simulate · version 5
A scene – structures, a background, beads, diffusing particles, in
To test an analysis you need data where the answer is known. This plugin makes such data: a scene of one or more components – a structure such as nuclear pores or filaments, labels spread evenly as a background or as particles that diffuse, fiducial beads – each labelled, blinking the way a dye does, in a colour of its own. It gives the localizations a fit would have produced, or the raw camera frames for a fitter to fit – on one camera, or on a split camera, each molecule in two halves of the chip, for the two-colour fit.
Start from a preset: a whole scene (nuclear pores, two-colour pores, diffusing particles, ...) that fills every setting and puts the few that matter most at the top, under key parameters. Change those, run, and look. Everything else is folded below and can be changed too; the preset then says modified, and save... keeps the scene as a preset of your own.
All outputs come from the same molecules. With the same settings and seed, the localizations and the frames describe the same fluorophores blinking in the same frames, so a simulation looked at as localizations can be fitted from its frames by changing only simulate.
Use it to:
It is a model, not a microscope. The background is flat, the spot is a Gaussian (or a measured PSF, point spread function: the image one molecule makes on the camera), the dye has one on-state and one off-state, and a moving molecule is drawn where it is at its frame, without motion blur. What it tests is whether an analysis gets back what was put in.
1. A preset, and its key parameters. A preset is a YAML file of all the settings, shipped in smappy/data/simulation_presets or saved as your own in the configuration folder (a file of yours with a shipped name wins). Choosing one sets every setting, the ones it does not name to their defaults, and shows the key parameters it lists – for the pores the labelling efficiency, the photons and the blinks; for diffusion the diffusion coefficient, the density and the track length. A key parameter is the setting itself, shown a second time: editing it there edits the component below.
2. Components. The scene's components are listed under components; select one to see its settings. + adds a new one or one saved before (save... keeps the selected one: a background, beads, a pore of your own); untick one to leave it out. Each component has
channel, and, for a split camera, the split ratio of its photons that go to the second half.3. The structure. A structure is a file that says where the labels are, in nanometres. It is written in YAML, a plain-text format, as a list of elements: single points (or a table of them), lines, circles, filled polygons, or a grey-scale image whose brightness sets the density. Points are placed exactly where the file says. The other elements are filled at a density (labels per nm of line, or per nm² of area), with the number of labels drawn at random around that density, so no two simulations are alike. The file can repeat the structure as copies over the field of view, placed at random or on a grid, turned, tilted and jittered. A structure has no colour of its own: a structure in two colours is two components.
The built-in structures are the files in smappy/data/structures, and each one is also an example of the syntax:
A new structure is a YAML file chosen with from file, or dropped into that folder to become a built-in.

The four built-in structures, as label positions. The pores and filaments are copies of one element, each placed and turned anew; the pie's spokes rise in density going anticlockwise from the right.
4. Where the copies go. A component's placement says where its structure's copies are: as the structure file says; set here – a number (or a density) of copies over the scene's field, turned, tilted and jittered as asked; or where another component's are. The last is what a structure labelled in two colours needs: each copy of the second component is put exactly where a copy of the first is, turned as it is, but with the second component's own geometry and labelling. Two colours of one pore, each pore at its own random place and turn, stay together. In the same way photophysics as lets a component blink as another does, so two components of one dye cannot drift apart.

Two components placed together: the pores of colour 1 set over the field, those of colour 2 placed where they are. Close up on one pore, colour 1 drawn as rings and colour 2 as dots: the same pore in both colours, each labelled on its own (efficiency 0.6 and 0.5), so some labels carry both, some one, some neither.
5. Labelling. Not every label carries a fluorophore. Each one does with the labelling efficiency, and then carries one fluorophore – or another fixed number, or a random (Poisson) number around it. A fluorophore does not sit exactly on its label: an antibody or a linker holds it a few nanometres away. This linkage error comes in two kinds. A fixed one moves the fluorophore once, and all its blinks share the offset. A free one is drawn anew for every blink, as for a dye that turns on a flexible linker.
6. Photophysics. Each fluorophore switches between a dark state and a bright state. It stays dark for a random time (on average the off time) and bright for a random time (on average the on time), and after each blink it bleaches for good with the bleaching probability. The same model serves STORM, PALM and PAINT; PAINT is a long off time. Switching happens at any moment, not only at frame boundaries, so the first and last frames of a blink are dimmer than the ones in between. A bead is always on: one emission from the first frame to the last, never bleached, its photons per blink then per frame.
Nobody knows the off time of a dye, but one knows roughly how often a molecule comes back in an experiment. So the plugin asks for blinks, the mean number of blinks per fluorophore within the measurement, and works out the off time that gives it. A fluorophore cannot blink more often than times on average,
the bleaching probability, and a request for more is refused.
In a real dSTORM experiment one raises the activation as the dye bleaches, to keep the number of molecules per frame steady. The default activation, constant, does the same: the blinks come out spread evenly over the measurement. Decaying keeps the rate fixed, so the blinks thin out as the fluorophores bleach – the more so, the higher the bleaching probability. Every blink until bleached is SMAP's "Dye" model: every fluorophore shows all its blinks, however long the measurement, spread evenly. With one blink each and a long on time it is a tracking experiment's fluorophore: on once, for a track, then bleached.

Left: the blinks of 30 fluorophores over the measurement (default settings, 5000 frames): each row one fluorophore, each tick a blink. Right: how many of 5000 fluorophores are on per frame, for the three choices of activation, with a bleaching probability of 0.3 and 2.5 blinks: decaying thins out as the fluorophores bleach, the other two stay flat.
7. Photons. Each blink gets a total number of photons, drawn at random around photons per blink with a spread of std. The fluorophore emits them at a steady rate while it is on, so each frame gets the share of the time it was on in it.
8. Diffusion, if a component's diffusion is ticked: each of its labels takes a random step every frame, larger the larger the diffusion coefficient D, in 3D, or in the plane (a membrane) with in z too unticked. With a second state, a label spends that fraction of the time diffusing with the second state's coefficient instead; with switching above 0 it changes state as it goes. The table then carries what the tracking tools read as the truth: track_id_true, which particle a localization belongs to, and state_true, the state it was in. The form says how far a particle jumps in a frame and how far apart the particles on in a frame are, which is what Link tracks is set by.

Particles of the Two-state diffusion kind: 60 % of the time at D = 0.8 µm²/s and 40 % at 0.02 µm²/s, switching rarely. Left, the tracks coloured by state: the slow parts stay put, the fast ones roam. Right, the jumps between consecutive frames in each state, against what D and the precision give (lines): the simulation gives what was asked.
9. Drift, if add drift is ticked: the whole sample moves along a slow random path over the measurement, so every localization and every spot is off by where the sample was in its frame.
10a. Localizations. For each frame a fluorophore was on in, the number of photons detected is drawn around what it emitted (Poisson). Below the detection limit there is no localization. The rest are placed at the true position plus a random error whose size is the localization precision a good fit would reach – how precisely a spot of that many photons, on that background, can be located. The same precision is written into the table as xy_err_nm, so the reported error is honest: a plugin that checks precision against the data should find them equal. Two fluorophores on in the same frame closer than the separation would be one spot to a fitter; by default both are removed (close emitters).

What a simulation of the demo gives, close up on the ring. Left: the labels (grey) and the fluorophores (black), at a labelling efficiency of 0.5 and a fixed linkage error of 10 nm: half the labels are empty, and a fluorophore sits near its label rather than on it. Middle: the localizations, a cloud around each fluorophore. Right: the error of each localization over the precision it reports, for those above 200 photons; it follows the standard normal (line), as an honest precision must.
10b. Camera frames. Here every spot is drawn onto a camera: the fluorophore's photons spread over the pixels as a Gaussian of the PSF sigma (astigmatic, whose shape changes with z, if astigmatic is ticked, or a measured PSF from a PSF calibration), on the background, with the camera's shot noise, read noise and gain. Nothing is removed, however dim or crowded: sorting that out is the fitter's job. With split camera ticked the frames have two halves, one above the other: each molecule in both, its component's split ratio of the photons in the lower half, which is placed by a known transformation (a slight turn, scale and shift) and sees a PSF of its own (second half's PSF). Which colour a molecule is shows only in how its light splits – what the two-colour fitters and Assign colours measure. With a dual-colour PSF calibration (made by PSF calibration in Dual colour mode) the split camera is that calibration's instead: its frame and halves, side by side or one above the other, its two measured PSFs, and the second half placed by its registration, mirror included – each spot where and as the two-colour spline fit's model puts it. A one-camera calibration with a split camera, or a dual-colour one without, is refused with a line under the form.
With 4Pi ticked the camera is a 4Pi microscope's: four phase images side by side, each molecule in all four. How its light divides between them follows its z through the interference, and the cavity's phase, which drifts at cavity drift (0.04 rad/s, as Liu and Huang measured). With a 4Pi model as the PSF calibration (made by PSF calibration in the 4Pi mode) the frames are drawn with that model, its channels where its layout puts them and mapped by its registration. Without one they are drawn with a closed-form model: an elliptical Gaussian envelope of the PSF sigma, a fringe of 260 nm, four channels of the frame's size each. Tick astigmatic for it, or the envelope cannot tell z from −z. The preset 4Pi pores (Nup96) is such a scene.
The frames are not written out as images. The plugin saves the simulation file, *.sim.yaml, which is the recipe – these settings and the seed – a few hundred bytes instead of hundreds of megabytes. It is shown among the key parameters while the output is camera frames; left empty, the recipe is named after the preset, in the folder last opened. Open it in a fitter as its file, as you would open a TIFF. Fit this under the form does both at once, without Run: it writes the recipe from the settings as they are and opens it in the Localize tab's open fitter (or Gaussian 2D); drawn with a PSF calibration, in Spline 3D with that calibration filled in; for a split camera in Gaussian 2D 2C, or with a dual-colour calibration in Spline 3D 2C with that calibration; for a 4Pi camera in Spline 4Pi, its model filled in (the closed-form one written beside the recipe as <name>_4pi.h5) with the registration it was drawn with. Astigmatic Gaussian frames on one camera go to Gaussian 2D with elliptical ticked, and its after the fit runs Astigmatic z, which turns the two widths into z, on the simulator's own curves, typed in. Run and Fit this always write the current settings over whatever file is there, so what is fitted is never what an earlier run left. The frames are drawn as the fitter reads them, identically every time, and the fitter takes the camera's pixel size, conversion and offset from it. Tick also write a TIFF for other software.
Two colours, straight into the two-colour fit. The simulation knows the map between the split camera's halves exactly, so beside the recipe it writes it as a transformation file, <name>_2ct.h5, the kind a two-colour fitter reads. A two-colour fitter given the recipe as its file takes that transformation without being asked, instead of measuring it from the movie. A dual-colour calibration carries its own registration, so then no such file is written and Spline 3D 2C takes the calibration. So two-colour pores as frames are: the preset Two-colour pores, simulate set to camera frames, split camera ticked, Fit this, Run – and the fit assigns each localization its colour by how its light split, which the table's truth (channel) can check. While a scene in two colours is simulated as camera frames, split camera is among the key parameters at the top, and until it is ticked a line under the form says that the colours are drawn on one camera as one: such frames go to a one-colour fitter, which cannot tell them apart.

Three frames of the same simulation as camera frames (counts), with the true positions of the spots on in each marked. Some are dim – the start or end of a blink – and some overlap; all are drawn.
A scene. The components switched on are simulated one after another from one random generator, each through the stages above – labels, labelling, blinking, the free linkage error, the emission frame by frame, then its diffusion – and their emissions are merged and sorted by frame. The drift is drawn last. A scene of one component draws exactly the numbers a single structure always drew. A component placed where another's are comes after it whatever the list's order. A link to a component that is not in the scene or is switched off, two components of one name, or links that go round in a circle are refused, naming them.
Sampling a structure. A line of length gets a Poisson number of labels with mean
, uniform along it; a circle of radius
gets
on average; a polygon of area
gets
, uniform inside it, spread evenly over its
z range; an image pixel of brightness (scaled so the brightest pixel is 1) gets
for an image pixel of side
. Every element can be blurred by its
width, a Gaussian per axis. Explicit points are the same in every copy, the sampled elements are drawn afresh for each. Copies are placed uniformly in the field (with a min_distance between them, if given) or on a grid, turned in the plane (rotation: random) or in 3D (random_3d), tilted by up to tilt degrees, and moved by up to jitter nm. Each copy's position and turn are kept with the table, in metadata["copies"], by its number in the copy attribute, as angles with the rotation
.
Diffusion. Per axis a step is Gaussian with variance ,
the frame time, with the state the label had in the frame before: the state holds over the interval. Only the frames a fluorophore emits in are needed. With one state each, the step between two of them
frames apart is one Gaussian of variance
. With two states and switching, the frames between are walked one by one: in each, with the probability switching, the state is drawn again from the two fractions – possibly the same one – so the fractions are exactly the time spent in each state. A label starts in a state drawn from the fractions. The root-mean-square jump in one frame is
in
dimensions; the form shows it with the mean distance between nearest neighbours,
,
the labels on per µm² in a frame (the density times the labelling efficiency times the fraction of frames a fluorophore is on).
The off time from the number of blinks. A fluorophore blinks times before it bleaches, geometric with
. Within a measurement of
frames an unbleached one would be activated
times, Poisson with mean
. It shows
blinks, whose mean is
falls as the off time grows, and the plugin finds the
that makes
equal to blinks by bisection. With the bleaching probability of 0.1 and 3 blinks wanted over 20 000 frames, the off time comes out at about 5600 frames. Setting off time directly overrides the calculation.
Spreading the blinks. With constant activation the blinks are first drawn at the fixed rate, then their start times are mapped, in order, onto as many times drawn uniformly over the measurement. The mapping keeps each fluorophore's own order, so its dark times come out longer early and shorter late – what raising the activation does. If a squeezed dark time would put a blink before the previous one had ended, it waits for the end. Every blink until bleached draws blinks with
blinks and spreads them the same way, so the measurement's length plays no part.
Photons. The total of a blink is drawn from a gamma distribution with mean (photons per blink) and standard deviation
(photons std): shape
, which is never negative and is exactly
when
. The fluorophore emits it at the rate total / on time while it is on. So a blink much longer than average gives more than photons per blink, and a short one fewer.
The precision. The lateral precision per axis is that of a maximum-likelihood fit of a Gaussian spot (Mortensen et al. 2010, their eq. 5):
with the detected photons,
the PSF sigma,
the pixel size and
the background in photons per pixel. Without background the integral is 0 and
; the more the background dominates, the closer the bracket comes to 0 and the larger the error. With EMCCD ticked the variance is doubled, the excess noise of the gain. The z precision is z precision times the lateral one (3 by default). With astigmatic ticked,
is the spot's width at its z (the geometric mean of the x and y widths). The noise added to each position is drawn from exactly these precisions, and
sigma_nm is the true width plus noise of the same size.

The Mortensen precision against photons for three backgrounds (PSF sigma 130 nm, pixels 100 nm), and the of no background at all (dashed). The background matters most for dim spots.
Close emitters. Localizations on in the same frame within the separation of each other are joined into groups, including chains of pairs. With remove both, every member of a group is dropped. With one localization, averaged, a group becomes one localization at the photon-weighted mean of its members, with their photons added, carrying the identity of the brightest and an n_merged attribute: what a single-emitter fit of an unresolved pair converges to.
The camera. A spot's photons are integrated over each pixel (the difference of error functions of the pixel's edges), and pixel is centred at
pixel size, as the fitters assume. Behind a cylindrical lens each axis widens as a focused beam,
and
,
the focal offset and
the focal depth (Huang et al. 2008). The expected photons of each pixel, background included, are drawn as a Poisson count of electrons; with an EM gain – the electron multiplication of an EMCCD camera – that count is multiplied by a gamma of its size, which doubles the variance. The counts are electrons / conversion + offset plus Gaussian read noise, rounded and clipped to 16 bits. The background is flat over a frame, and with its std it varies from frame to frame. The split camera's lower half is the upper one mapped by
dual_transformation: a turn of 0.4°, a scale of 1.004 and a shift of (1.6, −0.9) pixels about the half's centre, written beside the recipe as the _2ct.h5 a two-colour fitter reads. With a dual-colour calibration the frame is the calibration's image_shape, the main half where its geometry says, and the secondary spot at the calibration's to_secondary of the main one, each evaluated from its own spline, as the fit evaluates them (multichannel.build_link). The truth table is on the chip, where the main half's spot was drawn – where Spline 3D 2C reports positions. Each frame's noise has its own seed, so a frame is the same whichever block of the stack it is drawn in.
Drift. A random walk of 0.6 nm per frame and axis, plus a straight creep of 80, −50 and 30 nm in x, y and z over the whole measurement. It is added to the true positions, so localizations and frames drift alike, and the path is kept in metadata["drift_truth"], one row per frame, for comparing a drift correction with it.

A drift path as add drift makes it, over 20 000 frames: the creep, with the random walk on top.
| setting | default | what it does |
|---|---|---|
presetpreset | – | A scene to start from: it fills every setting, and any can then be changed. A preset of yours is saved in the configuration folder's |
simulateoutput | localizations | A localization table directly, or camera frames for a fitter – one camera, or a split one for the two-colour fit (camera frames > split camera). localizations is quick and needs nothing else: the table appears at once, replacing what is open (or beside it, with add as a new file). camera frames write the simulation file and open nothing unless load the truth is ticked; fit the file to get localizations. Choices: localizations; camera frames |
add driftdrift | off | A random walk plus a slow creep of ~100 nm; the truth is kept in the metadata as drift_truth. |
add as a new fileappend | off | Keep the open files and add the simulation as one more; off: it replaces them. |
frames (more)n_frames | 20000 | The length of the measurement. The number of blinks per fluorophore is set by blinks whatever the length, so a longer measurement is a sparser one: fewer molecules on per frame. A short camera stack is dense – lower the labelling efficiency to thin it. at least 1 |
background (more)background | 20 photons/px | Per pixel and frame: in the precision, or drawn into the frames. |
std (more)background_std | 0 | Spread between localizations, or between frames for the camera; 0: always the same. |
field (more)field_um | 10 µm | The side of the square field copies set in a component, homogeneous labels and beads are in. Homogeneous labels and beads fill it; copies set in a component are placed in it. A structure file's own copies keep the field the file gives. at least 0.1 µm |
frame time (more)frame_time_ms | 10 ms | What one frame is in seconds: recorded with the file, and the time diffusion has per frame. at least 0.001 ms |
seed (more)seed | 0 | The same seed and settings give the same simulation. |
| components (a list; each item has the settings below) – The things in the sample; select one to set it. Each item is one kind of thing in the sample, its settings below. Most scenes need one or two: the structure, and perhaps a background or beads. | ||
namecomponents.name | structure | What the list calls it, and what another component's 'same as' names. |
oncomponents.enabled | on | Untick to leave it out. |
colourcomponents.channel | 1 | The localizations' channel; a split camera sends the ratio below of its light to the second half. The localizations' |
split ratiocomponents.split_ratio | 0.5 | Split camera: the fraction of this component's photons in the second half. 0 to 1 |
structure – What is labelled (smappy.simulate.structure): a structure from a YAML, labels spread evenly (homogeneous: a background, or particles to diffuse), or fiducial beads. | ||
labelscomponents.structure.kind | a structure | A structure from a YAML; homogeneous: labels at random over the field; beads: bright fiducials. Choices: a structure; homogeneous; beads |
structurecomponents.structure.preset | ring and cross, with scattered points (demo) | A built-in structure; its YAML in smappy/data/structures is an example of the syntax. |
structure filecomponents.structure.file | – | A structure YAML: label positions, or lines, circles, polygons and images at a density, and copies of them. |
densitycomponents.structure.density_um2 | 1 /µm² | Homogeneous labels, or beads, per µm² of the scene's field. |
z rangecomponents.structure.z_range_nm | 0 nm | Homogeneous labels spread evenly over this range of z about 0. |
placement – Where a structure's copies go (smappy.simulate.structure). | ||
copiescomponents.placement.mode | as the structure file says | The structure file's own copies; copies set here over the scene's field; or the poses of another component's copies, this one's geometry put there. Choices: as the structure file says; set here; where another component's are |
numbercomponents.placement.n | 0 | How many copies; 0: by the density. |
densitycomponents.placement.density_um2 | 0.5 /µm² | Copies per µm² of the field, when the number is 0. |
rotationcomponents.placement.rotation | in the plane | How each copy is turned. Choices: none; in the plane; in 3D |
tiltcomponents.placement.tilt_deg | 0 ° | Each copy tilted by up to this, in a random direction. 0 to 90 ° |
jittercomponents.placement.jitter_nm | 0 nm | Each copy moved by up to this per axis. |
minimum distancecomponents.placement.min_distance_nm | 0 nm | Between the copies' centres. |
componentcomponents.placement.same_as | - | The component whose copies' places and turns this one takes; it must have as many copies. Both components must make the same number of copies: the first one's set here or in its file, the second placed as it. |
| labelling – Labels -> fluorophores. | ||
labelling efficiencycomponents.labelling.efficiency | 1 | The probability that a label carries a fluorophore. Real labelling reaches 0.5-0.7 for good antibodies or tags; 0.6 is a reasonable value for the nuclear pores. 0 to 1 |
fluorophores per labelcomponents.labelling.fluorophores | 1 | Exactly this many on a label that is labelled (rounded), or its mean with Poisson ticked. |
Poisson numbercomponents.labelling.poisson | off | The number of fluorophores per label is Poisson. |
linkage error, fixedcomponents.labelling.linkage_nm | 0 nm | Each fluorophore is off its label by a Gaussian of this width per axis, the same for all its blinks: a rigid linker or antibody. About 10 nm per axis for a primary and secondary antibody, a few nm for a nanobody or a tag. |
linkage error, freecomponents.labelling.linkage_free_nm | 0 nm | A Gaussian offset of this width per axis drawn anew for every blink: a dye that turns freely on a flexible linker. |
photophysics ascomponents.photophysics_from | its own | Another component whose photophysics this one takes; empty: its own, below. |
| photophysics – On, off, bleached: one model for STORM, PALM and PAINT. | ||
on timecomponents.blinking.on_time | 1.5 frames | Mean of an exponential on-time; switching happens at any time within a frame. at least 0.01 frames |
blinkscomponents.blinking.blinks | 3 | Mean number of blinks of a fluorophore within the measurement, which sets the off time; with activation 'every blink', the mean number before it bleaches. The mean over all fluorophores, including those that bleach after one blink. It must stay below 1 / bleaching probability. at least 0.01 |
off time (more)components.blinking.off_time | auto | Mean of an exponential off-time; auto: from the number of blinks. Leave it on auto unless the dye's off time is known; set, it overrides blinks. at least 0.01 frames |
bleaching probabilitycomponents.blinking.bleaching | 0.1 | The probability to bleach after each blink: at most 1/p blinks on average, however long one measures (not used with 'every blink', where it is 1 / blinks). With the geometric number of blinks this gives, many fluorophores blink once and a few many times, as real dyes do. 0 to 1 |
activation (more)components.blinking.activation | constant: ramped against bleaching | Constant: the blinks are spread evenly over the measurement, as an activation raised while the fluorophores bleach keeps them; decaying: a fixed rate, so most blinks come early; every blink: each fluorophore shows all its blinks before it bleaches (1 / blinks per blink), whatever the number of frames, spread evenly – SMAP's 'Dye' model; always on: on from the first frame to the last, never bleached, photons per frame. Choices: constant: ramped against bleaching; decaying: all dark at the start; every blink until bleached, spread evenly; always on: a bead |
photons per blinkcomponents.blinking.photons | 5000 | Mean over a whole blink; a frame gets its share by the time the fluorophore was on in it. A typical dSTORM dye (Alexa Fluor 647) gives a few thousand photons per blink; a fluorescent protein a few hundred. For a bead, always on, it is per frame. |
stdcomponents.blinking.photons_std | 2500 | Spread between blinks (a gamma distribution); 0: every blink the same. |
| motion – Brownian motion of each label, frame to frame (no motion blur). | ||
diffusioncomponents.motion.diffusion | off | The labels diffuse. |
Dcomponents.motion.d_um2_s | 0.5 µm²/s | The diffusion coefficient of the first state. Single molecules tracked from fits want them sparse: keep the jump the form shows below about a tenth of the distance between particles, where linking is nearly perfect. Raise it to see linking fail. |
second statecomponents.motion.slow_fraction | 0 | The fraction of the time in a second state; 0: one state. 0 gives one state. A bound and a free population (D around 0.01 and 1 µm²/s) is the usual case to test a jump-distance or MSD analysis on. 0 to 1 |
D of the secondcomponents.motion.d2_um2_s | 0.02 µm²/s | The diffusion coefficient of the second state. |
switchingcomponents.motion.switch_probability | 0 | Per frame: the state is drawn again. 0 to 1 |
in z toocomponents.motion.in_z | on | Diffuse in 3D; off: in the plane, as in a membrane. |
| optics – The PSF and the pixel, for the precision and for the frames. | ||
pixel sizeoptics.pixelsize_nm | 100 nm | The camera pixel in the sample: enters the precision and sets the frames' scale. at least 1 nm |
PSF sigmaoptics.sigma_nm | 130 nm | The width (standard deviation) of the Gaussian spot in focus. at least 1 nm |
astigmaticoptics.astigmatism | off | A cylindrical lens: the spot's widths follow z. |
focal offset (more)optics.focal_offset_nm | 300 nm | Astigmatic: x is in focus at +this z, y at -this. |
focal depth (more)optics.depth_nm | 400 nm | Astigmatic: how far from its focus a width has grown by sqrt(2). at least 1 nm |
PSF calibrationoptics.calibration | – | Camera frames drawn with a measured spline PSF instead of a Gaussian, and fitted with it: a bead calibration by Spline 3D; for a split camera a dual-colour one, its two PSFs, halves and registration, by Spline 3D 2C. The width and astigmatism settings are then not used for the frames. The localizations output still uses the Gaussian precision. The field's menu also offers every pupil kept with a microscope – M2's and M5's come with smappy, and PSF calibration's Add to microscope... adds yours. Choosing one draws it into a spline at its own emission and this pixel size, kept as a file in smappy's settings folder, and the field then names that file: the frames are drawn with the microscope's PSF, and Fit this fits them with it. Change the pixel size first: the spline is drawn in the pixel it was chosen at. |
in the sample – Where in the sample a pupil (Zernike) calibration is drawn: the part of everything else that takes a spline and is not Spline 3D – the DECODE training, Simulate – with Spline 3D's own fields, names and meanings (plugins.fit.SplineModelSettings), which keeps them in its model part so that saved settings stay valid. Shown only for a calibration that carries a model (sample_state); a bead average has none. The bead's size is never drawn, nor the beads' damping of the supercritical ring (VectorPSF.for_emitters): the SAF comes from the emitter's depth alone, the magnitude being the model's as learnt. | ||
focusoptics.sample.focus | as calibrated | Where the focus is in the sample, for the PSF drawn there from the pupil model, z then the height above the coverslip: auto, from the lowest localizations; in situ, learnt from the molecules with the beads' aberrations; typed; or as calibrated, the beads' PSF at the coverslip. Shown for a calibration made with the pupil (Zernike) method, or a microscope's pupil. typed draws the frames with the PSF of a molecule in the sample with the focus focus depth above the coverslip, as Spline 3D's focus draws it; the scene's z is then the height above the coverslip, so a structure meant to sit in the sample wants z from 0 up. as calibrated, the default, draws the beads' spline, z above its focus. auto and in situ find a focus in a movie, which a simulation does not have. Fit this hands the same focus to Spline 3D. Choices: auto; in situ; typed; as calibrated |
focus depthoptics.sample.focus_nm | 0 nm | How far into the sample the objective was moved from the coverslip; typed here, else found from the movie. A few hundred nm for a cell on the coverslip, more for a thick sample. Its effect is largest near the coverslip, where the light beyond the critical angle reaches the objective only from the molecules close to it. |
sample indexoptics.sample.medium | auto | What the sample is in: water 1.33 (beads, live cells), blinking buffer 1.345 (fixed cells in a dSTORM buffer), index matched (the immersion's), or typed; auto: the index the calibration was learnt with. What the simulated sample is in: auto the index the calibration was learnt with, water 1.33, blinking buffer 1.345, index matched the immersion's. Fit this hands the same choice to Spline 3D. Choices: auto; water; blinking buffer; index matched; typed |
noptics.sample.sample_index | auto | The sample's refractive index the choice stands for; type over it for another. In grey, the index the choice stands for; typing over it makes it typed. 1 to 2 |
| localizations – What a fit would have made of the frames. | ||
detection limitlocalizations.min_photons | 10 photons | Fewer photons than this in a frame and there is no localization; the dim ones that remain are kept, as SMAP keeps them, and Ground Truth leaves them out of its score. Keep it low: the dim localizations are part of real data. Filter them away afterwards (at 200 photons, say) before anything about precision. |
close emitterslocalizations.close | remove both | Emitters on in one frame closer than the separation below are one spot: dropped, or fitted as one at their photon-weighted mean. Choices: remove both; one localization, averaged |
separationlocalizations.min_separation_nm | 250 nm | Closer than this in one frame, two emitters are one spot; 0: never. About twice the PSF sigma: closer than that, a fitter sees one spot. |
z precision (more)localizations.z_factor | 3 x lateral | The z precision as a multiple of the lateral one. |
EMCCD (more)localizations.emccd | off | Localizations only: the excess noise of EM gain, the precision worse by sqrt(2); the camera frames' is EM gain there. For the localizations output only; the camera frames have their own EM gain. |
| camera frames – Camera frames, for a fitter to fit. | ||
simulation filecamera.path | – | Written as the recipe (*.sim.yaml); open it in a fitter as its file, and the frames are made as they are read. Empty: named after the preset, in the folder last opened. Ground Truth finds the simulation again by this path, so a fit whose file has been moved or deleted has no truth to compare with. Left empty, the recipe is named after the preset and overwritten by the next run of it: give a name to keep one. |
also write a TIFFcamera.tiff | off | The frames themselves, beside the recipe, for other software. |
sizecamera.size_px | 100 px | The side of the square frame, which covers x and y from 0 to this times the pixel size; a split camera with a dual-colour calibration takes its frame. at least 8 px |
conversioncamera.conversion | 0.5 e-/ADU | Electrons per camera count. With these defaults and EM gain 0 the camera is an sCMOS. The fitter reads conversion, offset and pixel size from the simulation file, so there is nothing to match by hand. at least 1e-06 e-/ADU |
offsetcamera.offset | 100 ADU | The camera count of a dark pixel. |
read noisecamera.read_noise | 1.5 ADU | Gaussian noise per pixel and frame, in counts. |
split cameracamera.split | off | Two halves, one above the other: each molecule in both, its component's split ratio of the light in the lower one, for the two-colour fit. For the two-colour fit: give the components different colours and split ratios – 0.25 and 0.75 tell the colours apart well at a few thousand photons; closer ratios make the assignment harder, which is what testing it needs. |
second half's PSFcamera.split_sigma_nm | auto | Split camera: the PSF width in the second half, which sees another wavelength; auto: the first's. at least 1 nm |
4Picamera.fourpi | off | Four phase images of a 4Pi microscope side by side, each molecule in all four at the cavity's phase, for Spline 4Pi: drawn with the PSF calibration if it is a 4Pi model, else with a closed-form astigmatic one written beside the recipe. |
cavity drift (more)camera.cavity_drift_rad_s | 0.04 rad/s | 4Pi: how fast the cavity's phase drifts, the slow change of the arms' path difference. |
EM gaincamera.em_gain | 0 | Camera frames only. 0: an sCMOS; otherwise an EMCCD with this gain, its multiplication noise included (the excess factor of 2). |
load the truthcamera.load_truth | off | The true positions of every spot drawn, as a localization table. |
Localizations. A table in nanometres, replacing what is open (or added as a new file with add as a new file):
frame, x_nm, y_nm, z_nm, photons, background, xy_err_nm, z_err_nm and sigma_nm, as a fitter writes them;channel, the component's colour;emitter (which fluorophore), component (which component, by its place in the list), copy (which copy of its structure), n_merged when close emitters are averaged, and with diffusion track_id_true and state_true;simulation_settings, the preset's name among them), the components' names (components), the numbers of labels, fluorophores and blinks, each copy's position and turn (copies, per component when there are several) and, with drift, the drift path (drift_truth).The text says how many localizations came from how many fluorophores and blinks, per component when there are several, and how many were too close together.
Camera frames. The simulation file; with also write a TIFF, the frames beside it; with load the truth, a table of every spot drawn: frame, the true x_nm, y_nm, z_nm (drift included), the photons it emitted in that frame, the background, channel, emitter, component, copy, and neighbour_nm, the distance to the nearest other spot on in the same frame; for a split camera also its ratio, and the transformation between the halves in the metadata.
Comparing with the truth. Ground Truth scores a table against its simulation. It needs no truth table: from a fit of a *.sim.yaml (the fitter writes the file into the table as its source) or from a simulated table (which carries its simulation_settings), it simulates the same molecules again and pairs each localization with its true spot. Because the precision is drawn honestly, a table simulated here should show an error over reported precision close to 1.
Based on SMAP's ROIManager/Segment/SimulateSites (simulatelocs.m) and WorkflowModules/Loaders/SimulateCameraImages (simulatecamera.m) (Ries 2020). The physics within a blink is the same: an exponential on time starting anywhere in a frame, the photons shared by the time on, Poisson counts per frame, for an EMCCD and z three times the lateral precision.
npc structure. doi:10.1038/s41592-019-0574-9