ITK  5.0.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
itk::MetaDataDictionary Class Reference

#include <itkMetaDataDictionary.h>

Detailed Description

Provides a mechanism for storing a collection of arbitrary data types.

Author
Hans J. Johnson

The MetaDataDictionary, along with the MetaDataObject derived template classes, is designed to provide a mechanism for storing a collection of arbitrary data types. The main motivation for such a collection is to associate arbitrary data elements with itk DataObjects.

The MetaDataDictionary implements shallow copying with copy on write behavior. When a copy of this class is created, the new copy will be shared with the old copy via C++11 shared pointers. When a non-constant operation is done, if the dictionary is not unique to this object, then a deep copy is performed. This make is very cheap to create multiple copies of the same dictionary if they are never modified.

Examples:
Examples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx, Examples/IO/DicomImageReadChangeHeaderWrite.cxx, Examples/IO/DicomImageReadPrintTags.cxx, Examples/IO/DicomSeriesReadPrintTags.cxx, Examples/IO/ImageReadDicomSeriesWrite.cxx, and WikiExamples/DICOM/ResampleDICOM.cxx.

Definition at line 50 of file itkMetaDataDictionary.h.

Public Types

using ConstIterator = MetaDataDictionaryMapType::const_iterator
 
using Iterator = MetaDataDictionaryMapType::iterator
 
using MetaDataDictionaryMapType = std::map< std::string, MetaDataObjectBase::Pointer >
 
using Self = MetaDataDictionary
 

Public Member Functions

void Clear ()
 
bool Erase (const std::string &)
 
Iterator Find (const std::string &key)
 
ConstIterator Find (const std::string &key) const
 
const MetaDataObjectBaseGet (const std::string &) const
 
std::vector< std::string > GetKeys () const
 
bool HasKey (const std::string &) const
 
 MetaDataDictionary ()
 
 MetaDataDictionary (const MetaDataDictionary &)
 
 MetaDataDictionary (MetaDataDictionary &&)=default
 
MetaDataDictionaryoperator= (const MetaDataDictionary &)
 
MetaDataDictionaryoperator= (MetaDataDictionary &&)=default
 
MetaDataObjectBase::Pointeroperator[] (const std::string &)
 
const MetaDataObjectBaseoperator[] (const std::string &) const
 
virtual void Print (std::ostream &os) const
 
void Set (const std::string &, MetaDataObjectBase *)
 
void Swap (MetaDataDictionary &other)
 
virtual ~MetaDataDictionary ()
 
Iterator Begin ()
 
ConstIterator Begin () const
 
Iterator End ()
 
ConstIterator End () const
 

Private Member Functions

bool MakeUnique (void)
 

Private Attributes

std::shared_ptr
< MetaDataDictionaryMapType
m_Dictionary
 

Member Typedef Documentation

using itk::MetaDataDictionary::ConstIterator = MetaDataDictionaryMapType::const_iterator

Definition at line 64 of file itkMetaDataDictionary.h.

using itk::MetaDataDictionary::Iterator = MetaDataDictionaryMapType::iterator

Definition at line 63 of file itkMetaDataDictionary.h.

Definition at line 62 of file itkMetaDataDictionary.h.

Definition at line 53 of file itkMetaDataDictionary.h.

Constructor & Destructor Documentation

itk::MetaDataDictionary::MetaDataDictionary ( )
itk::MetaDataDictionary::MetaDataDictionary ( const MetaDataDictionary )
itk::MetaDataDictionary::MetaDataDictionary ( MetaDataDictionary &&  )
default
virtual itk::MetaDataDictionary::~MetaDataDictionary ( )
virtual

Member Function Documentation

Iterator itk::MetaDataDictionary::Begin ( )
Warning
the following functions SHOULD NOT be used with the visual studio 6 compiler since iterator outside of the dll context cannot be dereferenced safely Returns an iterator to the beginning of the map
Examples:
WikiExamples/DICOM/ResampleDICOM.cxx.
ConstIterator itk::MetaDataDictionary::Begin ( ) const
Warning
the following functions SHOULD NOT be used with the visual studio 6 compiler since iterator outside of the dll context cannot be dereferenced safely Returns an iterator to the beginning of the map
void itk::MetaDataDictionary::Clear ( )

remove all MetaObjects from dictionary

Iterator itk::MetaDataDictionary::End ( )

Returns an iterator to the end of the map

Examples:
WikiExamples/DICOM/ResampleDICOM.cxx.

Referenced by itk::ExposeMetaData().

ConstIterator itk::MetaDataDictionary::End ( ) const

Returns an iterator to the end of the map

bool itk::MetaDataDictionary::Erase ( const std::string &  )
Iterator itk::MetaDataDictionary::Find ( const std::string &  key)

Returns an iterator matching the string key

Referenced by itk::ExposeMetaData().

ConstIterator itk::MetaDataDictionary::Find ( const std::string &  key) const
const MetaDataObjectBase* itk::MetaDataDictionary::Get ( const std::string &  ) const
std::vector< std::string > itk::MetaDataDictionary::GetKeys ( ) const

Returns a vector of keys to the key/value entries in the dictionary. Iterate through the dictionary using these keys.

Examples:
Examples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx.
bool itk::MetaDataDictionary::HasKey ( const std::string &  ) const
bool itk::MetaDataDictionary::MakeUnique ( void  )
private
MetaDataDictionary& itk::MetaDataDictionary::operator= ( const MetaDataDictionary )
MetaDataDictionary& itk::MetaDataDictionary::operator= ( MetaDataDictionary &&  )
default
MetaDataObjectBase::Pointer& itk::MetaDataDictionary::operator[] ( const std::string &  )
const MetaDataObjectBase* itk::MetaDataDictionary::operator[] ( const std::string &  ) const
virtual void itk::MetaDataDictionary::Print ( std::ostream &  os) const
virtual

Defines the default behavior for printing out this element

Parameters
osAn output stream
void itk::MetaDataDictionary::Set ( const std::string &  ,
MetaDataObjectBase  
)
void itk::MetaDataDictionary::Swap ( MetaDataDictionary other)

Referenced by itk::swap().

Member Data Documentation

std::shared_ptr<MetaDataDictionaryMapType> itk::MetaDataDictionary::m_Dictionary
private

Definition at line 131 of file itkMetaDataDictionary.h.


The documentation for this class was generated from the following file: