Repository navigation
EPI recon: delay-aware ramp regrid, one coil-map volume, CG-SENSE, one distortion field per stack - #385
EPI recon: delay-aware ramp regrid, one coil-map volume, CG-SENSE, one distortion field per stack#385mcencini wants to merge 18 commits into
Conversation
…one stack distortion field - A navigator space without geometry of its own is on the grid of the readouts it navigates, so it carries their half-voxel phase and measures the odd/even phase the train carries. - Whether a Cartesian readout is ramp sampled is decided from its k-space trajectory, not from trapezoid rise and flat times. - EpiPhaseCorrection fits the read-gradient delay to the first reference train or navigator (secant on the linear term) and RampSampling resamples every readout along the trajectory delayed by it. - EpiRecon estimates the coil sensitivities of the whole stack once, as one volume (volume_coil_maps), combines fully sampled units by least-squares SENSE, solves undersampled ones by CG-SENSE, completes partial Fourier by POCS, and corrects every image by one displacement field estimated from the stack's first volume and its reversed reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
…lumes The zoo EPI evaluations count the calibration every scan opens with. A multiband group's bands are the partitions of one volume, whose maps are the stored slices' maps at the band positions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
CI is red on 4 The cause is a version mismatch. CI installs the released pypulseqpp (0.0.69), whose The fix is to release pypulseqpp with #239 and raise the Generated by Claude Code |
…onov weight on CG-SENSE Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
…sets Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
…n object filling the field of view at R=3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
…on maps A multiband unit whose bands each lie on a calibrated slice has its bands separated by split-slice GRAPPA (bartorch.tools.slice_grappa_kernel / slice_grappa), trained on those slices' calibration k-space, and each band is solved as its own slice; joint CG-SENSE remains for units without that calibration. Each calibration slice is fitted its own nlinv maps: a slice stack with gaps is not a contiguous volume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
nlinv_estimate takes the Sobolev weight of the maps; the EPI recon fits its calibration at EPI_SOBOLEV, so the maps follow the sensitivity where SENSE unfolds in-plane, multiband and partition aliases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
|
CI on 76fe254 has one new failure besides the epi3d evaluation tests (those need the pypulseqpp release with #239). Generated by Claude Code |
A slice's maps keep BART's weight: split-slice GRAPPA and SENSE of a multiband slice group unfold best with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
A slab at EPI_WAVELET_SLAB, a slice at EPI_WAVELET_SLICE; wavelet=0 keeps the conjugate-gradient SENSE solve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
At PyHySCO's own weight, a slab whose blip-up and blip-down images differ only by T2* blur gets a field that steps by over half a voxel between lines, and its Jacobian darkens a line of the corrected image. A weight of 3000 removes the step; a 5 Hz/cm linear field is still corrected as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
At 7T the off-resonance phase near the sinuses wraps within a few voxels by a BOLD echo time, and a wavelet prior on that complex image rings at each wrap. The maps of the wavelet solve carry the low-passed phase of the conjugate-gradient SENSE image, so the prior acts on a near-real image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
…ities The calibration's forward and reversed shots share the imaging's echo spacing, and so its distortion, at the calibration's short echo time. At 7T the imaging volume and its reversed reference at a BOLD echo time lose signal near the sinuses, and a field fitted to them corrects less than none. The reversed reference volume remains the reference of a scan without a FLEET calibration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
…ibration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
At a 128 matrix and threefold in-plane undersampling, FISTA from zero is far from converged after the iterations a slice is given, while the conjugate-gradient SENSE image the phase is taken from already is. pics_image takes an optional starting image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
A station's signal weights and transforms grow with its samples; a 3D slab with a susceptibility field asked for 18 GB in one batch. The samples are now taken in batches that fit _BUDGET. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
A batch of samples that all lie on a 3D grid's kz = 0 plane is transformed as the 2D transform of the image summed along z, which is what bartorch's 2D transform of such a trajectory expects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
… engine The temporal basis is chosen over the atoms' signals both alone and weighted by the magnetization each carries, so a class holding most of the image keeps its terms when thousands of small classes share another signal. Truncation energies accumulate in double precision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
Requested by Matteo · project thread
What changed
Proxy (
proxy/_enrich.py)[DEFINITIONS].EPI recon (
recon/handlers/epi.py)bartorch.tools.epi_ramp_operator) delays the trajectory by that amount before resampling.EPI_SOBOLEV, throughnlinv_maps(sobolev=...), bartorch#177) so they follow the sensitivity across its wrapping end partitions; a slice keeps BART's weight.bartorch.tools.slice_grappa_kernel/slice_grappa, bartorch#177) separates the bands, trained on those slices' calibration k-space, and each band is solved as its own slice. Joint CG-SENSE over the partition volume remains for groups without that calibration. No background masking.EPI_WAVELET_SLAB(0.1) for a slab andEPI_WAVELET_SLICE(0.03) for a slice;wavelet=0gives CG-SENSE (bartorch.optim.CG).Virtual scanner (
virtual/_fourier.py)Zoo: the EPI 2D and 3D evaluations count the calibration that every scan now opens with (pypulseqpp#239).
Why
Measured in the physics simulation (blochsim EPG plus NUFFT virtual scanner):
Recon takes about 4 s for 36 slice-frames on CPU.
Validation
Of those 9 failures:
pytest tests/test_zoo_evaluation.py -k "flip_angle_scales or epi"gives 98 passed.*_import_no_torchtests. They fail in this container becausepython -Scannot see the editable pypulseqpp's compiled extension.The 2 errors are the
test_proxyDICOM-receiver tests, which needpynetdicom, a package not installed here. Both the 5 failures and the 2 errors also occur on main in this environment.New tests:
tests/recon/test_epi_solve.pytests/recon/test_epi.pytests/test_enrich.pytest_a_scan_acquired_in_batches_under_a_small_budget_reads_what_it_reads_wholetest_a_3d_image_sampled_only_on_its_kz_zero_plane_transforms_as_in_3dMultiband and 3D, end to end through this recon (7T sim, 32-ch head coil, noise-free, NRMSE vs a single-band / fully sampled reference with the same TE):
With noise (0.2% of the k-space peak), 8-partition slab:
On a 16-partition slab, CAIPI 2×2 CG is 0.114 noise-free at 30 iterations. Coil compression to 6 virtual coils was checked and is not limiting: 16 and 32 coils give the same.
The 2D figures need pypulseqpp#239's CAIPI receiver phase. CI needs releases of bartorch (#177) and pypulseqpp (#239), and the floors bumped. Per Matteo, releases wait until the EPI work is complete.
Documentation impact
docs/api/recon.mdgainsvolume_coil_maps.epirow indocs/user-guide/reconstruction-plugins.mddescribes the new behaviour.🤖 Generated with Claude Code
https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB