From 7b99c207a222fec33bf4aceaf47a949c0f341afb Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Fri, 30 Aug 2024 12:18:45 +0200 Subject: [PATCH] COMP: Add missing semicolons to ITK macro calls Aims to resolve issue https://github.com/SuperElastix/elastix/issues/1224 "Missing semicolons causing compile issues with some compilers". ITK has become stricter with respect to those semicolons from ITK pull request https://github.com/InsightSoftwareConsortium/ITK/pull/4706 commit https://github.com/InsightSoftwareConsortium/ITK/commit/55e23393e1d2c2e71d919d33459201fcee364655 "ENH: Default to allow ITK_MACROEND_NOOP_STATEMENT", Hans Johnson, June 4, 2024. Co-authored-by: Wildcarde --- .../itkGenericConjugateGradientOptimizer.h | 20 +++++++++---------- .../elxAdvancedAffineTransform.hxx | 2 +- .../elxAffineDTITransform.hxx | 2 +- .../elxAffineLogStackTransform.hxx | 2 +- .../elxBSplineStackTransform.hxx | 2 +- .../elxEulerStackTransform.hxx | 2 +- .../EulerTransform/elxEulerTransform.hxx | 2 +- .../elxSimilarityTransform.hxx | 2 +- Core/Main/elxParameterObject.cxx | 2 +- Core/Main/itkTransformixFilter.hxx | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Components/Optimizers/ConjugateGradient/itkGenericConjugateGradientOptimizer.h b/Components/Optimizers/ConjugateGradient/itkGenericConjugateGradientOptimizer.h index 3146b50ed..f1aa6978a 100644 --- a/Components/Optimizers/ConjugateGradient/itkGenericConjugateGradientOptimizer.h +++ b/Components/Optimizers/ConjugateGradient/itkGenericConjugateGradientOptimizer.h @@ -111,16 +111,16 @@ class GenericConjugateGradientOptimizer : public ScaledSingleValuedNonLinearOpti * GradientMagnitudeTolerance * \max(1, \|CurrentPosition\| ) \f$ */ itkGetConstMacro(GradientMagnitudeTolerance, double); - itkSetMacro(GradientMagnitudeTolerance, double) - - /** Setting: a stopping criterion, the value tolerance. By default 1e-5. - * - * The optimizer stops when - * \f[ 2.0 * | f_k - f_{k-1} | \le - * ValueTolerance * ( |f_k| + |f_{k-1}| + 1e-20 ) \f] - * is satisfied MaxNrOfItWithoutImprovement times in a row. - */ - itkGetConstMacro(ValueTolerance, double); + itkSetMacro(GradientMagnitudeTolerance, double); + + /** Setting: a stopping criterion, the value tolerance. By default 1e-5. + * + * The optimizer stops when + * \f[ 2.0 * | f_k - f_{k-1} | \le + * ValueTolerance * ( |f_k| + |f_{k-1}| + 1e-20 ) \f] + * is satisfied MaxNrOfItWithoutImprovement times in a row. + */ + itkGetConstMacro(ValueTolerance, double); itkSetMacro(ValueTolerance, double); /** Setting: the maximum number of iterations in a row that diff --git a/Components/Transforms/AdvancedAffineTransform/elxAdvancedAffineTransform.hxx b/Components/Transforms/AdvancedAffineTransform/elxAdvancedAffineTransform.hxx index fe655e4e0..ea7b1491a 100644 --- a/Components/Transforms/AdvancedAffineTransform/elxAdvancedAffineTransform.hxx +++ b/Components/Transforms/AdvancedAffineTransform/elxAdvancedAffineTransform.hxx @@ -107,7 +107,7 @@ AdvancedAffineTransformElastix::ReadFromFile() if (itkFixedParameterValues == nullptr) { log::error("ERROR: No center of rotation is specified in the transform parameter file"); - itkExceptionMacro("Transform parameter file is corrupt.") + itkExceptionMacro("Transform parameter file is corrupt."); } } diff --git a/Components/Transforms/AffineDTITransform/elxAffineDTITransform.hxx b/Components/Transforms/AffineDTITransform/elxAffineDTITransform.hxx index 53d35752c..50955f777 100644 --- a/Components/Transforms/AffineDTITransform/elxAffineDTITransform.hxx +++ b/Components/Transforms/AffineDTITransform/elxAffineDTITransform.hxx @@ -78,7 +78,7 @@ AffineDTITransformElastix::ReadFromFile() if (!pointRead) { log::error("ERROR: No center of rotation is specified in the transform parameter file"); - itkExceptionMacro("Transform parameter file is corrupt.") + itkExceptionMacro("Transform parameter file is corrupt."); } /** Set the center in this Transform. */ diff --git a/Components/Transforms/AffineLogStackTransform/elxAffineLogStackTransform.hxx b/Components/Transforms/AffineLogStackTransform/elxAffineLogStackTransform.hxx index 16a7ac594..2fd7957b7 100644 --- a/Components/Transforms/AffineLogStackTransform/elxAffineLogStackTransform.hxx +++ b/Components/Transforms/AffineLogStackTransform/elxAffineLogStackTransform.hxx @@ -119,7 +119,7 @@ AffineLogStackTransform::ReadFromFile() if (!pointRead) { log::error("ERROR: No center of rotation is specified in the transform parameter file"); - itkExceptionMacro("Transform parameter file is corrupt.") + itkExceptionMacro("Transform parameter file is corrupt."); } this->InitializeAffineLogTransform(); diff --git a/Components/Transforms/BSplineStackTransform/elxBSplineStackTransform.hxx b/Components/Transforms/BSplineStackTransform/elxBSplineStackTransform.hxx index 35df168fe..ef0d21620 100644 --- a/Components/Transforms/BSplineStackTransform/elxBSplineStackTransform.hxx +++ b/Components/Transforms/BSplineStackTransform/elxBSplineStackTransform.hxx @@ -494,7 +494,7 @@ BSplineStackTransform::ReadFromFile() { itkExceptionMacro("NumberOfSubTransforms, StackOrigin, StackSpacing, GridSize, GridIndex, GridSpacing and " "GridOrigin is required by " - << this->GetNameOfClass() << ".") + << this->GetNameOfClass() << "."); } /** Set it all. */ diff --git a/Components/Transforms/EulerStackTransform/elxEulerStackTransform.hxx b/Components/Transforms/EulerStackTransform/elxEulerStackTransform.hxx index 2fb37bb5d..0601c44fb 100644 --- a/Components/Transforms/EulerStackTransform/elxEulerStackTransform.hxx +++ b/Components/Transforms/EulerStackTransform/elxEulerStackTransform.hxx @@ -117,7 +117,7 @@ EulerStackTransform::ReadFromFile() if (!pointRead && !indexRead) { log::error("ERROR: No center of rotation is specified in the transform parameter file"); - itkExceptionMacro("Transform parameter file is corrupt.") + itkExceptionMacro("Transform parameter file is corrupt."); } this->InitializeEulerTransform(); diff --git a/Components/Transforms/EulerTransform/elxEulerTransform.hxx b/Components/Transforms/EulerTransform/elxEulerTransform.hxx index 211f21554..6b416355e 100644 --- a/Components/Transforms/EulerTransform/elxEulerTransform.hxx +++ b/Components/Transforms/EulerTransform/elxEulerTransform.hxx @@ -77,7 +77,7 @@ EulerTransformElastix::ReadFromFile() if (!pointRead) { log::error("ERROR: No center of rotation is specified in the transform parameter file"); - itkExceptionMacro("Transform parameter file is corrupt.") + itkExceptionMacro("Transform parameter file is corrupt."); } /** Set the center in this Transform. */ diff --git a/Components/Transforms/SimilarityTransform/elxSimilarityTransform.hxx b/Components/Transforms/SimilarityTransform/elxSimilarityTransform.hxx index dcb0c675a..a1b413c1d 100644 --- a/Components/Transforms/SimilarityTransform/elxSimilarityTransform.hxx +++ b/Components/Transforms/SimilarityTransform/elxSimilarityTransform.hxx @@ -86,7 +86,7 @@ SimilarityTransformElastix::ReadFromFile() if (!pointRead && !indexRead) { log::error("ERROR: No center of rotation is specified in the transform parameter file."); - itkExceptionMacro("Transform parameter file is corrupt.") + itkExceptionMacro("Transform parameter file is corrupt."); } /** Set the center in this Transform. */ diff --git a/Core/Main/elxParameterObject.cxx b/Core/Main/elxParameterObject.cxx index 4b35a792a..1587d840d 100644 --- a/Core/Main/elxParameterObject.cxx +++ b/Core/Main/elxParameterObject.cxx @@ -229,7 +229,7 @@ ParameterObject::ReadParameterFiles(const ParameterFileNameVectorType & paramete { if (!itksys::SystemTools::FileExists(parameterFileName)) { - itkExceptionMacro("Parameter file \"" << parameterFileName << "\" does not exist.") + itkExceptionMacro("Parameter file \"" << parameterFileName << "\" does not exist."); } this->AddParameterFile(parameterFileName); diff --git a/Core/Main/itkTransformixFilter.hxx b/Core/Main/itkTransformixFilter.hxx index b7417928e..23bfa2a9a 100644 --- a/Core/Main/itkTransformixFilter.hxx +++ b/Core/Main/itkTransformixFilter.hxx @@ -82,7 +82,7 @@ TransformixFilter::GenerateData() if (m_ComputeDeformationField && !m_FixedPointSetFileName.empty()) { itkExceptionMacro("For backwards compatibility, only one of ComputeDeformationFieldOn() or " - "SetFixedPointSetFileName() can be active at any one time.") + "SetFixedPointSetFileName() can be active at any one time."); } // Setup argument map which transformix uses internally ito figure out what needs to be done @@ -124,7 +124,7 @@ TransformixFilter::GenerateData() if (!m_OutputDirectory.empty() && !itksys::SystemTools::FileExists(m_OutputDirectory)) { - itkExceptionMacro("Output directory \"" << m_OutputDirectory << "\" does not exist.") + itkExceptionMacro("Output directory \"" << m_OutputDirectory << "\" does not exist."); } if (!m_OutputDirectory.empty())