From 0f399024321528952a531f9af32b9f90d64f3ded Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Tue, 17 May 2022 10:25:19 -0400 Subject: [PATCH 1/2] BUG: Remove broken warning in `itk::GaussianOperator` Hotfix for failing Linux/macOS builds where itkDebugMacro is not supported in `itk::GaussianOperator`. --- Modules/Core/Common/include/itkGaussianOperator.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/Core/Common/include/itkGaussianOperator.hxx b/Modules/Core/Common/include/itkGaussianOperator.hxx index e1169802ecb..a1a6bc820bc 100644 --- a/Modules/Core/Common/include/itkGaussianOperator.hxx +++ b/Modules/Core/Common/include/itkGaussianOperator.hxx @@ -50,13 +50,15 @@ GaussianOperator::GenerateCoefficients() -> Coef { break; // failsafe } + /* + // TODO: See https://github.com/InsightSoftwareConsortium/ITK/issues/3430 if (coeff.size() > m_MaximumKernelWidth) { itkDebugMacro(<< "Kernel size has exceeded the specified maximum width of " << m_MaximumKernelWidth << " and has been truncated to " << coeff.size() << " elements. You can raise the maximum width using the SetMaximumKernelWidth method."); break; - } + }*/ } // Normalize the coefficients so that their sum is one. for (it = coeff.begin(); it < coeff.end(); ++it) From 5c44b7f5e30420c11d64c5991eed80db3f11d466 Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Tue, 17 May 2022 10:49:52 -0400 Subject: [PATCH 2/2] BUG: Add `itk::GaussianOperator` debug methods Addresses #3430 where `itkDebugMacro` fails in `itk::GaussianOperator` because it does not inherit from `itk::Object` and therefore does not implicitly define `GetDebug`. --- .../Core/Common/include/itkGaussianOperator.h | 30 +++++++++++++++++++ .../Common/include/itkGaussianOperator.hxx | 4 +-- Modules/Core/Common/include/itkMacro.h | 3 +- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Modules/Core/Common/include/itkGaussianOperator.h b/Modules/Core/Common/include/itkGaussianOperator.h index 950226166c4..6e5678c9fdf 100644 --- a/Modules/Core/Common/include/itkGaussianOperator.h +++ b/Modules/Core/Common/include/itkGaussianOperator.h @@ -142,6 +142,33 @@ class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator= 0. */ @@ -185,6 +212,9 @@ class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator::GenerateCoefficients() -> Coef { break; // failsafe } - /* - // TODO: See https://github.com/InsightSoftwareConsortium/ITK/issues/3430 if (coeff.size() > m_MaximumKernelWidth) { itkDebugMacro(<< "Kernel size has exceeded the specified maximum width of " << m_MaximumKernelWidth << " and has been truncated to " << coeff.size() << " elements. You can raise the maximum width using the SetMaximumKernelWidth method."); break; - }*/ + } } // Normalize the coefficients so that their sum is one. for (it = coeff.begin(); it < coeff.end(); ++it) diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index e19fcfaf701..db96aacfa45 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -477,7 +477,8 @@ OutputWindowDisplayDebugText(const char *); // The itkDebugStatement is to be used to protect code that is only used in the itkDebugMacro /** This macro is used to print debug (or other information). They are - * also used to catch errors, etc. Example usage looks like: + * also used to catch errors, etc. Requires that the caller implements + * the GetDebug() method (see itk::Object). Example usage looks like: * itkDebugMacro(<< "this is debug info" << this->SomeVariable); */ #if defined(NDEBUG) # define itkDebugMacro(x) ITK_NOOP_STATEMENT