Skip to content

Commit

Permalink
COMP: Add missing semicolons to ITK macro calls
Browse files Browse the repository at this point in the history
Aims to resolve issue #1224 "Missing semicolons causing compile issues with some compilers".

ITK has become stricter with respect to those semicolons from ITK pull request InsightSoftwareConsortium/ITK#4706 commit InsightSoftwareConsortium/ITK@55e2339 "ENH: Default to allow ITK_MACROEND_NOOP_STATEMENT", Hans Johnson, June 4, 2024.

Co-authored-by: Wildcarde <[email protected]>
  • Loading branch information
N-Dekker and Wildcarde committed Aug 30, 2024
1 parent 657c84a commit 9554422
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ AdvancedAffineTransformElastix<TElastix>::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.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ AffineDTITransformElastix<TElastix>::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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ AffineLogStackTransform<TElastix>::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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ BSplineStackTransform<TElastix>::ReadFromFile()
{
itkExceptionMacro("NumberOfSubTransforms, StackOrigin, StackSpacing, GridSize, GridIndex, GridSpacing and "
"GridOrigin is required by "
<< this->GetNameOfClass() << ".")
<< this->GetNameOfClass() << ".");
}

/** Set it all. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ EulerStackTransform<TElastix>::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();
Expand Down
2 changes: 1 addition & 1 deletion Components/Transforms/EulerTransform/elxEulerTransform.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ EulerTransformElastix<TElastix>::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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ SimilarityTransformElastix<TElastix>::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. */
Expand Down
2 changes: 1 addition & 1 deletion Core/Main/elxParameterObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Core/Main/itkTransformixFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TransformixFilter<TImage>::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
Expand Down Expand Up @@ -124,7 +124,7 @@ TransformixFilter<TImage>::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())
Expand Down

0 comments on commit 9554422

Please sign in to comment.