Skip to content

SPIRiT consistency operator and split-slice GRAPPA kernels - #177

Open
mcencini wants to merge 4 commits into
mainfrom
claude/project-thread-72h2ls
Open

mcencini wants to merge 4 commits into
mainfrom
claude/project-thread-72h2ls

Conversation

@mcencini

@mcencini mcencini commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Matteo · project thread

What changed

  • tools.spirit_kernel(calibration, size, lambda_): SPIRiT kernel by ridge regression on every whole block of the calibration region (Lustig & Pauly, MRM 2010).
  • tools.spirit_weights(kernel, grid): the kernel's image-domain coil mixing per voxel.
  • linop.spirit_consistency(kernel, grid): G - I on centred, unitary (coils, *grid) k-space as one LinearOperator, built from bartorch's FFT, Matrix and Reshape. It is a quadratic penalty that plugs into optim.CG as a Tikhonov term, into the ADMM data-consistency subproblem of PICS, or into plug-and-play data consistency.
  • apps.nlinv_maps(..., sobolev=...): optional Sobolev weight of the sensitivities on the fitting grid; the pulserver EPI recon lowers it for slab calibrations.
  • tools.slice_grappa_kernel(bands, encoding, size, lambda_) and tools.slice_grappa(collapsed, kernels, size): split-slice GRAPPA with the leak block (Cauley et al., MRM 2014) for blipped-CAIPI multiband k-space, with the per-line CAIPI weight of each band.

Why

The pulserver EPI recon separates multiband groups before in-plane CG-SENSE with whole-volume nlinv maps. In the pulserver virtual-scanner simulation (32-channel head model, MB2×Ry2), split-slice GRAPPA followed by CG-SENSE takes the end-to-end error from 0.31 to 0.073 (with pypulseqpp#239's CAIPI phase fix). For 3D EPI, slab maps at Sobolev weight 1 instead of the scaled default bring Ry2/Rz2 from 0.24 to about 0.05 with the true-map encoding unchanged.

Validation

Run against the installed library with these modules overlaid (the native build was not rebuilt here):

pytest -q tests/test_grappa.py tests/test_docs.py tests/test_namespace.py tests/test_docstrings.py tests/test_linop.py tests/test_linop_signal.py
175 passed, 4 skipped
ruff check src/bartorch tests/test_grappa.py   All checks passed!

New tests:

  • consistency of smooth-coil k-space with its centre's kernel (< 5 %, CPU and CUDA);
  • adjoint inner-product identity;
  • equality with direct cyclic convolution in k-space;
  • separation of two calibrated CAIPI bands (< 10 %).

No CUDA device was available, so the CUDA legs skipped.

Documentation impact

New rows in docs/api/linop.md and docs/api/tools.md.

https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB


Generated by Claude Code

spirit_kernel and spirit_weights calibrate a SPIRiT kernel and give its
image-domain coil mixing; linop.spirit_consistency is G - I on centred,
unitary multichannel k-space, a quadratic penalty for CG, ADMM or
plug-and-play data consistency. slice_grappa_kernel and slice_grappa
separate blipped-CAIPI multiband k-space with leak-block kernels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MFB6QKTJCRjBZwuMZZnaBB
@mcencini mcencini self-assigned this Nov 21, 2026
@codecov

codecov Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants