Repository navigation
Dual energy plugin (Python): tigre.plugins.dual_energy - #991
Merged
Merged
Conversation
…keVMproj) Same functions and options as MATLAB/Plugins/DualEnergy, with the same angle matching (wrapped angles, tolerance in radians) and the same errors. Projections are (angle, v, u). The calibration and NIST tables stay in Common/data (one copy); setup.py copies them into the package, and the sdist includes them. Falls back to Common/data in an unbuilt checkout. Also: demo d23_DualEnergy.py, one CPU test with the same numbers as the MATLAB test, user-guide page, API reference, plugins table, changelog, and the TIGRE-DE entry in the Python TIGRE.bib (closing brace and year added to the MATLAB one). Closes #522 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6n1VHyq4uNorM3CAiBUPo
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.
Part 2 of 2 for #522, stacked on #990 (MATLAB move and fixes). Closes #522.
What changes
tigre.plugins.dual_energy:DeDecomposeandMakeVMproj, the same functions, options, defaults, warnings and errors as MATLAB after Dual energy plugin (MATLAB): move to Plugins/DualEnergy and fix bugs #990. Projections are(angle, v, u). Angle matching is the fixed one (wrapped angles,tolerancein radians, default half the low-kV step). Spline:scipy.interpolate.CubicSpline(not-a-knot, as MATLABspline). Pure Python: always installed, nothing to build.Common/data(MATLAB reads it there).setup.pycopies the two JSON files intotigre/plugins/dual_energy/data/(git-ignored, inpackage-data), andMANIFEST.inputsCommon/data/*.jsonin the sdist. In an unbuilt checkout the code falls back toCommon/data.Python/demos/d23_DualEnergy.py(mirrors the MATLAB one; needs your own Varian scans, so it is inNOT_RUNfor the website).dual-energy.md(method, Python/MATLAB example, angle matching, calibration and how to add one), row in the plugins table, both API reference pages, demos catalogue.TIGRE-DEentry added to the PythonTIGRE.bib; the MATLAB entry was missing itsyearand closing brace.Testing
Python/tests/test_dual_energy_plugin.py, CPU-only, same numbers astest_DualEnergy_plugin.m: passes in the sandbox against the source tree. This PR's CI (tests.yml) installs TIGRE and runs it against the installed package, which also checks the JSON files are packaged.MakeVMprojat 60 keV = 0.075t1 + 0.0228*t2.Written by an AI agent (Claude), reviewed by Ander.
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6n1VHyq4uNorM3CAiBUPo