Add radial high-pass emphasis distortion for k-space sharpening#37
Merged
MatthiasLen merged 3 commits intoMay 6, 2026
Conversation
Agent-Logs-Url: https://github.com/MatthiasLen/mri_recon/sessions/16cb75f8-1e13-4b7e-9e51-f0437a3cc5f3 Co-authored-by: MatthiasLen <46369191+MatthiasLen@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MatthiasLen/mri_recon/sessions/16cb75f8-1e13-4b7e-9e51-f0437a3cc5f3 Co-authored-by: MatthiasLen <46369191+MatthiasLen@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
MatthiasLen
April 30, 2026 15:07
View session
There was a problem hiding this comment.
Pull request overview
This PR introduces a new resolution-related k-space distortion that radially boosts high-frequency content (sharpening-style) via a self-adjoint multiplicative mask, and wires it into the public API, examples, tests, and README documentation.
Changes:
- Added
RadialHighPassEmphasisDistortionimplementing a radial gain mask1 + alpha * r**exponentwith parameter validation. - Exported the new distortion from
mri_recon.distortionsand added it to the example distortion selector for inference plotting. - Added unit tests covering mask behavior (center vs edge) and identity behavior at
alpha=0, plus README table entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
mri_recon/distortions/resolution.py |
Adds the new radial high-pass emphasis distortion implementation and validation. |
mri_recon/distortions/__init__.py |
Exposes the new distortion in the package surface exports. |
tests/test_distortions.py |
Adds selection support and focused tests for the new distortion and updates inheritance coverage list. |
examples/fastmri_inference_plot.py |
Adds the new distortion to the selectable options and factory. |
README.md |
Documents the new distortion in the distortions table. |
Comments suppressed due to low confidence (1)
tests/test_distortions.py:589
- The docstring says this test covers "resolution-reduction classes", but the parametrized list now includes
RadialHighPassEmphasisDistortion(a sharpening/gain mask, not a reduction). Please update the docstring (and possibly the test name) to reflect that it's validating allSelfAdjointMultiplicativeMaskDistortionsubclasses in the resolution module (or similar), so the test intent matches the covered classes.
def test_resolution_reduction_classes_inherit_from_self_adjoint_multiplicative_mask(
distortion_cls,
):
"""Verify that all resolution-reduction classes are subclasses of the shared super class."""
assert issubclass(distortion_cls, SelfAdjointMultiplicativeMaskDistortion)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MatthiasLen
approved these changes
May 6, 2026
b0e1249
into
copilot/add-sharpening-distortion
2 checks passed
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.
This adds a sharpening-style k-space distortion that boosts high frequencies radially. The new operator follows the existing self-adjoint multiplicative-mask distortion pattern and uses the shared normalized radial frequency utility.
What changed
RadialHighPassEmphasisDistortioninmri_recon.distortions.resolution1 + alpha * r**exponent, whereris the normalized radial frequencyalphaand non-positiveexponentPackage surface
mri_recon.distortionsCoverage and docs
SelfAdjointMultiplicativeMaskDistortionalpha=0