Skip to content

Iterative 3D Refinement

Problem

Given particle images and one or more starting volumes, estimate for each particle a projection direction, an in-plane rotation, a shift, and (for several volumes) a state label, and estimate the volumes that best explain the images under those poses. As in 2D this is solved by alternation: reproject the current volumes and assign poses, then reconstruct new volumes from the assigned poses. This chapter is one round of that alternation. Coarse-to-fine schedules that wrap it are in solve3D and heterogeneity analysis; the continuous refinement of stored poses without a projection grid is local 3D refinement.

Model

By the projection-slice theorem, the 2D Fourier transform of a projection of volume x at rotation R is the central section of the 3D transform of x perpendicular to the viewing axis. A reference for direction R is therefore obtained by gathering the 3D Fourier transform on the polar grid of that plane with a Kaiser-Bessel kernel; no real-space projection is ever formed. The observation model and objectives are then exactly those of Refine2D, with the reference index running over nspace directions per state instead of K classes:

X_i = CTF_i S_s R_theta P(R_j) x_state + n_i,
L_i(j, state, theta, s) = sum_k (k/sigma2_i(k)) |X_i - CTF_i [S R P x]|^2 / sum_k (k/sigma2_i(k)) |X_i|^2.

Projection directions are placed quasi-uniformly on the sphere by the spiral construction

h_k = -1 + 2(k-1)/(n-1),   theta_k = acos(h_k),
psi_k = psi_{k-1} + 3.6 / sqrt(n (1 - h_k^2))   (mod 2 pi),

restricted to the asymmetric unit of the point group. The angular spacing is roughly sqrt(4 pi / n); nspace = 2500 gives about 4 degrees, 20000 about 1.4 degrees.

The neighborhood modes also use a coarse spiral of nspace_sub directions (default 500). Every fine direction is assigned to its nearest coarse direction, with distances measured under the point-group symmetry, which splits the fine grid into one cell per coarse direction. Each coarse direction is represented in the search by its nearest fine direction. The cells, not an angular radius, define the neighborhoods, so their size follows the ratio nspace / nspace_sub and needs no threshold.

Algorithm

One iteration:

  1. Reference preparation. Read the current even and odd volumes, center them (single state, C-symmetric groups only), soft-mask at the mask radius, filter, and gather polar central sections for every direction. The filter is the FSC-derived Wiener filter 2 FSC/(1+FSC) unless ML regularization or nonuniform filtering has already produced a regularized map, in which case no further filter is applied. At low resolution, out to 20 A but no further than the shell where the FSC drops below 0.95, the two halves are replaced by their average for matching purposes only. This keeps the even and odd volumes in register: aligned against a shared low-resolution reference, the two halves cannot drift apart in position or orientation, so the FSC between them remains a meaningful comparison. An envelope mask is never multiplied into the matching reference: removing density that is present in the images destroys pose discrimination under the Euclidean objective.
  2. Candidate preparation (probabilistic modes). Inside the search's batch loop, fill each particle's probability-table row and draw its pose from that row, as described in sampling.
  3. Search and commit. For each active particle choose one direction, in-plane rotation, shift, and state:
  4. shc: visit references in random order with the previous one last, take the best in-plane rotation for each, and stop at the first reference that beats the previous score (first-improvement hill climbing). A particle that has never been searched, and one in ten of the others, gets an exhaustive search instead.
  5. neigh: score the coarse representatives exhaustively, keep the best npeaks, and search every fine direction in their cells, and in the cell of the previous direction, exhaustively.
  6. prob: the table covers every direction of every state, and each particle commits one draw from the tempered posterior over its row (within the state of its closest reference; prob_beta tempers the draw, the run's annealing knob).
  7. prob_neigh: the table is restricted, per particle, to a neighborhood, and the particle draws from the posterior over the candidates it scored. In state mode (the default) the coarse representatives are scored and the best npeaks cells, pooled across states, form the neighborhood; in geom mode it is every direction within athres_cont (default 10 degrees, the bound of cont) of the previous one, the same for every state; the cells only prefilter that cone. The shc and snhc modes use no cells: they score a stochastic subset of the fine directions with the first-improvement rule of shc (unbounded for shc, annealed for snhc) after a floor of five candidates, the current pose scored into the set so that the draw is an acceptance step and not a forced move.
  8. cont: no grid and no candidates. Each stored pose is refined continuously by a bounded Levenberg-Marquardt fit of its five parameters (local 3D refinement). There is no state-only mode: a consensus refinement becomes a multi-state one through refine3D_states, whose flex PCA initializer assigns the first states at fixed poses. In the discrete modes, shifts are then refined by L-BFGS-B within trs, and optionally the committed (sx, sy, theta) is refined jointly with continuous angle (continuous in-plane refinement). Multi-state search never reuses a shift seed from one state to rank another.
  9. Noise update. Accumulate per-shell residual power at the committed poses and reduce it per group for the next iteration.
  10. Partial reconstruction. Re-read the updated particles and insert their Fourier planes into per-state, per-half accumulators under the committed poses (reconstruction).
  11. Volume assembly. Reduce the partial accumulators, blend with the trailing chain if fractional updates are on, restore even and odd maps, compute the FSC, regularize, and produce the filtered and masked references for the next iteration.
  12. Bandwidth update. Set the next iteration's low-pass limit from the FSC of the best-resolved state at the criterion lplim_crit (default 0.143), never finer than lpstop or the cropped Nyquist.

Shared-memory and distributed execution differ only in where the partial sums are reduced; the sequence above is the same.

Resolution estimate

The FSC between the even and odd maps is corrected for the mask by phase randomization: the unmasked FSC gives the first shell below 0.8, both halves are phase-randomized beyond it, and for shells two beyond that onset the reported curve is

FSC = (FSC_masked - FSC_randomized) / (1 - FSC_randomized),

clamped to [0, 1]. This removes the correlation that the mask itself induces between the halves. Resolution is quoted at FSC 0.143 and 0.5. A directional diagnostic, the conical FSC area ratio (cFAR), computes the FSC inside 256 cones of half-angle 20 degrees and reports the ratio of the smallest to the largest shell-weighted area under the curve: 1 is isotropic, values toward 0 indicate preferred orientation.

ML regularization

With ml_reg=yes (Euclidean objective only), the restored half map is the MAP estimate under a Gaussian signal prior whose per-shell power tau2 is inferred from the FSC:

SSNR(k) = FSC(k) / (1 - FSC(k)),      sigma2(k) = 1 / mean_shell(D),
tau2(k) = SSNR(k) sigma2(k),
x_hat(q) = B(q) / [ D(q) + 1/(tau tau2(k)) ],

where B and D are the noise-weighted numerator and CTF-squared density of reconstruction, and tau (default 1) is a fudge factor. Shells below index 6 are not regularized; the FSC is floored at 0.001, so a shell of zero or negative FSC is shrunk a thousandfold, and an unsampled shell (no density, so no sigma2) gets a ridge of a thousand times its own density, the same shrinkage whatever the scale of D (wiener_ridge). The scale matters: with the Euclidean weights D runs to 1e7 and beyond, and until 2026-10-25 a floor on tau2 against an absolute 1e-10 with the ridge then capped at 1e3 left every zero-FSC shell of such a reconstruction unregularized (PfCRT's final map carried 6.7 times more power beyond the FSC=0.143 cutoff than in its 10 A to cutoff band). Because 1/tau2 grows as the FSC falls, the estimator shrinks poorly determined high-frequency coefficients toward zero in proportion to their expected signal, which is the same operation as the Wiener filter but applied before the density division rather than after, where it also regularizes the division itself.

Automasking and nonuniform filtering

Late in a refinement, the reference volume for iteration n may be multiplied by an envelope computed at iteration n-1, either a density automask (low-pass at amsklp, Otsu threshold, largest connected component, one-voxel dilation, 6-voxel cosine edge) or the NU-evidence envelope (NU-evidence envelope masking), and its bandwidth may be made spatially varying (nonuniform filtering). These operate on the reference only; the reconstructed halves and the FSC inputs are unchanged.

Convergence

Per particle the search records mi_proj (1 if the direction moved less than 2 degrees), the visited fraction frac, and the running mean angular change. A single-state run has converged when the average mi_proj exceeds 0.99 and the visited fraction exceeds 99 percent. Multi-state runs use the joint state-and-direction overlap (0.96): the mean mi_proj * mi_state over current observations in each state. A populated state without observations holds the exit; empty states are ignored. The probabilistic modes (prob, prob_neigh) use overlap 0.99 (0.95 in an eligible intermediate solve3D stage from stage 3), at any visited fraction, since a neighbourhood search visits few references. The hill-climbing neighbourhood modes of solve3D's first two stages never end on overlap. Without an annealing tail, overlap ends the stage; with prob_beta_end, eligible overlap or a resolution stall starts the tail. Overlap and stalls respect minits; the budget fallback still starts the tail in time to finish. During its five iterations the draws ramp geometrically from prob_beta to prob_beta_end, then the run ends. The resolution exit and iteration budget also apply. Shift search is switched on once the visited fraction exceeds 75 percent, with trs = clamp(0.07 msk, 5, 6) pixels. A combine_eo=yes run ends with one full-update iteration at a tighter band with the halves merged.

Rationale

  • Working entirely in Fourier space makes reprojection a gather and reconstruction a scatter with the same kernel, so the two halves of the alternation are adjoint operations on the same representation.
  • First-improvement stochastic search with a random visiting order is cheap and explores; exhaustive neighborhood search late is accurate. The probabilistic mode combines both by decoupling scoring from assignment.
  • The FSC drives everything downstream (filter, prior, bandwidth), so it is computed on masked, phase-randomization-corrected halves that were reconstructed independently, and never from references that have been blended for matching.

Implementation

  • Commander: src/main/commanders/simple/simple_commanders_refine3D.f90.
  • Iteration strategy: src/main/strategies/parallelization/simple_refine3D_strategy.f90.
  • Reference preparation: src/main/strategies/search/simple_matcher_refvol_utils.f90; polar gather in src/main/image/simple_projector_pft_batch.f90.
  • Search strategies: src/main/strategies/search/simple_strategy3D_*.f90.
  • Volume assembly, FSC, regularization: src/main/commanders/simple/simple_commanders_rec_distr.f90, src/main/volume/simple_halfmap_diagnostics.f90, src/utils/filter/simple_fsc.f90.
  • Convergence: src/main/simple_convergence.f90.
  • Policy: doc/policies/3D/refine3D_policy.md.