Repository navigation
tools.igrog: non-Cartesian samples moved onto the grid by closed-form GRAPPA kernels (iGROG) - #170
Merged
Merged
Conversation
… GRAPPA kernels (iGROG) Wiener kernels from the calibration's coil cross-correlation, tabulated once and interpolated; one calibration per group of shots; kernels solved in batches on a given device. Its gridded samples feed CartesianSense(positions=). Ported from fast-encoding's PyTorch path (identical output), so mri2qmap needs no locally built library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFB6QLjhTxFMFDEzathbEm
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Matteo · project thread
What changed
New
bartorch.tools.igrog(kspace, traj, shape, calib, *, group=, sources=3, lam=1e-3, spacing=1.0, reach=4, upsample=8, batch=65536, device=None). It moves each non-Cartesian sample to its nearest grid point with a Wiener (closed-form) GRAPPA kernel oversourcesreadout samples and all coils. The kernel comes from the calibration's coil cross-correlation, which is tabulated once and interpolated. There can be one calibration per group of shots, and the kernels are solved in batches ondevice. It returns the gridded values, their flat grid index, source shot/sample, the noise gain, andweights(), which whiten the values. The output feedslinop.CartesianSense(positions=), which is already released.Why
mri2qmap-bartorch's default chain grids with iGROG. Until now that came from fast-encoding, which is unreleased and needs a locally built library. This PR ports fast-encoding's PyTorch path so the chain runs from wheels.
Validation
tests/test_igrog.py: on a 2-D smooth object with 6 coils, the gridded samples match the exact k-space at their grid points to 0.3 % relative error (asserted < 2 %). Leaving each sample where it is gives 21 %. A second test checks per-group calibrations and the scale invariance of the kernels.grid(..., backend="torch"): the index is identical, and the max values and noise differ by 0.0.ruff check/ruff format --check,tests/test_docs.pyandtests/test_docstrings.pypass against the 0.0.20 wheel with this module dropped in. These were CPU-only runs; there was no card in this container.Documentation impact
docs/api/tools.mdlistsigrogunder sampling.Generated by Claude Code