MedicalVisualization
ITK Meta Data Dictionary
← Dicom Series Loader with ITK | ● | ITK Concepts Used →
Or print the contents of the Meta Data Dictionary, which contains the dicom tags as key-value pairs:
// get meta data
typedef itk::MetaDataDictionary DictionaryType;
typedef itk::MetaDataObject<std::string> MetaDataStringType;
const DictionaryType &dict = reader->GetMetaDataDictionary();
// print meta data
DictionaryType::ConstIterator itr = dict.Begin();
while (itr!=dict.End())
{
itk::MetaDataObjectBase::Pointer entry = itr->second;
MetaDataStringType::Pointer entryvalue = dynamic_cast<MetaDataStringType *>(entry.GetPointer());
std::string tagvalue = entryvalue->GetMetaDataObjectValue();
std::cout << "key=" << itr->first << " value=" << tagvalue << std::endl;
++itr;
}
typedef itk::MetaDataDictionary DictionaryType;
typedef itk::MetaDataObject<std::string> MetaDataStringType;
const DictionaryType &dict = reader->GetMetaDataDictionary();
// print meta data
DictionaryType::ConstIterator itr = dict.Begin();
while (itr!=dict.End())
{
itk::MetaDataObjectBase::Pointer entry = itr->second;
MetaDataStringType::Pointer entryvalue = dynamic_cast<MetaDataStringType *>(entry.GetPointer());
std::string tagvalue = entryvalue->GetMetaDataObjectValue();
std::cout << "key=" << itr->first << " value=" << tagvalue << std::endl;
++itr;
}