Reconstruction#
Use reconstruct_acquisition or ReconstructionPipeline to reconstruct imported
raw data with Cartesian FFT, non-Cartesian gridding or NUFFT adjoint, variational or model-based
methods. The imported acquisition supplies the sampling and geometry settings.
from mrax.reco import ReconstructionPipeline
plan = ReconstructionPipeline.from_acquisition(acquisition)
preview = plan.run(acquisition, device="cpu")
tv_plan = plan.replace_stage("fft", replacement="variational",
regularizer="tv", regularizer_weight=0.001, num_steps=100)
result = tv_plan.run(acquisition, device="cpu")
See Acquisitions and reconstruction plans for editable plans,
normalization conventions, partial Fourier, readout correction, gridding and
frequency products. All numerical entry points default to CPU and accept an
explicit device. mrax.get_available_devices() lists available devices.
Encoding and optimization#
Variational reconstruction minimizes
A encodes measured support, receiver sensitivities and Fourier coordinates.
W holds statistical weights. Density weights initialize reconstruction.
Completed samples serve initialization. L1/TV penalties and their
proximal weights use the same mean-over-image normalization.
Model-based reconstruction applies this encoding to a signal model. Supply
experiment, model and compatible receiver sensitivities. Regularizer axes
and masks follow parameter fields. FISTA/split Bregman use proximal TV. Explicit
Adam uses smoothed TV with a warning. See Fitting controls for fitting controls.
Model-based fitting uses RMS-normalized mean squared error, with the same
prefactor as image fitting. reference_image multiplies a relative signal
model by a fixed spatial reference. roi_mask controls regularizers and output.
Fourier encoding retains the full signal, including exterior contributions. object_support_mask instead
declares physical object support. Comparisons require matching likelihoods,
support, references and regularizer weights.
Model-based encoding uses batches of up to 32 frames with rematerialized
gradients, retaining the complete time model and temporal regularizers.
encoding_batch_size changes this bound. None uses a single batch.
Paired-echo frequency maps are ambiguous by integer multiples of 1 / delta_TE
Hz, with delta_TE in seconds. An absolute frequency reference requires
additional calibration. Reliability masks can also differ between reconstruction methods.
solve_variational and solve_model_based expose low-level solvers.
build_operator exposes forward/adjoint encoding. Non-Cartesian encoding uses
the built-in JAX NUFFT on the selected CPU or GPU.
Its fixed trajectory uses cycles per pixel in spatial-axis order. Reusable
prepare_nufft(shape, trajectory) plans support batches, JIT and image/model
gradients. Trajectory gradients are unsupported. Prepare plans outside JIT.
nufft_eps (default 1e-6, range 1e-12 to 1e-2)
selects kernel width. Floating-point roundoff can exceed this interpolation target.
Tighter precision requires JAX x64 and float64 trajectories and images. Sample
and batch chunks bound intermediate memory, but large 3D FFT grids still require
substantial memory. Windows GPU execution requires a JAX-supported environment
such as WSL 2. Native Windows uses CPU.
For NUFFT caching, batching and numerical implementation details, see NUFFT plans.
Sensitivity encoding follows [Pruessmann1999]. Nonuniform Fourier encoding uses the interpolation framework in [Fessler2003] and Kaiser–Bessel gridding in [Beatty2005]. Partial-Fourier phase projection and homodyne follow [Haacke1991] and [Noll1991]. Proximal solvers follow split Bregman [Goldstein2009] and FISTA [BeckTeboulle2009]. Phase integration and weighted least-squares unwrapping follow [Itoh1982] and [GhigliaRomero1994].
Image products and processing#
Results retain complex coil images and combined products. Coil combination,
permutations, flips and cropping are configurable. Frequency maps retain signed Hz.
unwrap_phase_image supports 2D, stacks and volumes with magnitude-weighted
least squares. Quantitative two-echo products also offer quality-guided or
weighted Laplacian unwrapping. Low-signal and disconnected regions can be ambiguous.
mrax.reco.processing provides gradients, calibration, sample corrections,
readout shifts, density estimation and centered Fourier padding.
pad_centered_kspace preserves DC across odd/even sizes and supports scaling
that preserves mean image intensity.
Check geometry and absolute scaling before comparing methods. For different correction or regularization choices, also compare resolution, contrast, noise, phase and artifacts.
The browser’s Reconstruct editor exposes the same stages and ships editable
.mflow presets. For sampled acquisitions, method="nufft" applies the NUFFT
adjoint with optional density compensation. method="variational" solves the
measured-sample objective using the NUFFT encoding operator. An adjoint is not an
iterative inverse. See Reusable workflows for saving and sharing stage plans.