DcmItem::findAndGetString with PrivateTag range

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
alanxz
Posts: 9
Joined: Mon, 2012-05-21, 08:37

DcmItem::findAndGetString with PrivateTag range

#1 Post by alanxz »

Is it possible to use DcmItem::findAndGetString() and related functions with a private tag (declared with a DcmTag object) that is defined with the upper byte left as empty in the data dictionary?

E.g., its entry in private.dic looks like:
(2005,"Philips MR Imaging DD 001",0a)

In the dicom data the creator and data tags could look like:
(2005,0010) "Philips MR Imaging DD 001"
(2005,100a) "data!"

or
(2005,0014) "Philips MR Imaging DD 001"
(2005,140a) "data!"

What I've gleaned from other posts and the how-to doc, here's what I've got:

Code: Select all

{
 DcmDataDictionary &dict = dcmDataDict.wrlock();
 dict.addEntry(new DcmDictEntry(0x2005, 0x0d, EVR_FL, "InvertedRescaleIntercept, 1, 1, "private", OFTrue, "Philips MR Imaging 001");
 dcmDataDict.unlock();
}
...
DcmTag my_tag(0x2005, 0x0d, "Philips MR Imaging 001");
DcmDataset *ds = ...
const char *my_string;
ds->findAndGetString(my_tag, my_string);
This does not work: it simply cannot find the tag.
As a potentially related problem looking at my_tag in the above example, the dictionary look-up fails, so, my_tag doesn't have a VR associated with it.

So is this designed to work this way, or do I have to examine the dataset, looking for the creator codes for the private tag groups and create the my_tag object above dynamically based on which tag element number is used for the creator code?

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest