<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span lang="EN-AU">I try to read some private tags from a DICOM image file.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU">I am using the following code:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas;color:green">// Pixel type</span><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">typedef</span> <span style="color:blue">signed</span> <span style="color:blue">
short</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:royalblue">PixelType</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:green">// dimension</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">const</span> <span style="color:blue">unsigned</span> <span style="color:blue">
int</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dimension = 2;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue">typedef</span><span style="font-size:9.5pt;font-family:Consolas"> itk::<span style="color:teal">Image</span>&lt;
<span style="color:royalblue">PixelType</span>, Dimension &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:royalblue">
ImageType</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas;color:blue">typedef</span><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"> itk::<span style="color:teal">ImageFileReader</span>&lt;
<span style="color:royalblue">ImageType</span> &gt;&nbsp;&nbsp;&nbsp;&nbsp; ReaderType;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">typedef</span> itk::<span style="color:teal">GDCMImageIO</span> ImageIOType;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">typedef</span> itk::<span style="color:teal">MetaDataDictionary</span> DictionaryType;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">typedef</span> itk::<span style="color:teal">MetaDataObject</span>&lt; std::string &gt; MetaDataStringType;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">typedef</span> itk::<span style="color:teal">MetaDataObject</span>&lt;
<span style="color:blue">int</span> &gt; MetaDataIntegerType;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReaderType::Pointer reader = ReaderType::New();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageIOType::Pointer dicomIO = ImageIOType::New();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dicomIO-&gt;SetLoadPrivateTags(<span style="color:#790058">true</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dicomIO-&gt;LoadPrivateTagsOn();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dicomIO-&gt;SetMaxSizeLoadEntry(0xffff);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader-&gt;SetFileName( m_sImageFileName );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader-&gt;<span style="color:navy">SetImageIO</span>( dicomIO );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader-&gt;Update();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::string value;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#790058">bool</span> res = dicomIO-&gt;GetValueFromTag(<span style="color:#A31515">&quot;0017|101e&quot;</span>,value);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU">In the documentation I wrote, that </span>
<span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">SetLoadPrivateTags(<span style="color:#790058">true</span>); and LoadPrivateTagsOn() has no effect in the latest versions of gdcm.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">How can I read a private tag from the image?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">By the way, the code works fine if I try to read a non-privat tag!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">Thank you in advance for any response,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:9.5pt;font-family:Consolas">Kind Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU">Torsten</span><span style="mso-fareast-language:DE">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>