Skip to content

Add radial high-pass emphasis distortion for k-space sharpening#37

Merged
MatthiasLen merged 3 commits into
copilot/add-sharpening-distortionfrom
copilot/add-high-frequency-boost-distortion
May 6, 2026
Merged

Add radial high-pass emphasis distortion for k-space sharpening#37
MatthiasLen merged 3 commits into
copilot/add-sharpening-distortionfrom
copilot/add-high-frequency-boost-distortion

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 30, 2026

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

    • Added RadialHighPassEmphasisDistortion in mri_recon.distortions.resolution
    • Implemented the mask as 1 + alpha * r**exponent, where r is the normalized radial frequency
    • Validated parameters to reject negative alpha and non-positive exponent
  • Package surface

    • Exported the new distortion from mri_recon.distortions
    • Added it to the example distortion selector for quick use in inference plotting
  • Coverage and docs

    • Added focused tests for:
      • inheritance from SelfAdjointMultiplicativeMaskDistortion
      • center vs edge mask values
      • identity behavior when alpha=0
    • Documented the new distortion in the README distortions table

Copilot AI and others added 2 commits April 30, 2026 14:57
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>
@MatthiasLen MatthiasLen self-requested a review April 30, 2026 15:09
@MatthiasLen MatthiasLen changed the base branch from copilot/add-sharpening-distortion to main April 30, 2026 15:14
@MatthiasLen MatthiasLen changed the base branch from main to copilot/add-sharpening-distortion April 30, 2026 15:15
@MatthiasLen MatthiasLen added enhancement New feature or request distortions Related to implementation of distortion. labels May 5, 2026
@MatthiasLen MatthiasLen requested a review from Copilot May 6, 2026 12:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RadialHighPassEmphasisDistortion implementing a radial gain mask 1 + alpha * r**exponent with parameter validation.
  • Exported the new distortion from mri_recon.distortions and 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 all SelfAdjointMultiplicativeMaskDistortion subclasses 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 MatthiasLen marked this pull request as ready for review May 6, 2026 13:12
@MatthiasLen MatthiasLen merged commit b0e1249 into copilot/add-sharpening-distortion May 6, 2026
2 checks passed
@MatthiasLen MatthiasLen deleted the copilot/add-high-frequency-boost-distortion branch May 6, 2026 13:15
@MatthiasLen MatthiasLen linked an issue May 6, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distortions Related to implementation of distortion. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Distortion amplifying high frequencies

3 participants