Skip to content

Commit

Permalink
COMP: Remove inclusion of .hxx files as headers
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
hjmjohnson committed Dec 18, 2021
1 parent e6935aa commit 817e97c
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 18 deletions.
9 changes: 4 additions & 5 deletions include/itkDescoteauxEigenToMeasureImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef itkDescoteauxEigenToMeasureImageFilter_hxx
#define itkDescoteauxEigenToMeasureImageFilter_hxx

#include "itkDescoteauxEigenToMeasureImageFilter.h"
#include "itkImageRegionConstIteratorWithIndex.h"
#include "itkImageRegionIterator.h"

Expand Down Expand Up @@ -56,9 +55,9 @@ DescoteauxEigenToMeasureImageFilter<TInputImage, TOutputImage>::ProcessPixel(con
auto a1 = static_cast<double>(pixel[0]);
auto a2 = static_cast<double>(pixel[1]);
auto a3 = static_cast<double>(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)
Expand All @@ -74,7 +73,7 @@ DescoteauxEigenToMeasureImageFilter<TInputImage, TOutputImage>::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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef itkDescoteauxEigenToMeasureParameterEstimationFilter_hxx
#define itkDescoteauxEigenToMeasureParameterEstimationFilter_hxx

#include "itkDescoteauxEigenToMeasureParameterEstimationFilter.h"

namespace itk
{
Expand Down
1 change: 0 additions & 1 deletion include/itkEigenToMeasureImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef itkEigenToMeasureImageFilter_hxx
#define itkEigenToMeasureImageFilter_hxx

#include "itkEigenToMeasureImageFilter.h"
#include "itkImageRegionConstIteratorWithIndex.h"
#include "itkImageRegionIterator.h"

Expand Down
1 change: 0 additions & 1 deletion include/itkEigenToMeasureParameterEstimationFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef itkEigenToMeasureParameterEstimationFilter_hxx
#define itkEigenToMeasureParameterEstimationFilter_hxx

#include "itkEigenToMeasureParameterEstimationFilter.h"
#include "itkCommand.h"
#include "itkImageAlgorithm.h"
#include "itkImageRegionSplitterSlowDimension.h"
Expand Down
1 change: 0 additions & 1 deletion include/itkHessianGaussianImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef itkHessianGaussianImageFilter_hxx
#define itkHessianGaussianImageFilter_hxx

#include "itkHessianGaussianImageFilter.h"
#include "itkImageRegionIteratorWithIndex.h"
#include "itkProgressAccumulator.h"
#include "itkGaussianDerivativeOperator.h"
Expand Down
7 changes: 3 additions & 4 deletions include/itkKrcahEigenToMeasureImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef itkKrcahEigenToMeasureImageFilter_hxx
#define itkKrcahEigenToMeasureImageFilter_hxx

#include "itkKrcahEigenToMeasureImageFilter.h"
#include "itkImageRegionConstIteratorWithIndex.h"
#include "itkImageRegionIterator.h"

Expand Down Expand Up @@ -57,9 +56,9 @@ KrcahEigenToMeasureImageFilter<TInputImage, TOutputImage>::ProcessPixel(const In
auto a1 = static_cast<double>(pixel[0]);
auto a2 = static_cast<double>(pixel[1]);
auto a3 = static_cast<double>(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<double>(l3) < Math::eps || static_cast<double>(l2) < Math::eps)
Expand Down
3 changes: 1 addition & 2 deletions include/itkKrcahEigenToMeasureParameterEstimationFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef itkKrcahEigenToMeasureParameterEstimationFilter_hxx
#define itkKrcahEigenToMeasureParameterEstimationFilter_hxx

#include "itkKrcahEigenToMeasureParameterEstimationFilter.h"

namespace itk
{
Expand Down Expand Up @@ -182,7 +181,7 @@ KrcahEigenToMeasureParameterEstimationFilter<TInputImage, TOutputImage>::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;
}
Expand Down
1 change: 0 additions & 1 deletion include/itkKrcahPreprocessingImageToImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef itkKrcahPreprocessingImageToImageFilter_hxx
#define itkKrcahPreprocessingImageToImageFilter_hxx

#include "itkKrcahPreprocessingImageToImageFilter.h"
#include "itkGaussianOperator.h"
#include "itkMath.h"

Expand Down
2 changes: 1 addition & 1 deletion include/itkMaximumAbsoluteValueImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MaximumAbsoluteValue
inline TOutputPixel
operator()(const TInputPixel1 A, const TInputPixel2 B)
{
return static_cast<TOutputPixel>(Math::abs(A) > Math::abs(B) ? A : B);
return static_cast<TOutputPixel>(itk::Math::abs(A) > itk::Math::abs(B) ? A : B);
}
}; // end of class
} // namespace Functor
Expand Down
1 change: 0 additions & 1 deletion include/itkMultiScaleHessianEnhancementImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#ifndef itkMultiScaleHessianEnhancementImageFilter_hxx
#define itkMultiScaleHessianEnhancementImageFilter_hxx

#include "itkMultiScaleHessianEnhancementImageFilter.h"
#include "itkMath.h"
#include "itkProgressAccumulator.h"

Expand Down

0 comments on commit 817e97c

Please sign in to comment.