Skip to content

Conversation

@m-wisell
Copy link

@m-wisell m-wisell commented Nov 20, 2025

Summary

This PR adds medical image denoising using anisotropic diffusion.

Addresses: Issue #3973

Implementation

Mathematical Model:
Perona-Malik anisotropic diffusion for edge-preserving denoising

Numerical Methods:

  • P1 Lagrange finite elements for spatial discretization
  • Backward Euler time-stepping
  • Conjugate Gradient solver with Jacobi preconditioner

Features:

  • Image I/O with automatic normalization
  • Image-to-mesh and mesh-to-image conversion
  • Quality metrics: PSNR, SSIM, Edge Preservation Index
  • Auto-generated synthetic test images (no dataset download required)

What Changed (Latest Update)

  • Fixed CI failures: removed deprecated basix.ufl imports
  • Consolidated to single standalone demo file
  • Added test suite (all passing)
  • Simplified dependencies and improved documentation

Quality Metrics (Real Mammogram 512x512)

  • PSNR: 35.52 dB
  • SSIM: 0.8739
  • Edge Preservation: 0.8042

Usage

python demo/demo_anisotropic_diffusion_medical.py
python demo/demo_anisotropic_diffusion_medical.py --image path/to/image.jpg
python demo/demo_anisotropic_diffusion_medical.py --kappa 25 --iterations 40

Ready for review. CI check should now pass.

@m-wisell m-wisell changed the title [WIP]: Add medical image denoising demo for anisotropic diffusion Add medical image denoising demo for anisotropic diffusion Dec 11, 2025
@m-wisell
Copy link
Author

Updated to fix CI failures. All tests now passing locally. Ready for review.

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.

1 participant