42 #include "itkConfigure.h" 43 #include "ITKCommonExport.h" 72 #define ITK_PRAGMA(x) _Pragma (#x) 78 #if defined(__clang__) && defined(__has_warning) 79 #define CLANG_PRAGMA_PUSH ITK_PRAGMA(clang diagnostic push) 80 #define CLANG_PRAGMA_POP ITK_PRAGMA(clang diagnostic pop) 81 # if __has_warning("-Wfloat-equal") 82 #define CLANG_SUPPRESS_Wfloat_equal ITK_PRAGMA( clang diagnostic ignored "-Wfloat-equal" ) 85 #define CLANG_PRAGMA_PUSH 86 #define CLANG_PRAGMA_POP 87 #define CLANG_SUPPRESS_Wfloat_equal 96 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) 97 # if ( __GNUC__ > 4 ) || (( __GNUC__ >= 4 ) && ( __GNUC_MINOR__ >= 2 )) 98 # define ITK_GCC_PRAGMA_DIAG(x) ITK_PRAGMA(GCC diagnostic x) 100 # define ITK_GCC_PRAGMA_DIAG(x) 103 # define ITK_GCC_PRAGMA_DIAG(x) 115 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) 116 # if ( __GNUC__ > 4 ) || (( __GNUC__ >= 4 ) && ( __GNUC_MINOR__ >= 6 )) 117 # define ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(push) 118 # define ITK_GCC_PRAGMA_DIAG_POP() ITK_GCC_PRAGMA_DIAG(pop) 119 # define ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP 121 # define ITK_GCC_PRAGMA_DIAG_PUSH() 122 # define ITK_GCC_PRAGMA_DIAG_POP() 125 # define ITK_GCC_PRAGMA_DIAG_PUSH() 126 # define ITK_GCC_PRAGMA_DIAG_POP() 140 #if defined( _MSC_VER ) && ( _MSC_VER < 1310 ) 143 #if defined( __SUNPRO_CC ) && ( __SUNPRO_CC < 0x590 ) 144 #error "__SUNPRO_CC < 0x590 not supported under ITKv4" 146 #if defined( __CYGWIN__ ) 147 #error "The Cygwin compiler is not supported in ITKv4 and above" 149 #if defined( __BORLANDC__ ) 150 #error "The Borland C compiler is not supported in ITKv4 and above" 152 #if defined( __MWERKS__ ) 153 #error "The MetroWerks compiler is not supported in ITKv4 and above" 155 #if defined( __GNUC__ ) && ( __GNUC__ < 3 ) 156 #error "The __GNUC__ version 2.95 compiler is not supprted under ITKv4 and above" 161 #error "The __sgi compiler is not supprted under ITKv4 and above" 166 #if defined( _WIN32 ) || defined ( WIN32 ) 167 #define ITK_ABI_IMPORT __declspec(dllimport) 168 #define ITK_ABI_EXPORT __declspec(dllexport) 169 #define ITK_ABI_HIDDEN 172 #define ITK_ABI_IMPORT __attribute__ ((visibility ("default"))) 173 #define ITK_ABI_EXPORT __attribute__ ((visibility ("default"))) 174 #define ITK_ABI_HIDDEN __attribute__ ((visibility ("hidden"))) 176 #define ITK_ABI_IMPORT 177 #define ITK_ABI_EXPORT 178 #define ITK_ABI_HIDDEN 182 #if ITK_COMPILED_CXX_VERSION >= 201103L 186 #define ITK_OVERRIDE override 189 #define ITK_DELETE_FUNCTION =delete 195 #define ITK_NULLPTR nullptr 201 #define ITK_NOEXCEPT noexcept 202 #define ITK_HAS_CXX11_STATIC_ASSERT 203 #define ITK_HAS_CXX11_RVREF 204 #define ITK_CONSTEXPR constexpr 205 #define ITK_CONSTEXPR_FUNC constexpr 208 #define ITK_DELETE_FUNCTION 209 #define ITK_NULLPTR NULL 210 #define ITK_NOEXCEPT throw() 211 #define ITK_CONSTEXPR const 212 #define ITK_CONSTEXPR_FUNC inline 217 #if ITK_COMPILED_CXX_VERSION >= 201103L && defined(__has_warning) 218 # if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") 219 # define ITK_FALLTHROUGH [[clang::fallthrough]] 223 #ifndef ITK_FALLTHROUGH 224 # define ITK_FALLTHROUGH ((void)0) 247 #define itkNewMacro(x) \ 248 itkSimpleNewMacro(x) \ 249 itkCreateAnotherMacro(x) \ 252 #define itkSimpleNewMacro(x) \ 253 static Pointer New(void) \ 255 Pointer smartPtr = ::itk::ObjectFactory< x >::Create(); \ 256 if ( smartPtr.GetPointer() == ITK_NULLPTR ) \ 260 smartPtr->UnRegister(); \ 264 #define itkCreateAnotherMacro(x) \ 265 virtual ::itk::LightObject::Pointer CreateAnother(void) const ITK_OVERRIDE \ 267 ::itk::LightObject::Pointer smartPtr; \ 268 smartPtr = x::New().GetPointer(); \ 272 #define itkCloneMacro(x) \ 273 Pointer Clone() const \ 276 dynamic_cast<x *>(this->InternalClone().GetPointer()); \ 296 #define itkFactorylessNewMacro(x) \ 297 static Pointer New(void) \ 300 x * rawPtr = new x; \ 302 rawPtr->UnRegister(); \ 305 virtual ::itk::LightObject::Pointer CreateAnother(void) const ITK_OVERRIDE \ 307 ::itk::LightObject::Pointer smartPtr; \ 308 smartPtr = x::New().GetPointer(); \ 315 #define itkTypeMacro(thisClass, superclass) \ 316 virtual const char *GetNameOfClass() const ITK_OVERRIDE \ 321 #define itkTypeMacroNoParent(thisClass) \ 322 virtual const char *GetNameOfClass() const \ 335 extern ITKCommon_EXPORT
void OutputWindowDisplayText(
const char *);
338 extern ITKCommon_EXPORT
void OutputWindowDisplayErrorText(
const char *);
340 extern ITKCommon_EXPORT
void OutputWindowDisplayWarningText(
const char *);
342 extern ITKCommon_EXPORT
void OutputWindowDisplayGenericOutputText(
const char *);
344 extern ITKCommon_EXPORT
void OutputWindowDisplayDebugText(
const char *);
350 #if defined( NDEBUG ) 351 #define itkDebugMacro(x) 352 #define itkDebugStatement(x) 354 #define itkDebugMacro(x) \ 356 if ( this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay() ) \ 358 std::ostringstream itkmsg; \ 359 itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \ 360 << this->GetNameOfClass() << " (" << this << "): " x \ 362 ::itk::OutputWindowDisplayDebugText( itkmsg.str().c_str() ); \ 369 #define itkDebugStatement(x) x 375 #define itkWarningMacro(x) \ 377 if ( ::itk::Object::GetGlobalWarningDisplay() ) \ 379 std::ostringstream itkmsg; \ 380 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \ 381 << this->GetNameOfClass() << " (" << this << "): " x \ 383 ::itk::OutputWindowDisplayWarningText( itkmsg.str().c_str() ); \ 390 #define itkWarningStatement(x) x 392 #if defined( ITK_CPP_FUNCTION ) 393 #if defined( _WIN32 ) && !defined( __MINGW32__ ) && !defined( ITK_WRAPPING_PARSER ) 394 #define ITK_LOCATION __FUNCSIG__ 395 #elif defined( __GNUC__ ) 396 #define ITK_LOCATION __PRETTY_FUNCTION__ 398 #define ITK_LOCATION __FUNCTION__ 401 #define ITK_LOCATION "unknown" 409 #define itkExceptionMacro(x) \ 411 std::ostringstream message; \ 412 message << "itk::ERROR: " << this->GetNameOfClass() \ 413 << "(" << this << "): " x; \ 414 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \ 419 #define itkGenericExceptionMacro(x) \ 421 std::ostringstream message; \ 422 message << "itk::ERROR: " x; \ 423 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \ 427 #define itkDeclareExceptionMacro(newexcp,parentexcp,whatmessage) \ 429 class newexcp : public parentexcp \ 432 newexcp( const char *file, unsigned int lineNumber ) : \ 433 parentexcp( file, lineNumber ) \ 435 this->SetDescription( whatmessage ); \ 437 newexcp( const std::string & file, unsigned int lineNumber ) : \ 438 parentexcp( file, lineNumber ) \ 440 this->SetDescription( whatmessage ); \ 442 itkTypeMacro(newexcp, parentexcp); \ 446 #define itkSpecializedExceptionMacro(exceptiontype) \ 448 ::itk::exceptiontype e_(__FILE__, __LINE__); \ 449 e_.SetLocation(ITK_LOCATION); \ 453 #define itkSpecializedMessageExceptionMacro(exceptiontype,x) \ 455 ::itk::exceptiontype e_(__FILE__, __LINE__); \ 456 std::ostringstream message; \ 457 message << "itk::ERROR: " x; \ 458 e_.SetDescription(message.str().c_str()); \ 459 e_.SetLocation(ITK_LOCATION); \ 464 #define itkGenericOutputMacro(x) \ 466 if ( ::itk::Object::GetGlobalWarningDisplay() ) \ 468 std::ostringstream itkmsg; \ 469 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \ 471 ::itk::OutputWindowDisplayGenericOutputText( itkmsg.str().c_str() ); \ 478 #define itkLogMacro(x, y) \ 480 if ( this->GetLogger() ) \ 482 this->GetLogger()->Write(::itk::LoggerBase::x, y); \ 486 #define itkLogMacroStatic(obj, x, y) \ 488 if ( obj->GetLogger() ) \ 490 obj->GetLogger()->Write(::itk::LoggerBase::x, y); \ 518 #if defined( ITK_LEGACY_REMOVE ) 519 #define itkLegacyMacro(method) 520 #elif defined( ITK_LEGACY_SILENT ) || defined( ITK_LEGACY_TEST ) || defined( ITK_WRAPPING_PARSER ) 522 #define itkLegacyMacro(method) method 526 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) && ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) ) 527 #define itkLegacyMacro(method) method __attribute__( ( deprecated ) ) 528 #elif defined( _MSC_VER ) 529 #define itkLegacyMacro(method) __declspec(deprecated) method 531 #define itkLegacyMacro(method) method 550 #if defined( ITK_LEGACY_REMOVE ) || defined( ITK_LEGACY_SILENT ) 551 #define itkLegacyBodyMacro(method, version) 552 #define itkLegacyReplaceBodyMacro(method, version, replace) 553 #define itkGenericLegacyBodyMacro(method, version) 554 #define itkGenericLegacyReplaceBodyMacro(method, version, replace) 556 #define itkLegacyBodyMacro(method, version) \ 557 itkWarningMacro(#method " was deprecated for ITK " #version " and will be removed in a future version.") 558 #define itkLegacyReplaceBodyMacro(method, version, replace) \ 560 #method " was deprecated for ITK " #version " and will be removed in a future version. Use " #replace \ 562 #define itkGenericLegacyBodyMacro(method, version) \ 563 itkGenericOutputMacro(#method " was deprecated for ITK " #version " and will be removed in a future version.") 564 #define itkGenericLegacyReplaceBodyMacro(method, version, replace) \ 565 itkGenericOutputMacro( \ 566 #method " was deprecated for ITK " #version " and will be removed in a future version. Use " #replace \ 570 #if defined ( ITK_LEGACY_REMOVE ) 571 #define ITK_TEMPLATE_TXX "error ITK_TEMPLATE_TXX is no longer a supported identifier, you should replace with ITK_MANUAL_INSTANTIATION as a replacement" 573 #define ITK_TEMPLATE_TXX 1 581 #define ITK_CACHE_LINE_ALIGNMENT 64 589 #define itkPadStruct( mincachesize, oldtype, newtype ) \ 590 struct newtype: public oldtype \ 592 char _StructPadding[mincachesize - (sizeof(oldtype)%mincachesize) ]; \ 599 #if defined( ITK_HAS_GNU_ATTRIBUTE_ALIGNED ) 600 # define itkAlignedTypedef( alignment, oldtype, newtype ) \ 601 typedef oldtype newtype __attribute__((aligned(alignment))) 602 #elif defined ( _MSC_VER ) 603 # define itkAlignedTypedef( alignment, oldtype, newtype ) \ 604 typedef __declspec(align( alignment )) oldtype newtype 606 # define itkAlignedTypedef( alignment, oldtype, newtype ) \ 607 typedef oldtype newtype 639 #if defined( ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_NULL_STRING ) 640 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T) 642 #if defined( ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_EMPTY_BRACKETS ) 643 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T) < > 645 #if defined( ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_TEMPLATE_ARGUMENTS ) 646 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T) < T > 652 #if ( defined ( _MSC_VER ) && ( _MSC_VER >= 1600 ) ) 653 #ifdef ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT 654 #undef ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT 656 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T) 672 #define itkForLoopAssignmentMacro(DestinationType, \ 674 DestinationElementType, \ 677 NumberOfIterations) \ 678 for ( unsigned int i = 0; i < NumberOfIterations; ++i ) \ 680 DestinationArray[i] = static_cast< DestinationElementType >( SourceArray[i] ); \ 692 #define itkForLoopRoundingAndAssignmentMacro(DestinationType, \ 693 Sourcrnd_halfintup, \ 694 DestinationElementType, \ 697 NumberOfIterations) \ 698 for ( unsigned int i = 0; i < NumberOfIterations; ++i ) \ 700 DestinationArray[i] = itk::Math::Round< DestinationElementType >(SourceArray[i]); \ 708 #define itkAssertInDebugOrThrowInReleaseMacro(msg) __assert_fail (msg, __FILE__, __LINE__, __ASSERT_FUNCTION); 710 #define itkAssertInDebugOrThrowInReleaseMacro(msg) itkGenericExceptionMacro(<< msg); 714 #define itkAssertInDebugOrThrowInReleaseMacro(msg) itkGenericExceptionMacro(<< msg); 717 #define itkAssertOrThrowMacro(test, message) \ 720 std::ostringstream msgstr; \ 722 itkAssertInDebugOrThrowInReleaseMacro( msgstr.str().c_str() ); \ 726 #define itkAssertInDebugAndIgnoreInReleaseMacro(X) assert(X) 728 #define itkAssertInDebugAndIgnoreInReleaseMacro(X) 731 #ifdef ITKV3_COMPATIBILITY 735 #define ITK_TYPENAME typename 741 template <
typename TTarget,
typename TSource>
742 TTarget itkDynamicCastInDebugMode(TSource x)
749 TTarget rval =
dynamic_cast<TTarget
>(x);
752 itkGenericExceptionMacro(<<
"Failed dynamic cast to " 753 <<
typeid(TTarget).name()
755 << x->GetNameOfClass());
759 return static_cast<TTarget
>(x);
783 #if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__ ) < 405 && !defined( __clang__ ) && !defined( __INTEL_COMPILER ) 784 # define itkStaticConstMacro(name,type,value) enum { name = value } 786 # define itkStaticConstMacro(name,type,value) static ITK_CONSTEXPR type name = value 789 #define itkGetStaticConstMacro(name) (Self::name) 792 #define itkSetInputMacro(name, type) \ 793 virtual void Set##name(const type *_arg) \ 795 itkDebugMacro("setting input " #name " to " << _arg); \ 796 if ( _arg != itkDynamicCastInDebugMode< type * >( this->ProcessObject::GetInput(#name) ) ) \ 798 this->ProcessObject::SetInput( #name, const_cast< type * >( _arg ) ); \ 805 #define itkGetInputMacro(name, type) \ 806 virtual const type * Get##name() const \ 808 itkDebugMacro( "returning input " << #name " of " << this->ProcessObject::GetInput(#name) ); \ 809 return itkDynamicCastInDebugMode< const type * >( this->ProcessObject::GetInput(#name) ); \ 814 #define itkSetDecoratedInputMacro(name, type) \ 815 virtual void Set##name##Input(const SimpleDataObjectDecorator< type > *_arg) \ 817 itkDebugMacro("setting input " #name " to " << _arg); \ 818 if ( _arg != itkDynamicCastInDebugMode< SimpleDataObjectDecorator< type > * >( this->ProcessObject::GetInput(#name) ) ) \ 820 this->ProcessObject::SetInput( #name, const_cast< SimpleDataObjectDecorator< type > * >( _arg ) ); \ 824 virtual void Set##name(const SimpleDataObjectDecorator< type > *_arg) \ 826 this->Set##name##Input(_arg); \ 828 virtual void Set##name(const type &_arg) \ 830 typedef SimpleDataObjectDecorator< type > DecoratorType; \ 831 itkDebugMacro("setting input " #name " to " << _arg); \ 832 const DecoratorType *oldInput = \ 833 itkDynamicCastInDebugMode< const DecoratorType * >( \ 834 this->ProcessObject::GetInput(#name) ); \ 836 CLANG_SUPPRESS_Wfloat_equal \ 837 if ( oldInput && oldInput->Get() == _arg ) \ 842 typename DecoratorType::Pointer newInput = DecoratorType::New(); \ 843 newInput->Set(_arg); \ 844 this->Set##name##Input(newInput); \ 849 #define itkGetDecoratedInputMacro(name, type) \ 850 virtual const SimpleDataObjectDecorator< type > * Get##name##Input() const \ 852 itkDebugMacro( "returning input " << #name " of " << this->ProcessObject::GetInput(#name) ); \ 853 return itkDynamicCastInDebugMode< const SimpleDataObjectDecorator< type > * >( this->ProcessObject::GetInput(#name) ); \ 855 virtual const type & Get##name() const \ 857 itkDebugMacro("Getting input " #name); \ 858 typedef SimpleDataObjectDecorator< type > DecoratorType; \ 859 const DecoratorType *input = \ 860 itkDynamicCastInDebugMode< const DecoratorType * >( \ 861 this->ProcessObject::GetInput(#name) ); \ 862 if( input == ITK_NULLPTR ) \ 864 itkExceptionMacro(<<"input" #name " is not set"); \ 866 return input->Get(); \ 872 #define itkSetGetDecoratedInputMacro(name, type) \ 873 itkSetDecoratedInputMacro(name, type) \ 874 itkGetDecoratedInputMacro(name, type) 880 #define itkSetDecoratedObjectInputMacro(name, type) \ 881 virtual void Set##name##Input(const DataObjectDecorator< type > *_arg) \ 883 itkDebugMacro("setting input " #name " to " << _arg); \ 884 if ( _arg != itkDynamicCastInDebugMode< DataObjectDecorator< type > * >( this->ProcessObject::GetInput(#name) ) ) \ 886 this->ProcessObject::SetInput( #name, const_cast< DataObjectDecorator< type > * >( _arg ) ); \ 890 virtual void Set##name(const type * _arg) \ 892 typedef DataObjectDecorator< type > DecoratorType; \ 893 itkDebugMacro("setting input " #name " to " << _arg); \ 894 const DecoratorType *oldInput = \ 895 itkDynamicCastInDebugMode< const DecoratorType * >( \ 896 this->ProcessObject::GetInput(#name) ); \ 897 if ( oldInput && oldInput->Get() == _arg ) \ 901 typename DecoratorType::Pointer newInput = DecoratorType::New(); \ 902 newInput->Set(_arg); \ 903 this->Set##name##Input(newInput); \ 911 #define itkGetDecoratedObjectInputMacro(name, type) \ 912 virtual const DataObjectDecorator< type > * Get##name##Input() const \ 914 itkDebugMacro( "returning input " << #name " of "<< this->ProcessObject::GetInput(#name) ); \ 915 return itkDynamicCastInDebugMode< const DataObjectDecorator< type > * >( this->ProcessObject::GetInput(#name) ); \ 917 virtual const type * Get##name() const \ 919 itkDebugMacro("Getting input " #name); \ 920 typedef DataObjectDecorator< type > DecoratorType; \ 921 const DecoratorType *input = \ 922 itkDynamicCastInDebugMode< const DecoratorType * >( \ 923 this->ProcessObject::GetInput(#name) ); \ 924 if( input == ITK_NULLPTR ) \ 926 return ITK_NULLPTR; \ 928 return input->Get(); \ 934 #define itkSetGetDecoratedObjectInputMacro(name, type) \ 935 itkSetDecoratedObjectInputMacro(name, type) \ 936 itkGetDecoratedObjectInputMacro(name, type) 939 #define itkSetMacro(name, type) \ 940 virtual void Set##name (const type _arg) \ 942 itkDebugMacro("setting " #name " to " << _arg); \ 944 CLANG_SUPPRESS_Wfloat_equal \ 945 if ( this->m_##name != _arg ) \ 947 this->m_##name = _arg; \ 955 #define itkGetMacro(name, type) \ 956 virtual type Get##name () \ 958 return this->m_##name; \ 965 #define itkGetConstMacro(name, type) \ 966 virtual type Get##name () const \ 968 return this->m_##name; \ 976 #define itkGetConstReferenceMacro(name, type) \ 977 virtual const type &Get##name () const \ 979 return this->m_##name; \ 987 #define itkSetEnumMacro(name, type) \ 988 virtual void Set##name (const type _arg) \ 990 itkDebugMacro( "setting " #name " to " << static_cast< long >( _arg ) ); \ 991 if ( this->m_##name != _arg ) \ 993 this->m_##name = _arg; \ 1003 #define itkGetEnumMacro(name, type) \ 1004 virtual type Get##name () const \ 1006 return this->m_##name; \ 1013 #define itkSetStringMacro(name) \ 1014 virtual void Set##name (const char *_arg) \ 1016 if ( _arg && ( _arg == this->m_##name ) ) { return; } \ 1019 this->m_##name = _arg; \ 1023 this->m_##name = ""; \ 1027 virtual void Set##name (const std::string & _arg) \ 1029 this->Set##name( _arg.c_str() ); \ 1037 #define itkGetStringMacro(name) \ 1038 virtual const char *Get##name () const \ 1040 return this->m_##name.c_str(); \ 1046 #define itkSetClampMacro(name, type, min, max) \ 1047 virtual void Set##name (type _arg) \ 1049 const type temp_extrema=( _arg < min ? min : ( _arg > max ? max : _arg ) );\ 1050 itkDebugMacro("setting " << #name " to " << _arg); \ 1052 CLANG_SUPPRESS_Wfloat_equal \ 1053 if ( this->m_##name != temp_extrema ) \ 1055 this->m_##name = temp_extrema; \ 1067 #define itkSetObjectMacro(name, type) \ 1068 virtual void Set##name (type * _arg) \ 1070 itkDebugMacro("setting " << #name " to " << _arg); \ 1072 CLANG_SUPPRESS_Wfloat_equal \ 1073 if ( this->m_##name != _arg ) \ 1075 this->m_##name = _arg; \ 1107 #define itkGetConstObjectMacro(name, type) \ 1108 virtual const type * Get##name () const \ 1110 return this->m_##name.GetPointer(); \ 1114 #if defined ( ITK_FUTURE_LEGACY_REMOVE ) 1120 # define itkGetObjectMacro(name, type) \ 1121 virtual type * Get##name () \ 1123 purposeful_error("itkGetObjectMacro should be replaced with itkGetModifiableObjectMacro."); \ 1126 # define itkGetModifiableObjectMacro(name, type) \ 1127 virtual type * GetModifiable##name () \ 1129 return this->m_##name.GetPointer(); \ 1131 itkGetConstObjectMacro(name, type) 1133 #else // defined ( ITK_FUTURE_LEGACY_REMOVE ) 1136 # define itkGetObjectMacro(name, type) \ 1137 virtual type * Get##name () \ 1139 return this->m_##name.GetPointer(); \ 1141 # define itkGetModifiableObjectMacro(name, type) \ 1142 virtual type * GetModifiable##name () \ 1144 return this->m_##name.GetPointer(); \ 1146 itkGetConstObjectMacro(name, type) \ 1147 itkGetObjectMacro(name, type) 1148 #endif // defined ( ITK_FUTURE_LEGACY_REMOVE ) 1157 #define itkGetConstReferenceObjectMacro(name, type) \ 1158 virtual const typename type::Pointer & Get##name () const \ 1160 return this->m_##name; \ 1167 #define itkSetConstObjectMacro(name, type) \ 1168 virtual void Set##name (const type * _arg) \ 1170 itkDebugMacro("setting " << #name " to " << _arg); \ 1171 if ( this->m_##name != _arg ) \ 1173 this->m_##name = _arg; \ 1181 #define itkBooleanMacro(name) \ 1182 virtual void name##On () \ 1184 this->Set##name(true); \ 1186 virtual void name##Off () \ 1188 this->Set##name(false); \ 1195 #define itkSetVectorMacro(name, type, count) \ 1196 virtual void Set##name(type data[]) \ 1199 for ( i = 0; i < count; i++ ) \ 1202 CLANG_SUPPRESS_Wfloat_equal \ 1203 if ( data[i] != this->m_##name[i] ) \ 1212 for ( i = 0; i < count; i++ ) \ 1214 this->m_##name[i] = data[i]; \ 1222 #define itkGetVectorMacro(name, type, count) \ 1223 virtual type * Get##name () const \ 1225 return this->m_##name; \ 1232 #define itkGPUKernelClassMacro(kernel) \ 1333
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...