[Insight-users] WG: private Tags

Torsten Schön Torsten.Schoen at soft-gate.de
Wed Sep 14 09:02:45 EDT 2011


Hi All,

I try to read some private tags from a DICOM image file.
I am using the following code:

// Pixel type
       typedef signed short       PixelType;
       // dimension
       const unsigned int         Dimension = 2;
       typedef itk::Image< PixelType, Dimension >      ImageType;
       typedef itk::ImageFileReader< ImageType >     ReaderType;
       typedef itk::GDCMImageIO ImageIOType;
       typedef itk::MetaDataDictionary DictionaryType;
       typedef itk::MetaDataObject< std::string > MetaDataStringType;
       typedef itk::MetaDataObject< int > MetaDataIntegerType;

       ReaderType::Pointer reader = ReaderType::New();
       ImageIOType::Pointer dicomIO = ImageIOType::New();

       dicomIO->SetLoadPrivateTags(true);
       dicomIO->LoadPrivateTagsOn();
       dicomIO->SetMaxSizeLoadEntry(0xffff);

      reader->SetFileName( m_sImageFileName );
       reader->SetImageIO( dicomIO );
       reader->Update();

       std::string value;
       bool res = dicomIO->GetValueFromTag("0017|101e",value);

In the documentation I wrote, that SetLoadPrivateTags(true); and LoadPrivateTagsOn() has no effect in the latest versions of gdcm.
How can I read a private tag from the image?

By the way, the code works fine if I try to read a non-privat tag!

Thank you in advance for any response,

Kind Regards,
Torsten

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110914/ba1f49eb/attachment.htm>


More information about the Insight-users mailing list