Simple test for get_m() and scanner z_shift() - #1731
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull request overview
Adds a focused regression test to validate ProjDataInfo::get_m() consistency across multiple Scanner geometry implementations, helping ensure axial-midpoint (m) semantics remain aligned when using Cylindrical, BlocksOnCylindrical, and Generic detector-coordinate maps.
Changes:
- Extend
set_blocks_projdata_info()with an optionalbin_fractionparameter to create lower-resolution projdata info for the new test. - Add
run_get_m_test()totest_proj_data_info.cxxto compareget_m()against LOR axial midpoints and across scanner models. - Add a
frienddeclaration inScannerto allow the new test to callScanner::set_detector_map().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| src/test/test_proj_data_info.cxx | Adds get_m() cross-geometry test and updates projdata-info construction helper to support bin downsampling. |
| src/include/stir/Scanner.h | Grants the new test class access to Scanner::set_detector_map() (currently private). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@NikEfth could we get this across the line? We're piling up PRs :-) |
e0aa742 to
297baaa
Compare
|
Done :) |
|
I think this is done |
|
I am sorry for the typos and mistakes this afternoon. Now it should be fine. |
KrisThielemans
left a comment
There was a problem hiding this comment.
I guess we can merge once we rename get_det_pos_to_coord_type(). However, having a closer look at this, I think the difficulty really sits in Scanner. This has
STIR/src/include/stir/Scanner.h
Lines 631 to 633 in 45c403c
I think the cleanest way to resolve this is to add get_detector_coordinate_map() const and set_detector_coordinate_map() (where the current set_detector_map() would then call set_detector_coordinate_map()) to Scanner. I'd even deprecate the current Scanner::set_detector_map, as it uses some internal stuff.
If we do that, we wouldn't need the mod to DetectorCoordinateMap.
Up to you...
|
I was not 100% if the setters should be deep-copy of the DetectorCoordinateMap. But in the previous implementation a new object was created ... so I kept that. |
KrisThielemans
left a comment
There was a problem hiding this comment.
@NikEfth I've made some changes and a tiny clean-up (also of some unrelated things that I spotted).
|
segfault in CI for MacOS-conda-latest-compiler Second run crashed later in "asymmetric interpolation test for BlocksOnCylindrical scanner". This seems unrelated to this PR, but it didn't occur in other Actions. |
|
I'm running |
|
@NikEfth this is ready now as far as I'm concerned. I intend to squash most commits before merging (today). |
|
I've re-run CI 3 times now without any trouble. I therefore hope this was due to some temporary problems on the runner. I'll go ahead and merge. |
|
TBH, I think there is a race codition somewhere. I have seen similar crashes from time to time, especially in my mac. I don't think that it appears on this branch |
0adef6a to
9034a55
Compare
Simple quick test for get_m