Conversation
… re-happening, and adjusted the tissue value tests such that the values are in line with the paper of BASHKATOV et al., 2011 Fixes #412
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a critical bug in the Rayleigh scattering equation (issue #412) where an exponent was incorrectly specified as 1e-4 instead of -4. The fix is accompanied by comprehensive test coverage and related improvements to device parameters, documentation, and code quality.
- Main fix: Corrected Rayleigh scattering exponent from
1e-4to-4inscattering_from_rayleigh_and_mie_theory - Added comprehensive test suite to prevent regression of the scattering equation bug
- Updated literature values and device parameters to match corrected scattering model
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
simpa/utils/libraries/spectrum_library.py |
Critical bug fix: Corrected Rayleigh scattering exponent from 1e-4 to -4 |
simpa_tests/automatic_tests/tissue_library/test_scattering_equation.py |
Added comprehensive test coverage for scattering equation to prevent regression |
simpa/utils/calculate.py |
Fixed rotation_matrix_between_vectors to properly handle parallel and anti-parallel vectors |
simpa/utils/libraries/literature_values.py |
Updated BMIE coefficients for epidermis and dermis to align with corrected scattering model |
simpa_tests/test_utils/tissue_composition_tests.py |
Adjusted reference scattering value and improved test infrastructure with matplotlib backend |
simpa/core/simulation_modules/optical_module/optical_adapter_base.py |
Enhanced laser pulse energy handling to support wavelength-dependent energy values |
simpa/core/simulation_modules/reconstruction_module/*.py |
Added indexing='ij' parameter to torch.meshgrid calls for PyTorch 2.0+ compatibility |
simpa/utils/settings.py |
Added get() method for dictionary-like default value handling |
simpa/utils/tags.py |
Clarified documentation for LASER_PULSE_ENERGY_IN_MILLIJOULE to indicate iterable support |
simpa/core/device_digital_twins/pa_devices/ithera_msot_acuity.py |
Updated bandwidth (55% → 153%) and corrected laser position calculation for device accuracy |
simpa/core/simulation_modules/acoustic_module/simulate_2D.m |
Fixed comment: "minimum CFL" → "maximum CFL" |
simpa/core/processing_components/monospectral/field_of_view_cropping.py |
Corrected docstring to accurately describe field of view cropping functionality |
simpa_tests/automatic_tests/tissue_library/test_tissue_library_against_literature_values.py |
Removed temporary workaround for Intel architectures |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
All literature values are quite hand-wavy within SIMPA to be fully honest. |
TomTomRixRix
left a comment
There was a problem hiding this comment.
Looks good to me. I'm not an expert on the tissue parameters, but the implementation makes sense.
| get_fully_deoxygenated_blood_reference_dictionary, \ | ||
| get_lymph_node_reference_dictionary | ||
|
|
||
| # FIXME temporary workaround for newest Intel architectures |
There was a problem hiding this comment.
Was the intel architectures issue solved or do we simply not care anymore?
Please check the following before creating the pull request (PR):
List any specific code review questions
List any special testing requirements
Additional context (e.g. papers, documentation, blog posts, ...)
Provide issue / feature request fixed by this PR
Fixes #412