UCL/STIR

Other places that use `abs` as opposed to `std::abs` for floats/doubles that could be affected:

KrisThielemans opened this issue · 1 comments

Following from #1409, we need to check other places that use abs for floats/doubles that could be affected. Simplest is to just replace them with std::abs, but it'd be good to know if there was a problem or not. I guess easiest might be to put an error abs(1.5)-1>.2 while checking.

Copying from #1409 (comment)_

Library: (worrying!)

Utilities:

Relatively harmless as error checking:

Test code:

Commented out code, hence harmless (but confusing):

The inverse_SSRB tests still pass even if the expressions passed into abs() are cast to integers before. I think it would require some quite elaborate design of the scanner rings and downsampling to find a case where the logic would be vulnerable to the int conversion. Nonetheless, it would definitely be saver to switch to std::abs.