<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7655.8">
<TITLE>Dicom Image : How to access to all the tags</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi Insight-users,<BR>
I have a problem: I don't know how can I access to all the tags present in a dicom image.<BR>
With the code used in the example of the manual (Examples/IO/DicomImageReadPrintTags.cxx) not all the tags are printed and for accuracy in the output there isn't the tag "SequenceOfUltrasoundReagions" that interest me. But I know that in the file which I run this tag is present.<BR>
How can I access to this tag?<BR>
I hope I was understandable.<BR>
In particular the piece of code is:<BR>
<BR>
<BR>
typedef itk::MetaDataDictionary DictionaryType;<BR>
const DictionaryType & dictionary = dicomIO->GetMetaDataDictionary();<BR>
typedef itk::MetaDataObject< std::string > MetaDataStringType;<BR>
DictionaryType::ConstIterator itr = dictionary.Begin();<BR>
DictionaryType::ConstIterator end = dictionary.End();<BR>
<BR>
while( itr != end )<BR>
{<BR>
itk::MetaDataObjectBase::Pointer entry = itr->second;<BR>
<BR>
MetaDataStringType::Pointer entryvalue = dynamic_cast<MetaDataStringType *>( entry.GetPointer() );<BR>
<BR>
if( entryvalue )<BR>
{<BR>
std::string tagkey = itr->first;<BR>
std::string labelId;<BR>
bool found = itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId );<BR>
<BR>
std::string tagvalue = entryvalue->GetMetaDataObjectValue();<BR>
<BR>
if( found )<BR>
{<BR>
std::cout << "(" << tagkey << ") " << labelId;<BR>
std::cout << " = " << tagvalue.c_str() << std::endl;<BR>
if (tagkey == "0018|6011")<BR>
std::cout << "\n\nTROVATO!!!!!\n\n";<BR>
}<BR>
<BR>
else<BR>
{<BR>
std::cout << "(" << tagkey << ") " << "Unknown";<BR>
std::cout << " = " << tagvalue.c_str() << std::endl;<BR>
}<BR>
}<BR>
<BR>
++itr;<BR>
}<BR>
<BR>
<BR>
<BR>
Thank you vary much<BR>
Edoardo<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>