Skip to content

Nonuniform Filtering

Problem

A single FSC-derived low-pass cutoff filters the whole map at one resolution. The global FSC sums the cross-half correlation over the whole map, so at each shell it is carried by the regions that still hold signal there: the reported resolution reflects the best-ordered parts of the map, diluted somewhat by the rest. A cutoff at that resolution therefore leaves noise in flexible or poorly ordered regions, which are resolved much worse, while the best-ordered core may still be filtered slightly too hard. Nonuniform filtering estimates a spatially varying cutoff c(v) from the data themselves, so that each voxel is filtered at the resolution at which the two independent half maps still agree there.

The input is an unfiltered even/odd half pair on one grid. The output is a label field c(v) over a candidate bank of cutoffs, the filtered halves and merged map, and a local-resolution map.

Model

Let E and O be the raw halves and E_c, O_c their low-pass versions at candidate cutoff c from the static bank

20, 15, 12, 10, 8, 6, 5, 4 A,

keeping only the members coarser than the raw pair's FSC 0.143 resolution divided by 1.5, and never fewer than two. With ML regularization, the regularized half pair can join the bank as one more member; when it does and how it competes is described after the algorithm.

If the true local resolution at voxel v is c, then E_c(v) predicts O(v) up to noise, and vice versa; filtering finer than c lets through noise that the other half does not share, and filtering coarser loses signal that it does. The evidence for candidate c at v is therefore the cross-half prediction error

r1_c(v) = [E(v) - O_c(v)] / sigma_0,
r2_c(v) = [E_c(v) - O(v)] / sigma_0,
C_c(v)  = [r1_c(v)^2 + r2_c(v)^2] / 2,

the plain squared error: the cross-validated criterion of cryoSPARC's non-uniform refinement (Punjani, Zhang and Fleet, Nature Methods 2020). Reconstruction noise is a sum over very many Fourier coefficients and is Gaussian, so there are no heavy tails to guard against; the large residuals are real signal that a too-coarse candidate removed, and the squared error charges them in full. Isolated voxels are already limited by the smoothing of the costs (step 1 below).

Noise level. sigma_0 is one scalar per setup, the Gaussian-scaled MAD of the raw difference over the observed support (voxels where both halves are exactly zero are unobserved and left out):

sigma_0 = 1.4826 * median | (E-O) - median(E-O) |.

Because every candidate's cost is divided by the same level, the winner at a voxel does not depend on sigma_0 at all; the level only sets the balance between the costs and the Potts prior. No local noise estimate is needed for the competition, and none is made: a profile estimated from E - O would be inflated wherever the halves disagree over density, and a median over the whole support is not. Where the noise is higher, as toward the box edge under the gridding correction, the finer candidates are simply costlier, which is the right response for that map.

Support. All statistics are evaluated inside the sphere of diameter mskdiam. The sphere, rather than a density mask, is used because it keeps the candidate objective comparable everywhere and retains a solvent population that later serves as a noise reference.

Algorithm

  1. Candidate costs. For each c, compute C_c(v) on the support and smooth it with a mask-normalized tent kernel of radius min(1.5 c, 30 A). Smoothing at a scale proportional to c matches the spatial extent over which a cutoff of c is meaningful; voxels outside the support never influence in-support costs.
  2. Initial labels. c(v) = argmin_c C_c^smoothed(v).
  3. Ordered-label Potts smoothing. A Potts model is a Markov random field that adds a penalty for every pair of neighboring voxels with different labels; here the penalty grows with how far apart the two labels are. Minimize over the 26-neighbor lattice

text E(c) = sum_v C_{c(v)}(v) + sum_{v~w} phi( |rank(c(v)) - rank(c(w))| ) / deg(v),

where rank is the index in the retained bank and phi is zero for adjacent ranks and a linear-quadratic hinge for larger jumps. The prior is ordered: a 20-to-15 A boundary costs less than a 20-to-4 A jump. Degree normalization keeps the regularization strength uniform at the sphere boundary. Iterated conditional modes with eight-color sweeps (no two concurrently updated voxels are neighbors) and tie preservation. 4. Synthesis. At each voxel take E_{c(v)}(v) and O_{c(v)}(v); the merged map is their average; the local-resolution map stores c(v) in Angstrom inside the support and zero outside or beyond Nyquist.

The regularized member. With ML regularization, the regularized half pair (the closed-form voxelwise Wiener shrinkage of the raw pair) joins the bank once the raw pair's FSC 0.143 resolution is at or beyond the finest kept member; before that, the low-pass members compete alone. Because the cut keeps members up to 1.5 times finer than the FSC, this happens only once the FSC is finer than the finest member of the static bank (4 A). The regularized member takes the same rank as the finest kept member in the ordered prior of step 3, so the prior treats the two alike and only their costs decide between them. Its cost is the cross-half prediction error of the regularized halves, and its label resolution is the raw pair's FSC 0.143. Where it wins, the map keeps the estimator's own high-resolution content; where a low-pass member wins, the estimator over-reached there.

High-resolution extension (retired 2026-09-16)

A sequential shell walk (nu_refine=yes) used to challenge the frontier of the finest populated label with the next unrepresented Fourier shell. Its acceptance criterion was equivalent to a local FSC above 0.5, conservative for the map and no better than the FSC=0.143 extent for the matching band, and it never let the regularized pair compete. A generated dense ladder replaced it for two days (2026-09-16 to 18) and regressed PfCRT; the static ladder with the regularized pair beside the finest retained rung is the one competition for every workflow.

Handoff to matching

The FSC and the NU filter answer different questions: the FSC reports one global resolution, carried by the best-ordered regions; the NU field reports, voxel by voxel, the resolution each region actually supports. The matching low-pass for the next iteration is the finest member of the bank: the finest kept low-pass member, or the regularized member once it has joined, bounded by any explicit lp and by lpstop. The same rule serves every workflow, and which labels won voxels decides the filter, never the band. In plain nonuniform mode the even and odd NU halves stay separate references; in nonuniform_lpset the merged NU map is used with a single band. No further low-pass is applied on top of an NU reference.

The band leads the FSC by 1.25-1.5x within the ladder, which is what carries a climb. With the band at the previous FSC=0.143 crossing the alignment never sees the shells beyond the crossing where the reference still holds signal; the crossing then moves at most about one shell per iteration and the orientation assignment crawls or freezes (PfCRT: 0/4 and 1/9 restarts converged, 2026-09-16/18). That is underfitting: the sigma2-weighted objective, the stochastic assignment and the evidence-limited NU reference guard against fitting noise, and the runs with a 1.5x lead (PfCRT 10/10, +0.47 A of FSC per stage-6 iteration against +0.19 A) show no sign of it. The uncapped July 2026 ladder led by about 2x and froze 2 of 10 restarts, so the lead is bounded by the cut.

The reproducibility envelope derived from the same candidate costs is a separate estimator: NU-evidence envelope masking.

Rationale

  • Cross-half prediction error is a direct, model-free test of local resolution: it needs no assumption about the signal, only that the two halves have independent noise.
  • Dividing every candidate's cost by one shared level keeps the minimum-cost label a property of the halves alone; comparing candidates each smoothed at its own scale would bias the boundary.
  • The ordered Potts prior encodes that resolution varies continuously in space, which is what distinguishes local resolution from voxelwise noise.

Implementation

  • Bank, costs, labels: src/main/nu_filt/simple_nu_filter*.f90; the per-state driver: src/main/volume/simple_nu_state_filter.f90.
  • Noise level and squared-error objective (nu_objective_noise_scale, nu_objective): src/main/image/simple_image_calc.f90.
  • Unit tests, including the two-resolution phantom and the neutral fixture: src/main/nu_filt/simple_nu_filter_tester.f90 (unit_reconstruction).
  • Integration into volume assembly: src/main/commanders/simple/simple_commanders_rec_distr.f90.
  • Matching bandwidth handoff: src/main/strategies/search/simple_matcher_refvol_utils.f90.
  • Policy: doc/policies/NU/nonuniform_filtering_policy.md.