[Insight-users] WG: private Tags
John Drescher
drescherjm at gmail.com
Wed Sep 14 09:18:10 EDT 2011
2011/9/14 Torsten Schön <Torsten.Schoen at soft-gate.de>:
>
>
> 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?
>
>
You need to use system GDCM 2.0.X or ITK-4.0.X
John
More information about the Insight-users
mailing list