28 #ifndef itkMetaDataObject_h
29 #define itkMetaDataObject_h
72 template<
typename MetaDataObjectType >
85 itkFactorylessNewMacro(
Self);
96 const char * GetMetaDataObjectTypeName()
const override;
104 const std::type_info & GetMetaDataObjectTypeInfo()
const override;
111 const MetaDataObjectType & GetMetaDataObjectValue()
const;
118 void SetMetaDataObjectValue(
const MetaDataObjectType & newValue);
124 void Print(std::ostream & os)
const override;
147 template<
typename T >
151 temp->SetMetaDataObjectValue(invalue);
152 Dictionary[key] = temp;
156 template<
typename T >
171 template<
typename T >
174 auto keyIter = Dictionary.
Find(key);
175 if ( keyIter == Dictionary.
End() )
181 auto const *
const TempMetaDataObject =
dynamic_cast< MetaDataObject< T > const *
>( keyIter->second.GetPointer() );
182 if ( TempMetaDataObject ==
nullptr )
200 #define ITK_NATIVE_TYPE_METADATAPRINT(TYPE_NAME) \
203 ::itk::MetaDataObject< TYPE_NAME > \
204 ::Print(std::ostream & os) const \
206 os << this->m_MetaDataObjectValue << std::endl; \
217 #define ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(TYPE_NAME_PART1, TYPE_NAME_PART2) \
220 itk::MetaDataObject< TYPE_NAME_PART1, TYPE_NAME_PART2 > \
221 ::Print(std::ostream & os) const \
223 this->m_MetaDataObjectValue->Print(os); \
233 #define ITK_IMAGE_TYPE_METADATAPRINT(STORAGE_TYPE) \
234 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 1 >::Pointer) \
235 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 2 >::Pointer) \
236 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 3 >::Pointer) \
237 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 4 >::Pointer) \
238 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 5 >::Pointer) \
239 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 6 >::Pointer) \
240 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 7 >::Pointer) \
241 ITK_OBJECT_TYPE_METADATAPRINT_1COMMA(itk::Image< STORAGE_TYPE, 8 >::Pointer) \
243 #ifndef ITK_MANUAL_INSTANTIATION
244 #include "itkMetaDataObject.hxx"
247 #endif //itkMetaDataObject_h
250 #ifndef ITK_TEMPLATE_EXPLICIT_MetaDataObject
259 # if defined( ITKCommon_EXPORTS )
261 # define ITKCommon_EXPORT_EXPLICIT ITK_TEMPLATE_EXPORT
264 # define ITKCommon_EXPORT_EXPLICIT ITKCommon_EXPORT
269 #ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP
270 ITK_GCC_PRAGMA_DIAG_PUSH()
272 ITK_GCC_PRAGMA_DIAG(ignored
"-Wattributes")
299 #ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP
300 ITK_GCC_PRAGMA_DIAG_POP()
302 ITK_GCC_PRAGMA_DIAG(warning
"-Wattributes")
306 # undef ITKCommon_EXPORT_EXPLICIT
Light weight base class for most itk classes.
void EncapsulateMetaData(MetaDataDictionary &Dictionary, const std::string &key, const T &invalue)
bool ExposeMetaData(const MetaDataDictionary &Dictionary, const std::string key, T &outval)