`test_proj_data_info` fails on master
I guess something must be a little different on my system, as I can see that Travis is passing..
~/src/STIR/build]$ ./src/test/test_proj_data_info
-------- Testing ProjData Geometry --------
-------- Testing DOI for blocks --------
-- CPU Time 2.31
-------- Testing coordinates --------
-- CPU Time 0.75
-- CPU Time 3.41
-------- Testing ProjDataInfoCylindricalArcCorr --------
INFO: Detected view-mashing factor 2 from the number of views (96) and the number of detectors per ring (384).
Adjusting the azimuthal angle offset accordingly (an extra offset of 0.46875 degrees)
Tests with proj_data_info without mashing and axial compression
Testing consistency between different implementations of geometric info
Test ring pair to segment,ax_pos (span 1)
Test ring pair to segment,ax_pos and vice versa (for any axial compression)
Tests on get_LOR/get_bin
Max Deviation: segment = 0, axial pos 0, view = 0, tangential_pos_num = 0
Tests with proj_data_info with mashing and axial compression (span 5)
INFO: Detected view-mashing factor 8 from the number of views (24) and the number of detectors per ring (384).
Adjusting the azimuthal angle offset accordingly (an extra offset of 3.28125 degrees)
Testing consistency between different implementations of geometric info
Test ring pair to segment,ax_pos and vice versa (for any axial compression)
Tests on get_LOR/get_bin
Max Deviation: segment = 0, axial pos 0, view = 0, tangential_pos_num = 0
Tests with proj_data_info with mashing and axial compression (span 4)
INFO: Detected view-mashing factor 8 from the number of views (24) and the number of detectors per ring (384).
Adjusting the azimuthal angle offset accordingly (an extra offset of 3.28125 degrees)
Testing consistency between different implementations of geometric info
Test ring pair to segment,ax_pos and vice versa (for any axial compression)
Tests on get_LOR/get_bin
Max Deviation: segment = 0, axial pos 0, view = 0, tangential_pos_num = 0
All tests ok !
-------- Testing ProjDataInfoCylindricalNoArcCorr --------
Tests with proj_data_info without mashing and axial compression
Testing consistency between different implementations of geometric info
Error : unequal values are 6.75 and 6. test consistency get_sampling_in_m
Error : unequal values are 6.69369 and 6. test consistency get_sampling_in_t
Error : unequal values are 2.1 and 2. test consistency get_sampling_in_m
Error : unequal values are 2.09829 and 2. test consistency get_sampling_in_t
Test ring pair to segment,ax_pos (span 1)
Test ring pair to segment,ax_pos and vice versa (for any axial compression)
Tests on get_LOR/get_bin
Max Deviation: segment = 0, axial pos 0, view = 1, tangential_pos_num = 1
Test code for sinogram <-> detector conversions.
Test code for detector,ring -> bin and back conversions.
Test code for bin -> detector,ring and back conversions. (This might take a while...)
Test code for bins <-> detectors routines that work with any mashing and axial compression
Testing find scanner coordinates given cartesian and vice versa.
Tests with proj_data_info with mashing and axial compression (span 5)
INFO: Detected view-mashing factor 8 from the number of views (24) and the number of detectors per ring (384).
Adjusting the azimuthal angle offset accordingly (an extra offset of 3.28125 degrees)
Testing consistency between different implementations of geometric info
Error : unequal values are 3.375 and 3. test consistency get_sampling_in_m
Error : unequal values are 3.35044 and 3. test consistency get_sampling_in_t
Error : unequal values are 1.05 and 1. test consistency get_sampling_in_m
Error : unequal values are 1.04925 and 1. test consistency get_sampling_in_t
Test ring pair to segment,ax_pos and vice versa (for any axial compression)
Tests on get_LOR/get_bin
Max Deviation: segment = 0, axial pos 1, view = 0, tangential_pos_num = 1
Test code for bins <-> detectors routines that work with any mashing and axial compression
Testing find scanner coordinates given cartesian and vice versa.
Tests with proj_data_info with mashing and axial compression (span 2)
INFO: Detected view-mashing factor 8 from the number of views (24) and the number of detectors per ring (384).
Adjusting the azimuthal angle offset accordingly (an extra offset of 3.28125 degrees)
Testing consistency between different implementations of geometric info
Error : unequal values are 3.375 and 3. test consistency get_sampling_in_m
Error : unequal values are 3.36588 and 3. test consistency get_sampling_in_t
Error : unequal values are 1.05 and 1. test consistency get_sampling_in_m
Error : unequal values are 1.04972 and 1. test consistency get_sampling_in_t
Test ring pair to segment,ax_pos and vice versa (for any axial compression)
Tests on get_LOR/get_bin
Max Deviation: segment = 0, axial pos 1, view = 0, tangential_pos_num = 1
Test code for bins <-> detectors routines that work with any mashing and axial compression
Testing find scanner coordinates given cartesian and vice versa.
End of tests. Please correct errors !
I'm also failing on make BUILD_TESTS (probably unrelated) due to building /home/gil2a4/src/STIR/src/recon_test/test_blocks_on_cylindrical_projectors.cxx for multiple fails due to
/home/gil2a4/src/STIR/src/recon_test/test_blocks_on_cylindrical_projectors.cxx:161:115: error: no matching function for call to 'make_1d_array(float, double, double)'
161 | = make_array(make_1d_array(1.F, 0.F, 0.F), make_1d_array(0.F, cos(float(_PI) - phi1), sin(float(_PI) - phi1)),
Any thoughts?
Hi
not sure! What's your OS/compiler etc set-up?
Regarding the compilation error. The relevant line is here
https://github.com/UCL/STIR/blob/4142d5969e4320e32ed9dbe463b0fd50f36fb3f6/src/recon_test/test_blocks_on_cylindrical_projectors.cxx#L160-L162
It appears that on your system cos(float) returns a double. This is probably related to using old-style cos vs std::cos. I see we mess things up a bit
https://cplusplus.com/reference/cmath/sin/
https://github.com/UCL/STIR/blob/4142d5969e4320e32ed9dbe463b0fd50f36fb3f6/src/include/stir/common.h#L95
vs
https://github.com/UCL/STIR/blob/4142d5969e4320e32ed9dbe463b0fd50f36fb3f6/src/include/stir/ProjDataInfoBlocksOnCylindricalNoArcCorr.inl#L28
and really we should be using std::cos. That has never mattered until now, but maybe you using a more recent compiler or something?
Closing as no further feedback. feel free to re-open
Catching up on some Github notifications :) I think you forgot to close, I'll close now. Hope you're well!