From 817e97c9615cdba23e6814401ded90145c2f51a9 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Fri, 17 Dec 2021 09:25:57 -0600 Subject: [PATCH] COMP: Remove inclusion of .hxx files as headers The ability to include either .h or .hxx files as header files required recursively reading the .h files twice. The added complexity is unnecessary, costly, and can confuse static analysis tools that monitor header guardes (due to reaching the maximum depth of recursion limits for nested #ifdefs in checking). --- include/itkDescoteauxEigenToMeasureImageFilter.hxx | 9 ++++----- ...DescoteauxEigenToMeasureParameterEstimationFilter.hxx | 1 - include/itkEigenToMeasureImageFilter.hxx | 1 - include/itkEigenToMeasureParameterEstimationFilter.hxx | 1 - include/itkHessianGaussianImageFilter.hxx | 1 - include/itkKrcahEigenToMeasureImageFilter.hxx | 7 +++---- .../itkKrcahEigenToMeasureParameterEstimationFilter.hxx | 3 +-- include/itkKrcahPreprocessingImageToImageFilter.hxx | 1 - include/itkMaximumAbsoluteValueImageFilter.h | 2 +- include/itkMultiScaleHessianEnhancementImageFilter.hxx | 1 - 10 files changed, 9 insertions(+), 18 deletions(-) diff --git a/include/itkDescoteauxEigenToMeasureImageFilter.hxx b/include/itkDescoteauxEigenToMeasureImageFilter.hxx index 2d105b7..88c045f 100644 --- a/include/itkDescoteauxEigenToMeasureImageFilter.hxx +++ b/include/itkDescoteauxEigenToMeasureImageFilter.hxx @@ -19,7 +19,6 @@ #ifndef itkDescoteauxEigenToMeasureImageFilter_hxx #define itkDescoteauxEigenToMeasureImageFilter_hxx -#include "itkDescoteauxEigenToMeasureImageFilter.h" #include "itkImageRegionConstIteratorWithIndex.h" #include "itkImageRegionIterator.h" @@ -56,9 +55,9 @@ DescoteauxEigenToMeasureImageFilter::ProcessPixel(con auto a1 = static_cast(pixel[0]); auto a2 = static_cast(pixel[1]); auto a3 = static_cast(pixel[2]); - double l1 = Math::abs(a1); - double l2 = Math::abs(a2); - double l3 = Math::abs(a3); + double l1 = itk::Math::abs(a1); + double l2 = itk::Math::abs(a2); + double l3 = itk::Math::abs(a3); /* Deal with l3 > 0 */ if (m_EnhanceType * a3 < 0) @@ -74,7 +73,7 @@ DescoteauxEigenToMeasureImageFilter::ProcessPixel(con /* Compute measures */ const double Rsheet = l2 / l3; - const double Rblob = Math::abs(2 * l3 - l2 - l1) / l3; + const double Rblob = itk::Math::abs(2 * l3 - l2 - l1) / l3; const double Rnoise = sqrt(l1 * l1 + l2 * l2 + l3 * l3); /* Multiply together to get sheetness */ diff --git a/include/itkDescoteauxEigenToMeasureParameterEstimationFilter.hxx b/include/itkDescoteauxEigenToMeasureParameterEstimationFilter.hxx index 969bd32..435d344 100644 --- a/include/itkDescoteauxEigenToMeasureParameterEstimationFilter.hxx +++ b/include/itkDescoteauxEigenToMeasureParameterEstimationFilter.hxx @@ -19,7 +19,6 @@ #ifndef itkDescoteauxEigenToMeasureParameterEstimationFilter_hxx #define itkDescoteauxEigenToMeasureParameterEstimationFilter_hxx -#include "itkDescoteauxEigenToMeasureParameterEstimationFilter.h" namespace itk { diff --git a/include/itkEigenToMeasureImageFilter.hxx b/include/itkEigenToMeasureImageFilter.hxx index 5a424bf..353de5c 100644 --- a/include/itkEigenToMeasureImageFilter.hxx +++ b/include/itkEigenToMeasureImageFilter.hxx @@ -19,7 +19,6 @@ #ifndef itkEigenToMeasureImageFilter_hxx #define itkEigenToMeasureImageFilter_hxx -#include "itkEigenToMeasureImageFilter.h" #include "itkImageRegionConstIteratorWithIndex.h" #include "itkImageRegionIterator.h" diff --git a/include/itkEigenToMeasureParameterEstimationFilter.hxx b/include/itkEigenToMeasureParameterEstimationFilter.hxx index 9468e4b..59c9e0e 100644 --- a/include/itkEigenToMeasureParameterEstimationFilter.hxx +++ b/include/itkEigenToMeasureParameterEstimationFilter.hxx @@ -19,7 +19,6 @@ #ifndef itkEigenToMeasureParameterEstimationFilter_hxx #define itkEigenToMeasureParameterEstimationFilter_hxx -#include "itkEigenToMeasureParameterEstimationFilter.h" #include "itkCommand.h" #include "itkImageAlgorithm.h" #include "itkImageRegionSplitterSlowDimension.h" diff --git a/include/itkHessianGaussianImageFilter.hxx b/include/itkHessianGaussianImageFilter.hxx index 6655e09..27abde4 100644 --- a/include/itkHessianGaussianImageFilter.hxx +++ b/include/itkHessianGaussianImageFilter.hxx @@ -19,7 +19,6 @@ #ifndef itkHessianGaussianImageFilter_hxx #define itkHessianGaussianImageFilter_hxx -#include "itkHessianGaussianImageFilter.h" #include "itkImageRegionIteratorWithIndex.h" #include "itkProgressAccumulator.h" #include "itkGaussianDerivativeOperator.h" diff --git a/include/itkKrcahEigenToMeasureImageFilter.hxx b/include/itkKrcahEigenToMeasureImageFilter.hxx index fcad0a9..d756849 100644 --- a/include/itkKrcahEigenToMeasureImageFilter.hxx +++ b/include/itkKrcahEigenToMeasureImageFilter.hxx @@ -19,7 +19,6 @@ #ifndef itkKrcahEigenToMeasureImageFilter_hxx #define itkKrcahEigenToMeasureImageFilter_hxx -#include "itkKrcahEigenToMeasureImageFilter.h" #include "itkImageRegionConstIteratorWithIndex.h" #include "itkImageRegionIterator.h" @@ -57,9 +56,9 @@ KrcahEigenToMeasureImageFilter::ProcessPixel(const In auto a1 = static_cast(pixel[0]); auto a2 = static_cast(pixel[1]); auto a3 = static_cast(pixel[2]); - double l1 = Math::abs(a1); - double l2 = Math::abs(a2); - double l3 = Math::abs(a3); + double l1 = itk::Math::abs(a1); + double l2 = itk::Math::abs(a2); + double l3 = itk::Math::abs(a3); /* Avoid divisions by zero (or close to zero) */ if (static_cast(l3) < Math::eps || static_cast(l2) < Math::eps) diff --git a/include/itkKrcahEigenToMeasureParameterEstimationFilter.hxx b/include/itkKrcahEigenToMeasureParameterEstimationFilter.hxx index d288059..1188a90 100644 --- a/include/itkKrcahEigenToMeasureParameterEstimationFilter.hxx +++ b/include/itkKrcahEigenToMeasureParameterEstimationFilter.hxx @@ -19,7 +19,6 @@ #ifndef itkKrcahEigenToMeasureParameterEstimationFilter_hxx #define itkKrcahEigenToMeasureParameterEstimationFilter_hxx -#include "itkKrcahEigenToMeasureParameterEstimationFilter.h" namespace itk { @@ -182,7 +181,7 @@ KrcahEigenToMeasureParameterEstimationFilter::Calcula RealType trace = 0; for (unsigned int i = 0; i < pixel.Length; ++i) { - trace += Math::abs(pixel[i]); + trace += itk::Math::abs(pixel[i]); } return trace; } diff --git a/include/itkKrcahPreprocessingImageToImageFilter.hxx b/include/itkKrcahPreprocessingImageToImageFilter.hxx index 4de8d30..1478cc6 100644 --- a/include/itkKrcahPreprocessingImageToImageFilter.hxx +++ b/include/itkKrcahPreprocessingImageToImageFilter.hxx @@ -19,7 +19,6 @@ #ifndef itkKrcahPreprocessingImageToImageFilter_hxx #define itkKrcahPreprocessingImageToImageFilter_hxx -#include "itkKrcahPreprocessingImageToImageFilter.h" #include "itkGaussianOperator.h" #include "itkMath.h" diff --git a/include/itkMaximumAbsoluteValueImageFilter.h b/include/itkMaximumAbsoluteValueImageFilter.h index 464049d..f095b75 100644 --- a/include/itkMaximumAbsoluteValueImageFilter.h +++ b/include/itkMaximumAbsoluteValueImageFilter.h @@ -62,7 +62,7 @@ class MaximumAbsoluteValue inline TOutputPixel operator()(const TInputPixel1 A, const TInputPixel2 B) { - return static_cast(Math::abs(A) > Math::abs(B) ? A : B); + return static_cast(itk::Math::abs(A) > itk::Math::abs(B) ? A : B); } }; // end of class } // namespace Functor diff --git a/include/itkMultiScaleHessianEnhancementImageFilter.hxx b/include/itkMultiScaleHessianEnhancementImageFilter.hxx index fc43100..b084cd9 100644 --- a/include/itkMultiScaleHessianEnhancementImageFilter.hxx +++ b/include/itkMultiScaleHessianEnhancementImageFilter.hxx @@ -18,7 +18,6 @@ #ifndef itkMultiScaleHessianEnhancementImageFilter_hxx #define itkMultiScaleHessianEnhancementImageFilter_hxx -#include "itkMultiScaleHessianEnhancementImageFilter.h" #include "itkMath.h" #include "itkProgressAccumulator.h"