Skip to content

Commit

Permalink
STYLE: Prefer itk::Math::abs for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmjohnson committed Dec 17, 2021
1 parent 7ad5492 commit d595149
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/itkPhaseCorrelationOptimizer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ PhaseCorrelationOptimizer<TRealPixelType, VImageDimension>::ComputeOffset()
SizeValueType dist = 0;
for (unsigned d = 0; d < ImageDimension; d++)
{
SizeValueType d1 = std::abs(m_MaxIndices[i][d] - m_MaxIndices[k][d]);
SizeValueType d1 = itk::Math::abs(m_MaxIndices[i][d] - m_MaxIndices[k][d]);
if (d1 > size[d] / 2) // wrap around
{
d1 = size[d] - d1;
Expand Down Expand Up @@ -484,7 +484,7 @@ PhaseCorrelationOptimizer<TRealPixelType, VImageDimension>::ComputeOffset()
(movingOrigin[i] - fixedOrigin[i]) - 1 * spacing[i] * (maxIndex[i] - oIndex[i]);
const OffsetScalarType mirrorOffset =
(movingOrigin[i] - fixedOrigin[i]) - 1 * spacing[i] * (maxIndex[i] - adjustedSize[i]);
if (std::abs(directOffset) <= std::abs(mirrorOffset))
if (itk::Math::abs(directOffset) <= itk::Math::abs(mirrorOffset))
{
offset[i] = directOffset;
}
Expand Down Expand Up @@ -562,7 +562,7 @@ PhaseCorrelationOptimizer<TRealPixelType, VImageDimension>::ComputeOffset()
(movingOrigin[i] - fixedOrigin[i]) - 1 * spacing[i] * (maxIndex[i] - oIndex[i]);
const OffsetScalarType mirrorOffset =
(movingOrigin[i] - fixedOrigin[i]) - 1 * spacing[i] * (maxIndex[i] - adjustedSize[i]);
if (std::abs(directOffset) <= std::abs(mirrorOffset))
if (itk::Math::abs(directOffset) <= itk::Math::abs(mirrorOffset))
{
this->m_Offsets[offsetIndex][i] = directOffset;
}
Expand Down Expand Up @@ -625,7 +625,7 @@ PhaseCorrelationOptimizer<TRealPixelType, VImageDimension>::ComputeOffset()
(movingOrigin[i] - fixedOrigin[i]) - 1 * spacing[i] * (maxIndex[i] - oIndex[i]);
const OffsetScalarType mirrorOffset =
(movingOrigin[i] - fixedOrigin[i]) - 1 * spacing[i] * (maxIndex[i] - adjustedSize[i]);
if (std::abs(directOffset) <= std::abs(mirrorOffset))
if (itk::Math::abs(directOffset) <= itk::Math::abs(mirrorOffset))
{
this->m_Offsets[peak][i] = directOffset;
}
Expand Down

0 comments on commit d595149

Please sign in to comment.