NUFFT plans#

prepare_nufft uses twofold FFT oversampling with matched Kaiser–Bessel interpolation and spreading. cache_budget_bytes (128 MiB by default) bounds stencil caching. Larger trajectories retain compact positions and evaluate tabulated kernel weights per chunk.

Explicit adjoint derivative rules avoid storing expanded stencils during differentiation. Long single-precision adjoints use bounded partial sums, or CPU double-precision accumulation when JAX x64 is enabled. Outputs retain the plan’s single precision.

mrax.reco.prepare_nufft(spatial_shape, trajectory, *, eps=1e-06, chunk_size=None, batch_size=None, cache_budget_bytes=134217728)#

Prepare a portable 1D/2D/3D NUFFT with twofold grid oversampling.

eps in [1e-12, 1e-2] selects the Kaiser–Bessel width conservatively. Single precision has a coordinate/roundoff floor. Use float64 trajectories and JAX x64 for tighter accuracy. Preparation validates concrete coordinates once. Separable stencils exceeding cache_budget_bytes are evaluated per chunk from compact positions. Zero disables stencil caching.

class mrax.reco.NUFFTPlan(spatial_shape: tuple[int, ...], grid_shape: tuple[int, ...], sample_count: int, width: int, chunk_size: int, batch_size: int, indices: Array, weights: Array, deapodization: tuple[Array, ...], cached_stencil: bool, shape_parameter: float, prefer_wide_accumulation: bool)#

Reusable encoding for fixed coordinates in cycles/pixel, in axis order.

Prepare outside jit/grad. Transform calls support both and arbitrary leading batch axes. Gradients are defined for images and samples at a fixed trajectory. eps selects interpolation accuracy. Floating-point error also depends on dtype and accumulation. Sample chunks and batches bound temporary stencil and oversampled-grid memory.

forward(image)#

Return sum(x[n] exp(-2πi k·(n-floor(N/2)))) / sqrt(prod(N)).

adjoint(samples)#

Apply the unweighted conjugate transpose.