Skip to content

Add SymmetrizedGradientOp and TGV image reconstruction demonstration#904

Open
trung-vt wants to merge 2 commits intoPTB-MR:mainfrom
trung-vt:tgv
Open

Add SymmetrizedGradientOp and TGV image reconstruction demonstration#904
trung-vt wants to merge 2 commits intoPTB-MR:mainfrom
trung-vt:tgv

Conversation

@trung-vt
Copy link
Copy Markdown

(This PR is a fix for the previous PR #894 and a direct continuation from #903.)

Summary

  • Add SymmetrizedGradientOp as a linear operator in mrpro.operators. Supports $k$-dimensional spatial dimensions for arbitrary number of dimensions $k$. Add unit tests tests/operators/test_symmetrized_gradient_op.py for correctness and adjointness.
  • Add example notebook demonstrating Total Generalized Variation image reconstruction for radial undersampled MRI reconstruction using SymmetrizedGradientOp.

Motivation

The symmetrized gradient is required for total generalised variation (TGV) type regularisation, in particular for
second-order TGV as in Bredies (2014). Having a dedicated operator in mrpro makes it easier to implement TGV-based
reconstruction methods in a consistent way with the rest of the library,
as demonstrated in the example notebook.

Notes

No breaking changes expected; existing APIs remain unchanged.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 20, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/mrpro
   _version.py6267%7–8
src/mrpro/algorithms/csm
   inati.py25196%43
src/mrpro/algorithms/dcf
   dcf_voronoi.py55493%15, 55–56, 89
src/mrpro/algorithms/optimizers
   adam.py30680%108, 125–129
   cg.py52198%139
   pdhg.py81396%180–181, 187
   pgd.py53492%107, 152–155
src/mrpro/algorithms/reconstruction
   DirectReconstruction.py28679%62, 65, 70, 77–79
   IterativeSENSEReconstruction.py13192%79
   Reconstruction.py501374%54–56, 80–87, 109, 112
   RegularizedIterativeSENSEReconstruction.py512649%104–108, 122–161
src/mrpro/data
   AcqInfo.py165796%49, 56, 134–135, 137, 243, 367
   CsmData.py43295%233–235
   Dataclass.py3122692%59, 320, 336, 402, 460–462, 475, 570, 590–591, 593, 608–609, 611, 658–659, 664–665, 852–853, 878, 885, 890–891, 893
   DcfData.py33197%62
   EncodingLimits.py97397%37, 127, 130
   IData.py138696%125, 185, 231, 244, 249, 293
   IHeader.py130795%69–72, 255, 259, 263, 267
   KData.py2282489%122–123, 138, 145, 156–167, 178, 186, 197, 236, 258–260, 304–305, 377, 543, 545, 617
   KHeader.py1761393%115–121, 148, 196, 203–204, 231–238
   KNoise.py22195%44
   KTrajectory.py95397%163, 165, 185
   QData.py32197%43
   Rotation.py7354294%104, 202, 339, 437, 481, 499, 586, 588, 597, 631, 633, 696, 773, 778, 781, 796, 813, 818, 894, 1082, 1087, 1090, 1114, 1118, 1142, 1262, 1264, 1272–1273, 1337, 1419, 1623, 1630–1632, 1691, 1787, 1939, 1974, 1978, 2154, 2175
   SpatialDimension.py1501987%34, 103, 146, 158, 278–280, 293–295, 329, 347, 360, 373, 386, 399, 408–409, 437
src/mrpro/data/traj_calculators
   KTrajectoryCalculator.py26292%84, 95
   KTrajectoryCartesian.py31487%129–132, 136
   KTrajectoryIsmrmrd.py19195%57
   KTrajectorySpiral2D.py571377%63–66, 69, 71, 73, 75, 77, 105, 107, 134–136
src/mrpro/operators
   AveragingOp.py36294%72, 113
   CartesianSamplingOp.py112496%152, 191, 266, 387
   ConjugateGradientOp.py89792%62, 64, 100, 106, 228, 230, 233
   ConstraintsOp.py85495%78, 80, 250, 255
   EndomorphOperator.py28293%71, 77
   FiniteDifferenceOp.py29293%40, 126
   FourierOp.py101694%186–187, 206, 251, 315, 320
   Functional.py70297%116, 118
   GridSamplingOp.py1651591%72–73, 82–83, 90–91, 94, 96, 98, 282, 290–291, 303, 309–310
   LinearOperator.py202697%217, 255, 296, 305, 313, 330
   LinearOperatorMatrix.py1741989%98, 135, 168, 177, 182, 191–194, 207–210, 218–219, 224–225, 237, 346, 376, 403
   MultiIdentityOp.py16288%58, 63
   NonUniformFastFourierOp.py1951095%68, 95, 217, 219, 257, 259, 336, 393, 467, 472
   Operator.py88397%82, 115, 125
   PatchOp.py49394%93, 129, 144
   ProximableFunctionalSeparableSum.py44393%117, 208, 219
   SliceProjectionOp.py1781094%45, 62, 64, 70, 154, 180, 216, 253, 290, 330
   WaveletOp.py121596%168, 186, 230, 235, 258
   ZeroPadOp.py18194%30
src/mrpro/operators/functionals
   SSIM.py73790%60–80, 82, 86, 114, 147
src/mrpro/operators/models
   EPG.py2124479%31–32, 105–120, 168–172, 192–195, 216–221, 284, 289, 305–307, 327–328, 333, 357, 362, 387, 392, 508, 609, 636
src/mrpro/phantoms
   EllipsePhantom.py43295%66, 131
   brainweb.py2974087%276, 290–294, 349–359, 398, 454–457, 479–480, 485–486, 488–489, 493, 501, 508–509, 550, 621, 624–625, 644, 653–656, 667, 669, 700–701, 715, 723
   fastmri.py1061091%50–51, 59, 65, 162, 169–171, 174–175, 189
   m4raw.py74495%58–59, 74, 76
   mdcnn.py71790%58, 62–63, 70, 82, 88, 135
src/mrpro/utils
   RandomGenerator.py1561590%23–24, 36, 38, 188, 212, 428, 446, 528, 799, 829–832, 895, 898
   filters.py62297%44, 49
   indexing.py177199%321
   pad_or_crop.py32681%27, 31, 62, 65, 68, 71
   reshape.py139994%112, 308, 420–422, 443, 445, 452, 467
   slice_profiles.py49688%21, 37, 119–122, 155
   split_idx.py10280%43, 47
   summarize.py57788%40–41, 70–73, 77, 81
   unit_conversion.py721579%34, 44, 51, 53, 62, 69, 71, 78, 80, 89, 100, 121, 123, 144, 146
TOTAL765552593% 

Tests Skipped Failures Errors Time
3057 0 💤 0 ❌ 0 🔥 2m 7s ⏱️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 20, 2025

📚 Documentation

📁 Download as zip
🔍 View online

@trung-vt trung-vt force-pushed the tgv branch 2 times, most recently from be91aed to 6ecb4ff Compare November 20, 2025 17:19
@schuenke schuenke requested a review from koflera November 24, 2025 16:39
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