ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | List of all members
itk::MetaDataDictionary Class Reference

#include <itkMetaDataDictionary.h>

+ Collaboration diagram for itk::MetaDataDictionary:

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

bool Erase (const std::string &)
 
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 *)
 
virtual ~MetaDataDictionary ()
 
std::shared_ptr< MetaDataDictionaryMapTypem_Dictionary
 
Iterator Begin ()
 
ConstIterator Begin () const
 
Iterator End ()
 
ConstIterator End () const
 
Iterator Find (const std::string &key)
 
ConstIterator Find (const std::string &key) const
 
void Clear ()
 
void Swap (MetaDataDictionary &other)
 
bool MakeUnique ()
 

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.

ITK Sphinx Examples:
Examples
Examples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx, Examples/IO/DicomImageReadChangeHeaderWrite.cxx, Examples/IO/DicomImageReadPrintTags.cxx, Examples/IO/DicomSeriesReadPrintTags.cxx, Examples/IO/ImageReadDicomSeriesWrite.cxx, SphinxExamples/src/Core/Common/StoreNonPixelDataInImage/Code.cxx, SphinxExamples/src/IO/GDCM/ReadAndPrintDICOMTags/Code.cxx, and SphinxExamples/src/IO/GDCM/ResampleDICOMSeries/Code.cxx.

Definition at line 53 of file itkMetaDataDictionary.h.

Member Typedef Documentation

◆ ConstIterator

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

Definition at line 68 of file itkMetaDataDictionary.h.

◆ Iterator

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

Definition at line 67 of file itkMetaDataDictionary.h.

◆ MetaDataDictionaryMapType

Definition at line 66 of file itkMetaDataDictionary.h.

◆ Self

Definition at line 56 of file itkMetaDataDictionary.h.

Constructor & Destructor Documentation

◆ MetaDataDictionary() [1/3]

itk::MetaDataDictionary::MetaDataDictionary ( )

◆ MetaDataDictionary() [2/3]

itk::MetaDataDictionary::MetaDataDictionary ( const MetaDataDictionary )

◆ MetaDataDictionary() [3/3]

itk::MetaDataDictionary::MetaDataDictionary ( MetaDataDictionary &&  )
default

◆ ~MetaDataDictionary()

virtual itk::MetaDataDictionary::~MetaDataDictionary ( )
virtual

Member Function Documentation

◆ Begin() [1/2]

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
SphinxExamples/src/Core/Common/StoreNonPixelDataInImage/Code.cxx, and SphinxExamples/src/IO/GDCM/ResampleDICOMSeries/Code.cxx.

◆ Begin() [2/2]

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

◆ Clear()

void itk::MetaDataDictionary::Clear ( )

remove all MetaObjects from dictionary

◆ End() [1/2]

Iterator itk::MetaDataDictionary::End ( )

◆ End() [2/2]

ConstIterator itk::MetaDataDictionary::End ( ) 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

◆ Erase()

bool itk::MetaDataDictionary::Erase ( const std::string &  )

◆ Find() [1/2]

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

Returns an iterator matching the string key

Referenced by itk::ExposeMetaData().

◆ Find() [2/2]

ConstIterator itk::MetaDataDictionary::Find ( const std::string &  key) 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

◆ Get()

const MetaDataObjectBase* itk::MetaDataDictionary::Get ( const std::string &  ) const

◆ GetKeys()

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.

◆ HasKey()

bool itk::MetaDataDictionary::HasKey ( const std::string &  ) const

◆ MakeUnique()

bool itk::MetaDataDictionary::MakeUnique ( )
private
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

◆ operator=() [1/2]

MetaDataDictionary& itk::MetaDataDictionary::operator= ( const MetaDataDictionary )

◆ operator=() [2/2]

MetaDataDictionary& itk::MetaDataDictionary::operator= ( MetaDataDictionary &&  )
default

◆ operator[]() [1/2]

MetaDataObjectBase::Pointer& itk::MetaDataDictionary::operator[] ( const std::string &  )

◆ operator[]() [2/2]

const MetaDataObjectBase* itk::MetaDataDictionary::operator[] ( const std::string &  ) const

◆ Print()

virtual void itk::MetaDataDictionary::Print ( std::ostream &  os) const
virtual

Defines the default behavior for printing out this element

Parameters
osAn output stream
Examples
SphinxExamples/src/Core/Common/StoreNonPixelDataInImage/Code.cxx.

◆ Set()

void itk::MetaDataDictionary::Set ( const std::string &  ,
MetaDataObjectBase  
)

◆ Swap()

void itk::MetaDataDictionary::Swap ( MetaDataDictionary other)
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

Referenced by itk::swap().

Member Data Documentation

◆ m_Dictionary

std::shared_ptr<MetaDataDictionaryMapType> itk::MetaDataDictionary::m_Dictionary
private
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

Definition at line 151 of file itkMetaDataDictionary.h.


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