Spline 4Pi

Localize · version 4 · has a preview

Fit 4Pi data: each molecule in every phase channel at once, with the IAB spline model, for x, y, the envelope's z and the interference phase.

What it does

A 4Pi microscope looks at the sample through two objectives, one on each side, and lets the two beams interfere. The camera records four images of every molecule, the phase channels. In each channel the two beams interfere at a different phase, a quarter turn apart. How the molecule's light divides between the four channels says where it is in z within one fringe period, about 260 nm. That position is several times more precise than the shape of the spot can give it.

This fitter fits each molecule in all four channels at once. It uses one model of the microscope's PSF, the IAB model of Li et al. 2020 (doi:10.1364/OL.397754). It finds x and y, and the photons of all four channels together. It also finds two answers for z, kept separate:

After the fit, 4Pi z puts the two together. It follows the slow drift of the cavity, and writes z from the phase on the fringe the envelope's z points to.

It needs a 4Pi model of the microscope, made from beads: with the PSF calibration window's 4Pi mode, or uiPSF v1's psfmodel_*_4pi.h5. The model carries each channel's PSF and how the channels map onto each other. It also needs to know where the channels are on the camera frame (channels).

It reads Hamamatsu DCIMG files, which hold the four channels side by side on one frame, and MATLAB files of qd1 to qd4, the channels already cut. A DCIMG can be fitted live, while the camera is still writing it. The frames are counted by their own records (each frame's footer, written after its pixels, holds its number), not by the file's header, which says how many there are only once the recording ends. A live fit cannot measure the channels' drift, which needs the whole acquisition. It also reads Simulate's 4Pi camera, whose model Fit this fills in.

How it works

1. The channels. Right after the file is read, the frame is cut into its channels, and from then on nothing sees the camera's frame. Detection, the fit, the registration and the drift see only the channels and the maps between them. Three things describe the channels, each kept where it belongs:

2. Finding the molecules on the sum. A molecule can be bright in one channel and nearly dark in the next: the interference moves its light between them. Summed, the four channels show the whole molecule, with no interference left. Only for this, each channel is read onto the first channel's pixels, every pixel from the channel's pixel nearest where the registration puts it, and the channels are added. The molecules are found on that sum, one peak per molecule, with detection's filter and threshold. Detection only decides where the boxes go, and the filter smooths the sum, so a pixel's alignment is enough. On a simulation with a rotated, stretched registration it found the same molecules as interpolating would, at an eighth of the cost.

One simulated frame: the four phase channels as the camera sees them, the last two mirrored, and their sum, where the molecules are found (circles). The same two molecules are bright in some channels and faint in others.

3. One fit in four channels. Each channel gets its own fit box, cut at its own pixels where the map puts the molecule. Nothing is resampled for the fit: the part of the map smaller than a pixel goes to the fitter, as in Spline 3D 2C. The fitter finds one x, y, z, photon number and phase for all four boxes, and a background for each.

The fit of the simulation against its truth: x (left), the envelope's z (middle) and the phase (right). Each panel compares the scatter about the truth (bars) with the precision the fit reports for itself, the CRLB (line).

In detail

The model. Channel sees

Here is the light that does not interfere and , the part that does, each a cubic spline in x, y and z. is the photon number, the phase and the channel's background. and are demodulated: the fast oscillation along z has been taken out of them and is carried by , so they change as slowly as the spot's shape does. Each channel's own phase offset, and its share of the light, are in its own , and . An offset that is not exactly a quarter turn, or a channel with less contrast, is then simply part of the model. Bates et al. 2022 (doi:10.1038/s41592-022-01465-8) measured 5-10 nm of z bias from assuming equal channels.

Photons. The channels' models are normalised together: their sum to one over the focal plane, so is the photons in all four channels. uiPSF v1 normalised to two, so its photon numbers were half; its models are renormalised when read. The photon number is one for all channels and cannot be unlinked. The phase is the way the photons divide between the channels, and a photon number for each channel would take up the interference and leave the phase undetermined.

Starting values. For a fixed z the model is linear in , and . So at each z plane of the model a small weighted least-squares fit over every pixel of every channel gives the phase and the photons directly, from anywhere on the circle. The planes where it fits best (z starts, two by default) are where the fit starts, and the fit with the higher likelihood is kept. On simulations with the very model that fits them, every fit found the true phase: of 20,000 molecules at the 4Pi-SMS example's photons and background, 0.01 % ended more than five errors off, with one start or with five.

On real data a fit can stop in a worse optimum where data and model disagree: a bright molecule, a model of a few beads. A second start at another phase (phase starts 2) reaches the better one. On the 4Pi-SMS example 5 % of the molecules were such fits, the phase off by about 1.5 rad and z unchanged; on uiPSF's Nup96 example 2.5 %, mostly dim. It doubles the fit's time. Neither a cheap check of the phase a quarter turn away nor a second start only for poor fits caught them at less cost. So it is a choice: one phase start for speed, two for the last few per cent. More z starts than two change almost nothing: two and three differed in 0.02 % of the molecules.

The fit. A Levenberg-Marquardt maximum-likelihood fit for Poisson noise (with an sCMOS camera's read noise, as the other fitters). x, y, z, the photons and the phase are shared by all channels. Each channel has its own background. It gives the same numbers as uiPSF v1's 4Pi fitter. On the beads v1 learned its model from, the two agree within 0.0003 pixels, 0.02 z slices and 0.001 rad. On v1's Nup96 molecules the median difference is 0.11 slices in z and 0.014 rad in phase.

The envelope's z at the end of the model. A fit that ends on the first or last plane of the model was held there. Its true z could be anywhere beyond, and its error, taken at the edge, says nothing. Such a fit gets the model's whole z range as its error, which 4Pi z then gives no weight.

The maps. A model from uiPSF v1 keeps, for each channel after the first, an affine map about the image centre. v1 read MATLAB files with rows and columns swapped. A model learned from such files is turned the right way round when it is read, its maps with it. On the Nup96 example, fitting each channel's position freely gave back the maps' offsets to within 0.06 pixels.

Registration from beads. For a model without maps, or a camera moved since the model was made, registration can be measured on beads. A bead looks different in every channel at any one z, because the interference moves its light between them. So the bead acquisition is summed over all its frames, every z step and every phase step, which leaves each channel the bead's envelope. Its centre is fitted with a Gaussian. The channels are put roughly on top of each other by the cross-correlation of these images, the beads are paired within 3 pixels, and each channel's map onto the first is the robust projective fit of Spline 3D 2C's registration. With fewer than 8 pairs it is a shift: their mean offset. A folder of bead files is pooled. On uiPSF's 26 bead scans this gave 111 pairs per channel, 0.03 pixels rms about the maps. Where the beads were, the maps were within 0.06 pixels of the ones uiPSF v1 learned with its model.

Channel drift. The channels can move against each other while the acquisition runs. A registration measured on another day can also be off, and a bead's envelope cannot show where the model's PSF of each channel is centred. channel drift measures all of these from the data before the fit. It fits drift blocks blocks of frames per block frames, spread over the acquisition, with x and y free in every channel. The median offset of each channel from where the map puts it, in each block, over the better half of the localizations, is that channel's drift there. Between blocks it is interpolated, and beyond the first and last it is held. The fit then cuts each channel's box where the map and the drift put the molecule. On the Nup96 example, with the registration from another day's beads, the channels were off by up to 1 pixel, steady to 0.1 pixels over the two files. SMAP measured this once, on the first 3000 frames.

Grouping. The phase is an angle: the mean of 3.1 and -3.1 rad is pi, not 0. Grouping a blink's localizations averages the phase as unit vectors, each weighted by its error, and combines phase_err_rad like any precision.

The phase's direction. The phase's slope in z is part of the model and kept with the table, for 4Pi z. uiPSF v1 built its bead models and its in-situ models with opposite signs; each is read with its own.

Parameters

settingdefaultwhat it does
source – Where the frames come from.
   file
   source.path
–Any file of the acquisition: a Micro-Manager TIFF series, an NDTiff directory, one image out of a folder written one file per frame, or a simulation (*.sim.yaml, File > Simulate).
   first frame (more)
   source.start
0Frames before this one are skipped.
   last frame (more)
   source.stop
autoAuto: to the end. at least 1
   live
   source.live
offThe file is still being written: fit what is there and keep watching for new frames.
   stop after (more)
   source.live_timeout
30 s idleLive: give up after this long without a new frame. at least 1 s idle
   frames per block (more)
   source.chunk
200Frames read and detected at once; only memory and speed depend on it. at least 1
microscope – The microscope and its camera: ADU -> photons and pixel -> nm. Empty fields come from the file, the camera database and the microscope database; shown as one line and a window (gui.microscope_form), the values locked until unlocked.
   microscope
   camera.microscope
autoAuto: recognised from the file's metadata, else the last one used.
   camera
   camera.camera
autoAuto: identified from the file's metadata, else the microscope's.
   conversion
   camera.conversion
autoPhotoelectrons per count; auto: from the file or the camera database.
   offset
   camera.offset
autoThe count of a pixel that saw no light.
   EM gain on
   camera.em_on
autoAn EMCCD with its electron multiplication on: the counts are divided by the gain, and the noise is doubled.
   EM gain
   camera.emgain
autoThe EM gain the camera was set to.
   pixel size
   camera.pixelsize_um
autoThe pixel's size in the sample, after the magnification.
   pixel size y
   camera.pixelsize_y_um
autoAuto: square pixels, the same as in x, or the microscope's.
   read noise
   camera.read_noise_e
autoRms per pixel; auto: the camera's, else 1 (an sCMOS).
channels – Where a 4Pi's phase channels are on the chip: the channels part of Spline 4Pi and of the PSF calibration window's 4Pi beads, one part so that the two read a chip alike (fourpi_layout). The maps between the channels are not here: they are the model's, learnt with the PSF.
   layout
   channels.layout
the file's, else the microscope'sWhere the phase channels are: the file's own layout, the microscope's (the database), typed, or the 4Pi-SMS design.

auto takes the file's own layout where it has one: MATLAB quadrant files put the channels side by side. Otherwise it takes the microscope's: in its entry of the microscope database, each channel can have a region ([x, y, width, height] on the chip, or one per camera) and a mirror ("x", "y" or "xy"). Set it there once and every acquisition finds it, whatever its camera ROI. The shipped entry 4Pi-SMS example, with its camera, is one: the layout of the 4Pi-SMS consortium's example data. To try a layout first, type the corners, on the chip: SMAP's 4Pi settings file gives them as x4pi, y4pi, width4pi, height4pi and mirror4pi. 4Pi-SMS is the Bewersdorf-lab design: four 168-pixel images on a 2048 x 168 strip, the last two mirrored.

Choices: the file's, else the microscope's; the microscope's; as the file lays them out; typed corners; 4Pi-SMS (Bewersdorf lab)
   x corners
   channels.x_corners
0, 200, 400, 600Each channel's left edge on the chip, comma-separated.
   y corners
   channels.y_corners
0, 0, 0, 0Each channel's top edge on the chip.
   width
   channels.width
200 pxOne channel's width. at least 8 px
   height
   channels.height
200 pxOne channel's height. at least 8 px
   mirrored in x
   channels.mirrored
–The channels mirrored left-right, by number from 1, comma-separated; empty: none.
detection – Finding candidates in the filtered image.
   filter
   detection.filter
difference of GaussiansWhat the frame is smoothed with before maxima are looked for; the difference of Gaussians also removes a smooth background. Choices: difference of Gaussians; Gaussian
   filter sigma
   detection.sigma
1.2 pxThe width of the smoothing: about the PSF's. at least 0.1 px
   cutoff
   detection.cutoff_mode
dynamic (x noise)Dynamic: set per frame from the noise of the filtered image; absolute: a fixed value. Choices: dynamic (x noise); absolute (photons)
   cutoff value
   detection.cutoff
1.7Lower finds dimmer molecules, and more noise.
fit region – Where in the frame to fit: shapes drawn on the preview's frame.
   drawn
   region.shapes
Drawn on the Preview's frame: candidates outside the include shapes, or inside an exclude shape, are not fitted.
   use the region
   region.use
onOff fits the whole frame and keeps the shapes.
model
   4Pi model
   model.calibration
–A 4Pi model (.h5): this program's or uiPSF v1's.

A 4Pi model made from beads of the same microscope, with the dye's filter. uiPSF v1's bead model (psfmodel_zernike_4pi.h5) and in-situ model (psfmodel_iter*_insitu_zernike_4pi.h5) both work.

   link x, y
   model.link_xy
onOne position for every channel; off measures each channel's own, to check the registration.

Unlinked, each channel gets its own x and y. The table then has, for each channel, how far its position is from where the map puts it (dx_nm_ch1, ...). Their medians are how far the registration is off.

   z starts (more)
   model.starts
2How many z planes of the phasor start are fitted from. 1 to 6
   phase starts (more)
   model.phase_starts
1From each z start, how many phases around the circle; 2 catches the few fits that stop in a worse optimum, at half the speed.

1 by default. 2 for the final localizations of a measurement, where 2-5 % of the molecules otherwise keep a phase about 1.5 rad off, 70 nm in z from the phase.

1 to 4
   channel drift
   model.channel_drift
offMeasure how the channels move against each other, from fits with x and y free per channel, and follow it.

It costs a second fit of drift blocks × frames per block frames, 5000 by default. Worth it for every long acquisition, and whenever the registration was not measured on the same day. Each fit's offsets are weighed by its error and those that are no pair left out; with over time (the default) they make a smooth curve over the acquisition, as the two-colour fitters' channel move does, else one offset per channel. The run draws each channel's offsets and the curve in a tab of its own.

   drift blocks (more)
   model.drift_blocks
10How many blocks of frames, spread over the acquisition, the drift is measured in. at least 1
   frames per block (more)
   model.drift_frames
500 framesHow many frames each block fits. at least 10 frames
   over time
   model.drift_over_time
onFollow the drift over the acquisition as a smooth curve; off: one offset per channel for the whole acquisition.
registration – How the channels map onto the first: the maps kept with the model, measured on beads, a saved registration, or none.
      from
      model.registration.source
the model'sThe maps kept with the model, measured on beads, a saved registration, or none.

Use the model's: the PSF of each channel was learned centred where its map puts the molecule, so the two belong together. from beads is for a model without maps, or after the camera has moved. Tick channel drift with it, which also corrects the part of the registration that beads cannot see. none is for channels that were registered before they were saved.

Choices: the model's; from beads; from a registration file; none
      beads
      model.registration.beads
–A bead acquisition in this layout (a z stack), or a folder of them; measured once, kept beside them.

A bead z stack taken in the same layout: a DCIMG file or series, a quadrant .mat file, or a folder of either. Beads all over the field make a projective map. A few beads make only a shift. It is measured once and kept beside the beads (<name>_channels.json, or channel_registration.json in a folder). It is measured again when a bead file is newer, or the rectangles differ.

      registration file
      model.registration.path
–A channel registration (.json), as beads leave beside them.

A registration that beads left, used for another acquisition. It is readable as text: each channel's map is also given as its shift at the channel's centre, its scale and its rotation.

fit – Everything about the fit that is not the camera or the PSF model.
   fit box
   fit.roisize
13 pxThe square cut around each candidate and fitted. at least 5 px
   iterations (more)
   fit.iterations
50The most steps a fit may take. at least 1
   max fit distance (more)
   fit.max_fit_distance
autoReject fits that ran off; auto: keep all.
   per-pixel noise (more)
   fit.per_pixel_noise
offAn sCMOS's offset and read noise pixel by pixel, from the camera's noise map.

Each phase channel's pixels weighted by their own read noise, from the camera's noise map (Camera noise calibration), cut into the four channels as the frames are. The map must cover all four rectangles; record the dark frames with the camera ROI of the data, or the whole chip.

output
   save HDF5
   output.save
onWrite the table to a file as it is fitted.
   file
   output.path
–Filled from the source: <acquisition>_locs.hdf5 next to the folder the images are in.
   raw frames (more)
   output.raw_frames
50Camera frames kept with the table, in photons, after their average; 0: none.
   show image tags (more)
   output.show_tags
PIZStageImage tags drawn while the fit runs and when it is done, names or parts of names; empty: none (Analysis/Process/Image Tags).
after the fit – The steps in the order they run; each step's settings follow its switch.
   astigmatic z
   finish.astigmatic_z
offZ from the widths of the elliptical Gaussian, before any drift correction so that it can correct z (Analysis/After fit/Astigmatic z).
z calibration
      calibration
      finish.astigmatic.calibration
from a fileA file from the PSF calibration window (elliptical Gaussian), or the curves typed. Choices: from a file; typed
      file
      finish.astigmatic.path
–An astigmatic z calibration (.h5).
curves – One curve per axis, s(z) = s0 sqrt(1 + u^2 + A u^3 + B u^4), u = (z - focus) / depth.
         width x
         finish.astigmatic.typed.sigma_x_nm
130 nms0: the narrowest the spot gets in x. at least 1 nm
         focus x
         finish.astigmatic.typed.focus_x_nm
300 nmThe z where x is narrowest; z = 0 is the round spot.
         depth x
         finish.astigmatic.typed.depth_x_nm
400 nmHow far from its focus the x width has grown by sqrt(2). at least 1 nm
         width y
         finish.astigmatic.typed.sigma_y_nm
130 nms0: the narrowest the spot gets in y. at least 1 nm
         focus y
         finish.astigmatic.typed.focus_y_nm
-300 nmThe z where y is narrowest.
         depth y
         finish.astigmatic.typed.depth_y_nm
400 nmHow far from its focus the y width has grown by sqrt(2). at least 1 nm
         A x (more)
         finish.astigmatic.typed.a_x
0Huang's cubic term in x.
         B x (more)
         finish.astigmatic.typed.b_x
0Huang's quartic term in x.
         A y (more)
         finish.astigmatic.typed.a_y
0Huang's cubic term in y.
         B y (more)
         finish.astigmatic.typed.b_y
0Huang's quartic term in y.
         z range
         finish.astigmatic.typed.z_range_nm
800 nm+- this: where the curves are trusted. at least 10 nm
      z scale
      finish.astigmatic.z_scale
1True z per apparent z: about 0.7-0.8 for an oil objective imaging in water, 1 for none. at least 0.01
   4Pi z
   finish.fourpi_z
onZ from the interference phase of a 4Pi fit, unwrapped by its envelope z (Analysis/After fit/4Pi z).
4Pi phase
      calibration
      finish.fourpi.slope
as fittedThe phase's slope in z: kept with the table by the 4Pi fit, or read from a 4Pi model file. Choices: as fitted; from a model file
      model
      finish.fourpi.path
–A 4Pi model (.h5): this program's or uiPSF v1's.
      time window
      finish.fourpi.window_frames
1000 framesThe cavity's phase is measured over this many frames. at least 10 frames
      smoothing
      finish.fourpi.smoothing
1 windowsAverage each window with its neighbours, this many in all. at least 1 windows
      refine period
      finish.fourpi.refine_period
offFind the fringe period that the data agree with best.
      z scale (more)
      finish.fourpi.z_scale
1True z per apparent z: 1 when sample and immersion index match. at least 0.01
   overlay channels
   finish.overlay
offMove the second half of a two-channel fit onto the first, by beads; channel is the half (Analysis/After fit/Overlay channels).
channel overlay
      transformation from
      finish.overlay_channels.source
transformation fileA saved registration, beads already fitted as two channels, or bead movies to fit. Choices: transformation file; fitted beads; bead movies
      file
      finish.overlay_channels.path
–A _2ct.h5 (Calibrate transform, or this plugin's), or a dual-colour bead calibration.
      fitted beads
      finish.overlay_channels.beads_table
–Bead localizations fitted with channels > read: two channels.
      bead movies
      finish.overlay_channels.beads
–A folder of bead movies, or one movie's path; beads seen in both halves.
bead fit – How the bead movies are fitted: Gaussian 2D, two channels, the sample's camera.
         cutoff
         finish.overlay_channels.bead_fit.cutoff
1.7The detection threshold, in units of the filtered frame's noise (the fitters' dynamic cutoff). at least 0.1
         at most
         finish.overlay_channels.bead_fit.max_frames
autoFrames fitted per bead movie; auto: all. at least 1 frames
channels – Where a split chip's two channels lie: the microscope's entry, or chosen by hand.
         layout
         finish.overlay_channels.channels.layout
the microscope'sHow the chip is split: the microscope's entry, or chosen by hand with the main channel and the split. Choices: the microscope's; right-left; right-left mirrored; up-down; up-down mirrored
         main channel
         finish.overlay_channels.channels.main_channel
the microscope'sThe channel the other is registered onto: the microscope's (its transmitted arm), or either half, to swap them. Choices: the microscope's; left; right; upper; lower
         split position (more)
         finish.overlay_channels.channels.split_position
autoThe first pixel of the second channel, on the chip, for a layout chosen by hand; empty: the middle of the frame. at least 1 px
registration – How a registration between two channels is measured: the vote, the pairing and the fit.
         transformation
         finish.overlay_channels.registration.model
projective (8 coefficients)Projective extrapolates gracefully; the polynomial describes a distorted field far better where the pairs reach, and is refused when they do not reach far enough. Choices: projective (8 coefficients); polynomial, order 3 (20)
         vote bin (more)
         finish.overlay_channels.registration.vote_bin_px
2 pxThe bin of the histogram of pair vectors the offset is voted in. at least 0.1 px
         vote smoothing (more)
         finish.overlay_channels.registration.vote_smooth_px
4 pxThe width of the difference-of-Gaussians filter the vote is scored with. at least 0.1 px
         coarse matching
         finish.overlay_channels.registration.coarse_tolerance_px
20 pxFirst pass; must cover the rotation between the channels – 3 degrees over 512 px is 27 px. at least 0.1 px
         fine matching
         finish.overlay_channels.registration.fine_tolerance_px
1 pxSecond pass over clean matches only, which is where the accuracy comes from; 0 skips it.
         adapt fine matching (more)
         finish.overlay_channels.registration.adapt_fine_tolerance
onWiden the fine matching to what the coarse fit misses its own pairs by, when those pairs are clean.
         minimum pairs (more)
         finish.overlay_channels.registration.min_pairs
20Fewer pairs than this and the registration refuses. at least 4
         pairs used in the fit (more)
         finish.overlay_channels.registration.max_pairs
20000At most this many pairs, drawn at random, go into each fit. at least 4
         outlier threshold (more)
         finish.overlay_channels.registration.reprojection_threshold_px
1 pxThe robust (RANSAC) fit's inlier radius, at least; it widens with the matching tolerance. at least 0.01 px
         dx/dy limit (more)
         finish.overlay_channels.registration.transform_axis_limit_px
0.5 pxThe largest |dx| or |dy| a pair may keep after the first fit, at least; it widens with the matching tolerance. at least 0.01 px
      keep the registration
      finish.overlay_channels.save
onWrite it beside the beads as <name>_2ct.h5 and use it again while the beads and these settings are unchanged.
   drift correction
   finish.drift
noneEstimate the drift from the finished table and subtract it from every localization. Off by default: it is minutes of work on a dataset it cannot see beforehand. Choices: none; RCC; COMET
RCC drift – How finely to bin, render and search.
      time windows
      finish.rcc.n_timepoints
20How many windows the acquisition is cut into: more follow faster drift, fewer are less noisy. at least 2
      pixel size
      finish.rcc.pixelsize_nm
15 nmThe pixel of the images that are correlated; about the localization precision. at least 1 nm
      z bin (more)
      finish.rcc.z_pixelsize_nm
5 nmThe bin width of the z histograms. at least 0.1 nm
      max drift
      finish.rcc.max_drift_nm
500 nmThe largest drift between any two windows that can be found. at least 1 nm
      peak fit half-width (more)
      finish.rcc.fit_window
3 pxThe patch the correlation peak is fitted over, for its sub-pixel position. at least 1 px
      max image size (more)
      finish.rcc.max_pixels
2048 pxA wider field of view is folded back onto itself, to keep the correlation fast. at least 64 px
      correct z
      finish.rcc.use_z
autoAuto: if the table has z.
      merge blinks
      finish.rcc.group
onMerge the localizations of one blink into one before measuring.
      within (more)
      finish.rcc.group_dx_nm
autoHow close localizations in consecutive frames must be to be one blink; auto: the session's merge settings.
      dark frames (more)
      finish.rcc.group_dt
autoHow many dark frames a blink may skip; auto: the session's merge settings.
      tile (more)
      finish.rcc.tile_nm
200 nmThe axial pass correlates z histograms in tiles of the field of view this size. at least 1 nm
      tile y (more)
      finish.rcc.tile_y_nm
autoAuto: square tiles. at least 1 nm
      max axial drift (more)
      finish.rcc.axial_max_drift_nm
200 nmHow far from zero the axial correlation peak is looked for. at least 1 nm
      skip zero shift (more)
      finish.rcc.exclude_zero_lag
onLeave the zero-shift sample out of the axial peak search.
      error bar
      finish.rcc.split_half
onEstimate again from each half of the field and show both: how far they differ is twice the curve's noise.
      reference (more)
      finish.rcc.reference
as estimatedThe frame the drift is zero at; first or last frame for consecutive files. Choices: as estimated; first frame; last frame
COMET drift – COMET parameters. The defaults suit a typical SMLM movie.
      window unit (more)
      finish.comet.segmentation_mode
framesWhat window size counts; time-window fit only. Choices: frames; localizations; windows
      window size
      finish.comet.segmentation_var
500Frames or localizations per time window, or the number of windows; time-window fit only. at least 1
      max drift
      finish.comet.max_drift_nm
300 nmThe largest drift expected; also the radius within which localizations are paired. at least 1 nm
      target sigma
      finish.comet.target_sigma_nm
30 nmThe finest width of the overlap Gaussian, where refinement stops. at least 0.1 nm
      initial sigma (more)
      finish.comet.initial_sigma_nm
autoThe width the refinement starts from; auto: a third of max drift.
      smoothing (more)
      finish.comet.boxcar_width
1 windowsRunning mean over this many windows between refinement steps; 1 is none; time-window fit only. 1 to 1000 windows
      interpolation (more)
      finish.comet.interpolation
cubicThe curve from the window estimates to every frame; time-window fit only. Choices: cubic; catmull-rom
      max locs / window (more)
      finish.comet.max_locs_per_segment
autoA random subset of at most this many per window; auto: all; time-window fit only. at least 1
      ftol (more)
      finish.comet.optimizer_ftol
1e-07Relative change of the cost at which the optimizer stops.
      approximate kernel (more)
      finish.comet.approximate_kernel
onSkip pairs more than 6 sigma apart; the spline fit always does.
      ftol coarse (more)
      finish.comet.optimizer_ftol_coarse
autoFtol for the steps above the target sigma; auto: ftol; time-window fit only.
      quality control (more)
      finish.comet.quality_control
offDiscard time windows whose fit does not beat no correction; needs fit spline off.
      min lift (more)
      finish.comet.min_lift
0How much a window's fit must improve its overlap over no correction to be kept.
      merge blinks
      finish.comet.group
onMerge the localizations of one blink into one before estimating.
      within (more)
      finish.comet.group_dx_nm
autoHow close localizations in consecutive frames must be to be merged; auto: the session's merge settings.
      dark frames (more)
      finish.comet.group_dt
autoHow many dark frames a blink may skip; auto: the session's merge settings.
      two stage (more)
      finish.comet.two_stage
offA grouped pass, then an ungrouped one within fine radius.
      fine radius (more)
      finish.comet.two_stage_radius_nm
30 nmThe max drift of the second, ungrouped pass.
      RCC first (more)
      finish.comet.rcc_prepass
offCorrelate rendered time windows to take out the bulk of the drift, then run COMET over a small max drift.
      RCC windows (more)
      finish.comet.rcc_prepass_windows
10The time windows RCC correlates. at least 2
      RCC max drift (more)
      finish.comet.rcc_prepass_max_drift_nm
autoAuto: RCC's own default.
      fit spline
      finish.comet.spline
onFit the drift as a smooth curve in time rather than one value per time window.
      knot spacing
      finish.comet.spline_knot_frames
2000 framesFrames between the spline's coefficients. at least 10 frames
      spline penalty (more)
      finish.comet.spline_penalty
0Extra penalty on the curve's bending; 0 is none.
      transformation
      finish.comet.transformation
shiftWhat changes over time besides the position; spline fit only. Choices: shift; xy scale; xy scale + rotation; xy affine; xy affine + z scale; 3D affine
      transformation knots (more)
      finish.comet.transformation_knot_frames
autoFrames between the transformation's spline coefficients; auto: the knot spacing. at least 10 frames
      transformation penalty (more)
      finish.comet.transformation_penalty
0Pulls the transformation towards none where the data say little; 0 is none.
      correct z
      finish.comet.use_z
autoAuto: if the table has z.
      precision weights
      finish.comet.precision_weights
onWiden each pair's Gaussian by the two localizations' precisions, so imprecise ones count less; needs xy_err_nm, and z_err_nm for z.
      z width (more)
      finish.comet.sigma_z_factor
1 x lateralThe overlap Gaussian's width in z as a multiple of its lateral width; 1 is one width for all axes. 0.1 to 20 x lateral
      error bar
      finish.comet.split_half
onEstimate again from each half of the field and show both: how far they differ is twice the curve's noise.
      reference (more)
      finish.comet.reference
as estimatedThe frame the drift is zero at; first or last frame for consecutive files. Choices: as estimated; first frame; last frame
   assign colours
   finish.assign_colors
onSplit the localizations by their photon ratio and write channel (Analysis/After fit/Assign colours).
colour assignment
      method
      finish.colors.mode
split at the minimaA cut in r, or a posterior per localization. Choices: split at the minima; probabilistic
      colours
      finish.colors.colors
2How many species the histogram of r holds. 1 to 6
      exclusion dr
      finish.colors.exclusion
0.05Minima: leave this much of r on either side of a boundary unassigned.
      sigma
      finish.colors.tolerance
3Probabilistic: a colour is given only within this many sigma of its expected split, the sigma being that localization's own photon statistics plus any extra spread. 0: assign to the nearest colour however far away.
      keep the tails
      finish.colors.keep_tails
offProbabilistic: apply the sigma test only between the outermost colours, so a localization more extreme than the first or the last mode is kept rather than refused.
      allowed crosstalk
      finish.colors.crosstalk
0.05Probabilistic: refuse what is too close to call as well – the largest expected fraction of wrongly assigned localizations. Narrow beside the sigma test, and what matters where two colours overlap. 1e-06 to 0.5
      extra spread
      finish.colors.spread
0Probabilistic: a species' own width in r, added in quadrature to the shot noise, for a dye whose splitting ratio varies across the field or between molecules. 0: shot noise alone (the summary prints what the modes suggest).
      use fitted errors
      finish.colors.use_errors
onTake the photon errors from the fit where the table has them; otherwise sqrt(photons).
      use abundances (more)
      finish.colors.use_prior
onProbabilistic: weight each species by how much of the sample sits under its mode.
      minimum photons (more)
      finish.colors.min_photons
0Localizations with fewer photons in total are ignored and left unassigned.
      intensity LUT (more)
      finish.colors.cmap
viridisThe colour map of the intensity plot's 2D histogram. Choices: viridis; cividis; turbo; magma; inferno; Greys; Greys_r
      histogram bins (more)
      finish.colors.bins
200How many bins the histogram of r has over its whole range, -1 to 1. 10 to 2000
      smoothing (more)
      finish.colors.smoothing
2 binsThe histogram is smoothed by this much before its maxima are looked for; it also sets how far apart two modes must be.
      expected r (more)
      finish.colors.expected
autoThe species' ratios, comma separated ("-0.65, 0.96"), measured on single-label samples or computed from the spectra. auto: the histogram's own maxima.
      channel 1 attribute (more)
      finish.colors.channel1
autoAuto: photons_ch0, or the first pair of per-channel attributes in the table.
      channel 2 attribute (more)
      finish.colors.channel2
autoThe attribute r counts negative; name both attributes or neither.
   then chain
   finish.chain
–A saved chain run last, on the finished table; empty: none.

Output

The localizations on the camera chip, where the first channel saw them: its own pixels put back on the frame, a mirror undone, the camera ROI's corner added – as every fitter reports positions. The raw frames kept with the table are the first channel's, on its rectangle of the chip. A fit region is drawn on the Preview's sum panel, shown where the first channel lies on the frame; a shape is a part of the sample, so a part of it lying on another channel's rectangle is copied onto the first, through the channels' maps. Besides the usual attributes:

The table's metadata keeps the phase's slope in z and the channel layout. A good fit has a phase error of a few hundredths of a radian for a bright molecule. The envelope's z then spreads about as far as its error says.

Differences from SMAP

SMAP's 4Pi fitter is MLE_4Pi, which ran uiPSF's closed-source fitter (SMAP: Ries 2020, doi:10.1038/s41592-020-0938-1).

References