[ITK-users] [Gdcm2] Reading private tags

Mihail Isakov mihail.isakov at googlemail.com
Sat Nov 26 06:51:13 EST 2016


Hello,
to read private tags with GDCM (it works very good), first find out
"private creator" 0x00NN, for example "Philips Imaging DD 001"
and then tag from "Philips Imaging DD 001" dictionary, for example 0xNN03

<...>
else if (tag.IsPrivate())
{
private_tag = true;
const gdcm::PrivateDict & pdict = d.GetPrivateDict();
const gdcm::Tag private_creator_t = tag.GetPrivateCreator();
if(ds.FindDataElement(private_creator_t))
{
const gdcm::DataElement & private_creator_e =
ds.GetDataElement(private_creator_t);
if (!private_creator_e.IsEmpty() &&
!private_creator_e.IsUndefinedLength() &&
private_creator_e.GetByteValue())
{
const QString private_creator
= QString::fromLatin1(private_creator_e.GetByteValue()->GetPointer(),
 private_creator_e.GetByteValue()->GetLength());
const gdcm::PrivateTag
ptag(tag.GetGroup(),tag.GetElement(),private_creator.toLatin1().constData());
const gdcm::DictEntry & pentry = pdict.GetDictEntry(ptag);
tname = QString(pentry.GetName()).trimmed();

if (invalid_vr||unknown_vr) vr = pentry.GetVR();
}
}
}

<...>

Regards,
Mikhail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20161126/4b6d2c6f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bvalue.jpg
Type: image/jpeg
Size: 186398 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20161126/4b6d2c6f/attachment-0001.jpg>


More information about the Insight-users mailing list