diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index a2d3b7aefd2..549215fe882 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -1271,6 +1271,14 @@ compilers. ITK_MACROEND_NOOP_STATEMENT +// A useful macro in the PrintSelf method for printing member variables +// that require to be casted to the corresponding numeric value so that +// their numeric value gets printed. +#define itkPrintSelfNumericTraitsMacro(name, type) \ + os << indent << #name << ": " << static_cast::PrintType>(this->m_##name) << std::endl; \ + ITK_MACROEND_NOOP_STATEMENT + + /** Set a decorated output. This defines the Set"name"() and a Set"name"Output() method */ #define itkSetDecoratedOutputMacro(name, type) \ virtual void Set##name##Output(const SimpleDataObjectDecorator * _arg) \