Analysis › Register · version 5 · has a preview
Measure the transformation between the two channels of a split camera from localizations fitted as two channels: the layout from the microscope or chosen, no initial shift and no magnification needed.
A two-colour splitter (also called a dual-view or image splitter) images the sample twice, side by side on one camera: each half of the chip sees the same field through a different filter. The two images never lie exactly on top of each other. The second is shifted, slightly turned and slightly magnified, and at the corners of the field the difference is several pixels. To combine the two halves – to fit each molecule in both, as Gaussian 2D 2C does – the program needs the transformation that maps a position in one half onto the same position in the other – the registration of the two channels, also called channel alignment, mapping or chromatic correction.
This plugin measures that transformation from localizations, without beads. In a ratiometric experiment – dyes told apart by how their light divides between the halves – every molecule is imaged in both halves at once. Fit the movie with a plain Gaussian 2D fit as two channels (channels > read: two channels): each half is then detected and fitted on its own, and each localization keeps the channel it was found in, camera_channel. Every molecule shows up twice in the same frame, once in each channel. The plugin finds those pairs, and fits the map that takes one partner onto the other.
It needs no starting values: not the shift and not the magnification. What it does need is how the chip is split – left and right or upper and lower, whether one half is mirrored, which half is the main one. That is a fact about the microscope, and it comes from the microscope's entry in the Microscope manager for the microscope the table was fitted on; for a microscope without one, choose it (channels: layout, main channel), in the fit and here. It is never guessed. It also needs a table with frame and camera_channel attributes and positions that can be put back into camera pixels, and enough molecules seen in both channels: a few hundred pairs at the least, from frames spread over the movie.
The 2C fit can do this step itself, on the first frames of the movie (registration > from this movie). Run it here to see what it found before trusting it, or to save a transformation for movies too sparse to register on.
1. Positions in camera pixels. A transformation is a property of the camera, so it is measured in chip pixels. A table in nanometres is converted back with the pixel size the fit recorded. Only the localizations of the current selection are used – those that pass the layer's filter (the lowest and highest values of attributes, set in the Render tab), inside the drawn ROI (region of interest).
2. The vote. The layout alone says roughly where the second channel's image of a molecule is: its half moved onto the main one, flipped back if the optics mirror it. Every localization of the second channel is put there first. Then, for every localization of the main channel and every one of the second in the same frame, the vector from one to the other is collected. Most of these vectors connect unrelated molecules and point anywhere. But every molecule seen in both channels adds the same vector – what the splitter adds to the layout's rough map – so over many frames that vector turns up again and again, and stands out in a histogram of all of them as a sharp peak. Its position is that offset, found without any guess.

Left: the simulated localizations on the chip; every molecule of the upper channel appears again in the lower one. Right: the vote, the vectors from each localization of the lower channel, moved up by the layout, to each of the upper one in the same frame – the ring marks the one offset that thousands of them share.
3. Pair and fit, twice. First, every localization of the second channel is paired, frame by frame, with the nearest one of the main channel where the layout and the offset say its partner should be, within coarse matching (20 pixels). The offset is only a shift; the wide tolerance is what lets the pairs still be found when the halves are also turned or scaled. A projective transformation is fitted to these pairs, robustly, so that the chance pairs a wide tolerance lets in are voted out (In detail). Then everything is paired again, this time through the fitted map and within fine matching (1 pixel, or wider if the first fit shows it must be), and the map is fitted again on these clean pairs. The second round is where the accuracy comes from.

Left: how far the partners of each pair are apart after the fit. The first round, paired within 20 px on the offset alone, lets in chance partners (the tail), which the robust fit rejects; the second, paired through the fitted map, keeps clean pairs only. Right: the error of the final map over the field, against the transformation that was simulated – a hundredth of a pixel, far below the scatter of a single pair.
4. Optionally, a polynomial. A projective map describes a shift, a rotation, a scale, a shear and a tilt of the field, but not the curved distortion a lens can add towards the edges. With transformation set to polynomial, a third-order polynomial is fitted on top of the projective result, the pairs are matched again through it and it is fitted again. It is refused – the projective map is kept, and the reason given – when there are too few pairs or they cover too little of the field, because outside its pairs a polynomial is not to be trusted.
5. Saving. With save transformation, the map, the two channels' rectangles on the chip and what it was measured from are written to a _2ct.h5 file, which the two-colour fit's transformation reads.
Which table. The localizations, whatever the layer shows: the pairs are one molecule seen in both channels of the same frame, and the selection is the layer's bounds applied to each localization. With several files selected, a pair is of one frame of one file (their frame numbers are moved apart, frames_apart), so bead files recorded at several positions pool into one registration.
The channels are not measured. A two-channel fit records the two rectangles it cut the chip into, and their flips (metadata["channels"]); those are used. A table without them has the arrangement cut from the frame: layout and main channel on microscope are read from the entry of the microscope the table records (metadata["camera"]["microscope"]) – the side each arm lands on, which arm the optics mirror, which is the main one, and a split position if the entry gives one (resolve_arrangement) – and the frame is cut there, or in its middle. Without an entry that says, the run stops and asks for the layout. Which channel a localization is in is always the fit's, camera_channel; a table without it is refused. Until 2026-11 the table was a fit of the whole chip, the layout was voted for and the seam between the halves measured from the pairs; on a wide, low camera ROI the vote chose the wrong axis, and a seam measured from the pairs could not be placed under a mirror.
The vote. The second channel's positions are first put through the layout's nominal map (
ChannelLayout.nominal_map): from the chip into its own rectangle's pixels, flipped back along its mirror, and onto the main channel's rectangle – where a molecule's second image would be for a perfect splitter. For each frame, every pair with
in the main channel and
in the second gives the vector
. Two localizations of one channel are never a candidate pair. Frames are taken in order until 4 000 000 vectors have been collected. The vectors are binned into a histogram
with bins of vote bin (2 px), and scored with a difference of Gaussians
being vote smoothing (4 px), so that the sharp peak of the pairs stays and everything broad subtracts away. The contrast is the peak of
over the standard deviation of
, and the peak is refined to below a bin by the centroid of the counts around it. The first map is
followed by that shift. A mirrored arm needs nothing of its own here: the flip is in
.
Pairing. Two localizations of one frame, one of each channel, are partners when each is the other's nearest neighbour and they are within the tolerance, after the second channel has been mapped onto the main one – so the tolerance is a distance in the reference channel in every round. At most pairs used in the fit (20 000) pairs, drawn at random, go into a fit.
The projective map. With a position in the second channel and
in the main channel,
eight free coefficients, since the nine are fixed only up to a common factor. The linear solution for a set of pairs is the normalised direct linear transform: both point sets are centred and scaled to a root-mean-square distance of from their centre first, which keeps the solve well conditioned (Hartley 1997).
The robust fit, in each round:
The outlier threshold and the dx/dy limit widen with the round's tolerance, to at least a half and a quarter of it: 10 and 5 pixels in the first round, the set values in a tight second round.
Weights. If the table has a localization precision (also called the CRLB) – xy_err_nm, converted with the pixel size it records – a pair's weight is the inverse variance of its separation,
normalised to a mean of one. A dim channel usually brings many poorly localized partners; unweighted, they would outnumber the good ones. RANSAC itself is unweighted: a precise outlier is still an outlier.
The second round's tolerance. With adapt_fine_tolerance on, the second round is widened to 3 times the 98th percentile of how far the first fit misses its own accepted pairs, up to the coarse tolerance. Where a projective map misfits a distorted field, it misfits most at the edges, and a fixed tight tolerance would lose exactly those pairs. If the first fit accepted less than 60% of its pairs, its misfit comes from chance partners rather than distortion, and the tolerance is left alone.
The polynomial. Third order: all 10 monomials with
in centred, scaled coordinates, for each of x and y – 20 coefficients. Order three, because radial distortion is cubic in the coordinates, and a quadratic cannot represent it at all. It needs at least 10 pairs per coefficient (200), and the pairs' convex hull must cover at least half of the reference channel's localizations' hull. It is a linear least-squares fit, reweighted 4 times by
against outliers, with
a quarter of the tolerance (at least 0.05 px); both directions are fitted, since a polynomial has no closed-form inverse.
The checks. Two warnings are raised on the final pairs: when the median misfit in the outer half of the paired region is more than twice that in the inner half (and above 0.1 px), which means the model does not describe the field; and when the kept pairs cover less than half of the reference channel, which means the map is an extrapolation over the rest.
| setting | default | what it does |
|---|---|---|
| channels – Where a split chip's two channels lie: the microscope's entry, or chosen by hand. | ||
layoutchannels.layout | the microscope's | How the chip is split: the microscope's entry, or chosen by hand with the main channel and the split. Leave it on microscope for a microscope in the database whose entry gives its arms' sides; choose it for any other. A wrong layout finds no clear peak, and the run says so. Choices: the microscope's; right-left; right-left mirrored; up-down; up-down mirrored |
main channelchannels.main_channel | the microscope's | The channel the other is registered onto: the microscope's (its transmitted arm), or either half, to swap them. The half the other is mapped onto. For two far-red dyes imaged ratiometrically it is the transmitted arm, the brighter one; the microscope's entry names it, and its choices say which half that is. Choose the other half to swap them, with the microscope's layout too. Choices: the microscope's; left; right; upper; lower |
split position (more)channels.split_position | auto | The first pixel of the second channel, on the chip, for a layout chosen by hand; empty: the middle of the frame. Read only for a table that does not record its channels: set it as the fit had it. A two-channel fit records its rectangles, and they win; so do the microscope's arms' regions, where its entry gives them and the layout is the microscope's. at least 1 px |
| registration – How a registration between two channels is measured: the vote, the pairing and the fit. | ||
transformationregistration.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. Stay with projective unless the residual grows towards the edges of the field (the warning, or the residual panel) and the pairs cover the whole chip. Choices: projective (8 coefficients); polynomial, order 3 (20) |
vote bin (more)registration.vote_bin_px | 2 px | The bin of the histogram of pair vectors the offset is voted in. at least 0.1 px |
vote smoothing (more)registration.vote_smooth_px | 4 px | The width of the difference-of-Gaussians filter the vote is scored with. at least 0.1 px |
coarse matchingregistration.coarse_tolerance_px | 20 px | First pass; must cover the rotation between the channels – 3 degrees over 512 px is 27 px. The first thing to raise if no pairs are found and the halves are strongly rotated. Wider costs more chance pairs, which the robust fit then has to reject. at least 0.1 px |
fine matchingregistration.fine_tolerance_px | 1 px | Second pass over clean matches only, which is where the accuracy comes from; 0 skips it. One pixel is roughly seven times the residual of a good registration. Much tighter strips the edges of the field; skipping the second round costs a factor of three to seven in accuracy. |
adapt fine matching (more)registration.adapt_fine_tolerance | on | Widen the fine matching to what the coarse fit misses its own pairs by, when those pairs are clean. See In detail. Off, the second round pairs at exactly fine matching. |
minimum pairs (more)registration.min_pairs | 20 | Fewer pairs than this and the registration refuses. at least 4 |
pairs used in the fit (more)registration.max_pairs | 20000 | At most this many pairs, drawn at random, go into each fit. Tens of thousands of pairs buy no more accuracy than a well-spread twenty thousand. at least 4 |
outlier threshold (more)registration.reprojection_threshold_px | 1 px | The robust (RANSAC) fit's inlier radius, at least; it widens with the matching tolerance. at least 0.01 px |
dx/dy limit (more)registration.transform_axis_limit_px | 0.5 px | The 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 |
save transformationsave | on | Write it to a file a two-colour fit can read. |
filepath | – | Auto: <name>_2ct.h5 beside the movie the table was fitted from (or the file it was read from). With no source recorded in the table, the automatic name is |
overwrite (more)overwrite | off | Replace a file that is already there. |

The plugin's residual and coverage panels for the simulated splitter: a round cloud about 0.15 px wide, and pairs over the whole of the upper half.
Based on SMAP's Process/Register/RegisterLocs2 (Ries 2020), whose sequence – a global alignment, then pairing and refitting at a shrinking tolerance – it keeps.
fitgeotrans by plain least squares. Here the fit is robust – RANSAC, a soft-L1 refinement and a dx/dy screen – and weighted by the localization precision.lwm, pwl) transformations. Here: projective, or a third-order polynomial that is refused when the pairs do not support it.