21.9 Port over pixel digital centroid correction for ITK from 20.20
Porting over pixel digital centroid correction for ITK from 20.20, and restructuring code for readability. A few observations/comments:
-
I find it odd that here I need to use row and column in the "wrong" order, but this seems necessary in order to keep the output consistent (both Run 2 and ITK unchanged with these changes). Presumably row and column are inverted later in the code?
-
In principle it would be good to separate out some of the common code in these two methods into dedicated functions (i.e. the initial "meanpos" calculation and the final "centroid" calculation) but these rely on previously calculated quantities, so I left these parts in both methods to avoid passing lots of things in the interface or having to cache them, which would not be very good for AthenaMT in future.
FYI @nreadiof @goblirsc @lmijovic @tstreble @ncalace @npetters @asalzbur